MCPcopy
hub / github.com/webpack/minimizer-webpack-plugin / getCompiler

Function getCompiler

test/helpers/getCompiler.js:10–35  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

8 * @returns {import("webpack").Compiler | import("webpack").MultiCompiler} compiler
9 */
10export default function getCompiler(options = {}) {
11 const compiler = webpack(
12 Array.isArray(options)
13 ? options
14 : {
15 mode: "production",
16 bail: true,
17 entry: path.resolve(__dirname, "../fixtures/entry.js"),
18 optimization: {
19 minimize: false,
20 },
21 output: {
22 pathinfo: false,
23 path: path.resolve(__dirname, "dist"),
24 filename: "[name].js",
25 chunkFilename: "[id].[name].js",
26 },
27 plugins: [],
28 ...options,
29 },
30 );
31
32 compiler.outputFileSystem = createFsFromVolume(new Volume());
33
34 return compiler;
35}

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…