https://github.com/uojo/demo-rjs
打包工具 rjs 的实践
https://github.com/uojo/demo-rjs
Last synced: 8 months ago
JSON representation
打包工具 rjs 的实践
- Host: GitHub
- URL: https://github.com/uojo/demo-rjs
- Owner: uojo
- Created: 2016-05-25T04:56:43.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-20T08:43:40.000Z (over 9 years ago)
- Last Synced: 2025-10-10T19:33:51.668Z (8 months ago)
- Language: JavaScript
- Size: 652 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# demo-rjs #
用途:requirejs打包的演示,包括js、css文件
## 执行 ##
基于 r.js
- `node tools/r.js -o conf/file.js` 单个文件打包
- `node tools/r.js -o conf/dir.js` www 目录下的所有文件打包到 www-built
基于 Node
- `node build/file.js` 单个文件打包
- `node build/dir.js` www 目录下的所有文件打包到 www-built
### 目录结构 ###
./assets/js/dxy/
├── www 存放源文件
│ └── js
│ └── app 页面模块
│ └── lib 三方类库
│ └── mod 模块目录
│ └── common.js 共有模块
│ └── page1.js 页面文件
│ └── ...
│ └── page1.html 实例页1
│ └── ...
├── tools 打包配置
│ └── build.js 配置文件
│ └── r.js 打包工具
├── www-built 目录www的一份打包压缩后的拷贝
## 参考 ##
- https://github.com/requirejs/example-multipage
- https://github.com/requirejs/r.js/blob/master/build/example.build.js
- http://www.cnblogs.com/snandy/archive/2012/06/06/2536969.html