Skip to content

muzi131313/webpack-tool

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Webpack Build Tool, Support Webpack Build Result Ui View.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%