entry-watch-webpack-plugin
v0.1.0
Published
watch entry change
Downloads
4
Readme
entry-watch-webpack-plugin
watch entry change for MPA
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),
],
};