Packing
基于webpack的前端集成开发环境和编译环境
特点
- 不依赖 host 文件,根据环境自动切换资源路径
- 节约开发服务器,多分支开发部署到同一台服务器不会相互覆盖
- 提供资源包体积分析报告
- Version>=4.0支持babel 7。
Install
- 安装
yo
和generator-packing
npm install -g yo generator-packing
- 生成你的网站
yo packing
- 启动开发模式
npm run serve
-
在浏览器中预览网站 http://localhost:8081
-
其他命令
npm run build
npm run build:dev
npm run build:beta
npm run build:prod
npm run serve:dist
npm run serve:normal
npm run serve -- --open
npm run serve -- -o
npm run serve -- --clean
npm run serve -- -c
Directory
.
├── /bin/
│ ├── /packing-build.js
│ ├── /packing-serve:dist.js
│ ├── /packing-serve.js
│ └── /packing.js
├── /config/
│ ├── /packing.js # 构建工具相关配置
│ ├── /webpack.build.babel.js # webpack编译环境配置文件
│ ├── /webpack.dll.babel.js # DllPlugin插件编译配置
│ └── /webpack.serve:dist.js # webpack预览编译后结果的配置文件
├── /examples/ # 例子
├── /src/ # 项目代码容器目录
├── /util/ # util
├── .babelrc # babel配置
├── .eslintrc.js # eslint配置
├── package.json
└── README.md
例子