Nanometer Process Machine
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

webpack-tool

4.0.3 • Public • Published

Webpack-tool

Webpack Build Tool, Support Features:

  • development mode, webpack build server, file memory, hot update.

  • publish mode, webpack build file to disk.

  • support webpack build result ui view.

  • support http proxy by koa-proxy

Version

  • webpack 4: webpack-tool: 4.x.x
  • webpack 3: webpack-tool: 3.x.x

Install

$ npm i webpack-tool --save

Usage

//build/index.js
const WebpackTool = require('webpack-tool');
const NODE_ENV = process.env.VIEW;
 
const webpackTool = new WebpackTool({
  proxy: {
    host:  'http://localhost:8888',   
    match: /\/debug/
  }
});
 
const webpackConfig = {
  entry:{
    index: './src/index.js'
  },
  module:{
    rules:[]
  }
  plugins: []
};
 
if (NODE_ENV === 'development') {
  // start webpack build and show build result ui view
  webpackTool.server(webpackConfig);
} else {
  // if you want to show build result ui view for build mode, please set  process.env.BUILD_VIEW=true
  webpackTool.build(webpackConfig);
}

Run

"scripts": {
  "start": "cross-env node build"
 }   
npm start

Start Webpack Debug Server: http://127.0.0.1:8888/debug

UI-VIEW

install

npm i webpack-tool

Downloadsweekly downloads

129

version

4.0.3

license

MIT

repository

githubgithub

last publish

collaborators

  • avatar