MCPcopy
hub / github.com/webpack/webpack / run

Function run

test/fixtures/buildDependencies/run.js:23–106  ·  test/fixtures/buildDependencies/run.js::run
({ default: value2, asyncDep: value3 })

Source from the content-addressed store, hash-verified

21}
22
23function run({ default: value2, asyncDep: value3 }) {
24 const compiler = webpack(
25 {
26 mode: class="st">"development",
27 context: path.resolve(__dirname, class="st">"../../js/buildDepsInput"),
28 entry: path.resolve(__dirname, class="st">"./index"),
29 output: {
30 path: path.resolve(__dirname, class="st">"../../js/buildDeps/" + process.argv[2]),
31 libraryTarget: class="st">"commonjs2"
32 },
33 plugins: [
34 new webpack.DefinePlugin({
35 VALUE: webpack.DefinePlugin.runtimeValue(
36 () => JSON.stringify(value),
37 { version: class="st">"no" }
38 ),
39 VALUE2: webpack.DefinePlugin.runtimeValue(
40 () => JSON.stringify(value2),
41 { version: class="st">"no" }
42 ),
43 VALUE3: webpack.DefinePlugin.runtimeValue(
44 () => JSON.stringify(value3),
45 { version: class="st">"no" }
46 ),
47 VALUE_UNCACHEABLE: webpack.DefinePlugin.runtimeValue(
48 () => JSON.stringify(value),
49 true
50 ),
51 DEFINED_VALUE: JSON.stringify(options.definedValue || class="st">"value")
52 })
53 ],
54 infrastructureLogging: {
55 level: class="st">"verbose",
56 debug: /PackFile/
57 },
58 snapshot: {
59 class="cm">// TODO remove webpack 6
60 managedPaths: [/^(.+?[\\/]node_modules[\\/])/]
61 },
62 cache: {
63 type: class="st">"filesystem",
64 cacheDirectory: path.resolve(__dirname, class="st">"../../js/buildDepsCache"),
65 buildDependencies: {
66 defaultWebpack: [],
67 config: [
68 __filename,
69 path.resolve(__dirname, class="st">"../../../node_modules/.yarn-integrity")
70 ].concat(esm ? [class="st">"../../fixtures/buildDependencies/esm.mjs"] : []),
71 invalid: options.invalidBuildDependencies
72 ? [class="st">"should-fail-resolving"]
73 : [],
74 optionalDepsTest: [
75 path.resolve(__dirname, class="st">"node_modules/dependency-with-optional") +
76 class="st">"/"
77 ]
78 }
79 }
80 },

Callers 1

run.jsFile · 0.70

Calls 8

runtimeValueMethod · 0.80
logMethod · 0.80
resolveMethod · 0.65
webpackFunction · 0.50
concatMethod · 0.45
hasErrorsMethod · 0.45
toStringMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected