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

Function runWebpack

test/_util.js:60–83  ·  view source on GitHub ↗
(webpack, fixture, { output = {}, plugins = [], module = {}, resolve = {}, ...config } = {}, console)

Source from the content-addressed store, hash-verified

58}
59
60export function runWebpack (webpack, fixture, { output = {}, plugins = [], module = {}, resolve = {}, ...config } = {}, console) {
61 return run(callback => webpack({
62 mode: 'production',
63 devtool: false,
64 context: path.resolve(__dirname, 'fixtures', fixture),
65 entry: './entry.js',
66 output: {
67 publicPath: 'dist/',
68 path: path.resolve(__dirname, 'fixtures', fixture, 'dist'),
69 ...(output || {})
70 },
71 module: {
72 ...module,
73 rules: [].concat(module.rules || [])
74 },
75 resolve,
76 plugins: [
77 new CleanPlugin([
78 path.resolve(__dirname, 'fixtures', fixture, 'dist', '**')
79 ])
80 ].concat(plugins || []),
81 ...config
82 }, callback), console);
83}
84
85export function watchWebpack (webpack, fixture, { output, plugins, context, ...config } = {}, console) {
86 context = context || path.resolve(__dirname, 'fixtures', fixture);

Callers 1

index.test.jsFile · 0.90

Calls 1

runFunction · 0.85

Tested by

no test coverage detected