@ne_fe/webpack
v1.5.5
Published
wepback config for NxE
Downloads
14
Keywords
Readme
简介
webpack4配置(已含babel-loader以及babel-polyfill,postcss-loader,eslint-loader等)
安装&配置
$ npm i @ne_fe/webpack --save-dev
使用
config配置js对象
const { vue_dashboard_dev, vue_dashboard_prod, vue_h5_dev, vue_h5_prod } = require('@ne_fe/webpack');
支持扩展webpack配置
在项目执行目录下新建webpack.config.js
module.exports = {
module: {
...
},
rule: {
...
},
};
示例
- 开发模式,和ne-koa-entry结合使用,详情查看ne-koa-entry文档
server/index.js
app.use(koaEntry(
[ webRoot ],
process.env.NODE_ENV === 'development' ? require('@ne_fe/webpack').vue_dashboard_dev : ''
));
package.json
{
"scripts":{
"dev":"cross-env NODE_ENV=development node server/server.js"
}
}
- 生产模式
package.json
{
"scripts":{
"build":"ne-webpack -c vue_dashboard"
}
}