An open API service indexing awesome lists of open source software.

https://github.com/uojo/demo-rjs

打包工具 rjs 的实践
https://github.com/uojo/demo-rjs

Last synced: 8 months ago
JSON representation

打包工具 rjs 的实践

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