0.1.0 • Published 7 years ago

entry-watch-webpack-plugin v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

entry-watch-webpack-plugin

watch entry change for MPA

npm version Build Status Dependencies Status

Install

npm install entry-watch-webpack-plugin --save-dev

Usage

配合 dynamic-entry,

const path = require('path');
const EntryWatchWebpackPlugin = require('entry-watch-webpack-plugin');

const entryRoot = path.resolve(__dirname, 'src');

module.exports = {
  async entry() {
    // 这里获取多入口配置, 需要自己实现
    const entries = await getEntries(entryRoot);
    return entries;
  },
  mode: 'development',
  output: {
    path: path.resolve(__dirname, 'build'),
  },
  plugins: [
    new EntryWatchWebpackPlugin(entryRoot),
  ],
};

License

MIT