1.0.2 • Published 8 years ago
egg-webpack-dev v1.0.2
egg-webpack-dev
Install
$ npm i egg-webpack-dev --saveUsage
// {app_root}/config/plugin.js
exports.webpackDev = {
  enable: true,
  package: 'egg-webpack-dev',
};Configuration
// {app_root}/config/config.default.js
exports.webpackDev = {
  inline: true,
  hot: true,
  port: 9000,
  host: 'localhost',
  webpackConfig: path.join(__dirname, '../webpack.config.js')
};see config/config.default.js for more detail.
Work with egg-proxy
this plugin can be work with egg-proxy plugin, which allow you request the webpack memory files from the same domain as the static file on disk.
// {app_root}/config/plugin.js
exports.webpackDev = {
  enable: true,
  package: 'egg-webpack-dev',
};
exports.prox = {
  enable: true,
  package: 'egg-proxy',
};// {app_root}/config/config.default.js
exports.webpackDev = {
  inline: true,
  hot: true,
  port: 9000,
  host: 'localhost',
  webpackConfig: path.join(__dirname, '../webpack.config.js')
};
exports.proxy = {
  host: 'http://localhost:9000',
  match: /^\/assets/ // which path will be proxy to webpack dev server, should be pattern of the webpackConfig.out.publicPath
};Example
Questions & Suggestions
Please open an issue here.