web 开发常用配置项,包括:
$ npm install web-common-config -D
- eslint + prettier
在项目根目录下新建文件 .eslintrc.js(目前仅支持 js 格式文件)
// eslint-config 返回一个 json 对象,可自行扩展
module.exports = require('web-common-config/lib/eslint-config')
- babel
在项目根目录下新建文件 .babelrc.js (目前仅支持 js 格式文件)
// babel-config 返回一个 json 对象,可自行扩展
module.exports = require('web-common-config/lib/babel-config')
从 v1.0.2 开始,web-common-config 将去除对 babel-loader 的依赖,如果项目中需要 babel-loader,请自行安装。