Improve README, webpack consumption

This commit is contained in:
Alex Dima 2018-04-09 16:53:49 +02:00
parent 7c18d303e6
commit 118c0d5783
5 changed files with 65 additions and 16 deletions

View file

@ -1,17 +1,17 @@
const webpack = require('webpack');
class AddWorkerEntryPointPlugin {
constructor(webpack, {
constructor({
id,
entry,
filename,
chunkFilename = undefined,
plugins = undefined,
}) {
this.webpack = webpack;
this.options = { id, entry, filename, chunkFilename, plugins };
}
apply(compiler) {
const webpack = this.webpack;
const { id, entry, filename, chunkFilename, plugins } = this.options;
compiler.hooks.make.tapAsync('AddWorkerEntryPointPlugin', (compilation, callback) => {
const outputOptions = {