Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

yjy-webpack-tool

hubcarl25MIT1.0.0

webpack build and webpack build result web view

webpack, webpack3, webpack4, webpack build, webpack hot reload

readme

webpack-tool

Webpack Build Tool, Support Features:

  • development mode, start webpack koa server, file memory, hot update.

  • production mode, webpack build file to disk.

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
//#TODO 改为引用yjy-webpack-tool
// const WebpackTool = require('webpack-tool');
const WebpackTool = require('ujy-webpack-tool');
const NODE_ENV = process.env.VIEW;

const webpackTool = new WebpackTool({
  devServer: {
    before: before => {
      // register koa middleware
    },
    after: app => {
      // register koa middleware
    },
    proxy: {
      '/api': {
        target: 'http://localhost:3000',
        pathRewrite: {'^/api' : ''}
      }
    },
    historyApiFallback: {
      index: '/app.html'
    }
  }
});

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);
}

Configuration

config.devServer support follow option:

Run

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

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

UI-VIEW

changelog

4.5.3 (2020-04-11)

Bug Fixes

4.5.1 (2019-10-25)

Bug Fixes

  • webpack build err not display (f063637)

4.5.0 (2019-10-21)

Features

  • support proxy pathRewrite (a0b1be4)

4.4.9 (2019-10-09)

Bug Fixes

  • customize cli when process mode (de409f9)

4.4.8 (2019-09-30)

Bug Fixes

4.4.6 (2019-04-03)

Bug Fixes

4.4.5 (2019-04-03)

Bug Fixes

4.4.4 (2019-03-20)

Bug Fixes

4.4.3 (2019-03-07)

Bug Fixes

4.4.2 (2019-02-21)

Bug Fixes

  • browser auto open and navigation url error (315cb80)

4.4.1 (2019-01-22)

Features

4.3.2 (2018-11-15)

Bug Fixes

  • webpack build error, no exit (f719fe8)

4.3.0 (2018-11-14)

Features

  • support proxy and historyApiFallback (7579bc9)

4.2.1 (2018-10-31)

Bug Fixes

4.1.1 (2018-07-20)

Bug Fixes

  • no cache for static resource (999de7b)

4.1.0 (2018-06-29)

Features

  • webpack 4.2.0 to latest version (5b4befe)

4.0.3 (2018-05-30)

Bug Fixes

4.0.2 (2018-05-30)

Bug Fixes

4.0.0 / 2018-03-07

  • feat: Webpack 4 Support

3.1.3 / 2017-09-14

  • feat:build and server method support option param

3.1.2 / 2017-09-14

  • fix:build result show twice when hot mode

3.0.0 / 2017-05-07

  • feat: Webpack 3 Support