环境要求
nodejs: v4.4.7+
安装依赖
npm install
// 淘宝源
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install
开始
npm start
- 用浏览器打开 http://localhost:3000
其他指令
// 更新依赖
npm run update
// 打包
npm run build
// 修正css代码格式
npm run stylefmt
已配置的内容
共用
- 解析
es6
scss
- 图片
hash
命名 - 自动打包
javascript
css
中的图片 - 自动打包
html
,引用带hash
- 自动补全
css
浏览器前缀 - 添加
css
浏览器兼容性检查 - 自动修复存在的
css
语法错误
开发环境
javascript
css
热更新eslint
stylelint
代码格式检查- 自动按
.stylelintrc
修正css
代码格式
生产环境
- 去除jsx中的
console.log & console.error & alert
css
打包成文件- 提取第三方
javascript
依赖单独打包 - 代码压缩