MCPcopy Index your code
hub / github.com/developit/optimize-plugin / watchWebpack

Function watchWebpack

test/_util.js:85–100  ·  view source on GitHub ↗
(webpack, fixture, { output, plugins, context, ...config } = {}, console)

Source from the content-addressed store, hash-verified

83}
84
85export function watchWebpack (webpack, fixture, { output, plugins, context, ...config } = {}, console) {
86 context = context || path.resolve(__dirname, 'fixtures', fixture);
87 const compiler = webpack({
88 mode: 'production',
89 context,
90 entry: './entry.js',
91 output: {
92 publicPath: 'dist/',
93 path: path.resolve(context, 'dist'),
94 ...(output || {})
95 },
96 plugins: plugins || []
97 });
98 compiler.doRun = () => run(compiler.run.bind(compiler), console);
99 return compiler;
100}
101
102export async function statsWithAssets (stats) {
103 const assets = Object.keys(stats.compilation.assets);

Callers

nothing calls this directly

Calls 1

runFunction · 0.85

Tested by

no test coverage detected