| 21 | } |
| 22 | |
| 23 | function 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 | }, |