@koa_web/webpack

2.0.43 • Public • Published

简介

webpack4配置(已含babel-loader以及babel-polyfill,postcss-loader,eslint-loader等)

安装&配置

$ npm i @koa_web/webpack --save-dev

使用

config配置js对象

const { vue_dashboard_dev, vue_dashboard_prod, vue_h5_dev, vue_h5_prod } = require('@koa_web/webpack');

支持扩展webpack配置

在项目执行目录下新建webpack.config.js

module.exports = {
  module: {
    ...
  },
  rule: {
    ...
  },
};

示例

server/index.js

app.use(koaEntry(
  [ webRoot ],
  process.env.NODE_ENV === 'development' ? require('@koa_web/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"
    }
}

Readme

Keywords

Package Sidebar

Install

npm i @koa_web/webpack

Weekly Downloads

6

Version

2.0.43

License

MIT

Unpacked Size

20.6 kB

Total Files

15

Last publish

Collaborators

  • jiang111