diff --git a/.eslintignore b/.eslintignore index f3afa1defd0..f595813309c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -25,5 +25,6 @@ schemas/**/*.check.js # Ignore some examples files examples/**/*.js +examples/**/*.mjs !examples/*/webpack.config.js diff --git a/.eslintrc.js b/.eslintrc.js index a8e25bd729e..fb78a264ea8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,15 +1,19 @@ module.exports = { root: true, - plugins: ["prettier", "node", "jest", "jsdoc"], + reportUnusedDisableDirectives: true, + plugins: ["prettier", "n", "jest", "jsdoc"], extends: [ "eslint:recommended", - "plugin:node/recommended", + "plugin:n/recommended", "plugin:prettier/recommended" ], env: { node: true, es6: true }, + globals: { + WebAssembly: true + }, parserOptions: { ecmaVersion: 2018 }, @@ -26,7 +30,7 @@ module.exports = { "no-use-before-define": "off", "no-unused-vars": ["error", { args: "none", ignoreRestSiblings: true }], "no-loop-func": "off", - "node/no-missing-require": ["error", { allowModules: ["webpack"] }], + "n/no-missing-require": ["error", { allowModules: ["webpack"] }], "jsdoc/check-indentation": "error", "jsdoc/check-param-names": "error", "jsdoc/check-property-names": "error", @@ -116,6 +120,14 @@ module.exports = { nsObj: false, jasmine: false } + }, + { + files: ["examples/**/*.js"], + rules: { + "n/no-missing-require": "off", + "n/no-unpublished-require": "off", + "n/no-extraneous-require": "off" + } } ] }; diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c6b24d47388..89efe54b7d5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,17 +1,22 @@ - - -## Summary + + +**What kind of change does this PR introduce?** + + + +**Did you add tests for your changes?** - + -copilot:summary +**Does this PR introduce a breaking change?** -## Details + - +**What needs to be documented once your changes are merged?** -copilot:walkthrough + + diff --git a/.github/PULL_REQUEST_TEMPLATE_ORIGINAL.md b/.github/PULL_REQUEST_TEMPLATE_ORIGINAL.md deleted file mode 100644 index 89efe54b7d5..00000000000 --- a/.github/PULL_REQUEST_TEMPLATE_ORIGINAL.md +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -**What kind of change does this PR introduce?** - - - -**Did you add tests for your changes?** - - - -**Does this PR introduce a breaking change?** - - - -**What needs to be documented once your changes are merged?** - - - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ebd98cfae21..0d610ef58b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,14 +19,14 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: lts/* cache: "yarn" - run: yarn --frozen-lockfile - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: .eslintcache key: lint-${{ env.GITHUB_SHA }} @@ -35,9 +35,9 @@ jobs: basic: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16.x cache: "yarn" @@ -45,16 +45,16 @@ jobs: - run: yarn link --frozen-lockfile || true - run: yarn link webpack --frozen-lockfile - run: yarn test:basic --ci - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v4 with: flags: basic functionalities: gcov validate-legacy-node: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 10.x cache: "yarn" @@ -64,22 +64,22 @@ jobs: unit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16.x cache: "yarn" - run: yarn --frozen-lockfile - run: yarn link --frozen-lockfile || true - run: yarn link webpack --frozen-lockfile - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: .jest-cache key: jest-unit-${{ env.GITHUB_SHA }} restore-keys: jest-unit- - run: yarn cover:unit --ci --cacheDirectory .jest-cache - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v4 with: flags: unit functionalities: gcov @@ -115,9 +115,9 @@ jobs: use_main_branches: 1 runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: "yarn" @@ -134,14 +134,14 @@ jobs: if: matrix.node-version != '10.x' && matrix.node-version != '12.x' && matrix.node-version != '14.x' - run: yarn link --frozen-lockfile || true - run: yarn link webpack --frozen-lockfile - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: .jest-cache key: jest-integration-${{ env.GITHUB_SHA }} restore-keys: jest-integration- - run: yarn cover:integration:${{ matrix.part }} --ci --cacheDirectory .jest-cache || yarn cover:integration:${{ matrix.part }} --ci --cacheDirectory .jest-cache -f - run: yarn cover:merge - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v4 with: flags: integration functionalities: gcov diff --git a/.prettierignore b/.prettierignore index e1bc031979d..eeb72ea7218 100644 --- a/.prettierignore +++ b/.prettierignore @@ -29,3 +29,5 @@ schemas/**/*.check.js # Ignore example fixtures examples/ !examples/**/webpack.config.js + +.vscode/**/*.* diff --git a/README.md b/README.md index bde462e6739..ccc4c80b123 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,9 @@ + + +

webpack

Webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset. diff --git a/bin/webpack.js b/bin/webpack.js index 615c86ac845..1ee7e0dd2d0 100755 --- a/bin/webpack.js +++ b/bin/webpack.js @@ -76,11 +76,10 @@ const isInstalled = packageName => { const runCli = cli => { const path = require("path"); const pkgPath = require.resolve(`${cli.package}/package.json`); - // eslint-disable-next-line node/no-missing-require const pkg = require(pkgPath); if (pkg.type === "module" || /\.mjs/i.test(pkg.bin[cli.binName])) { - // eslint-disable-next-line node/no-unsupported-features/es-syntax + // eslint-disable-next-line n/no-unsupported-features/es-syntax import(path.resolve(path.dirname(pkgPath), pkg.bin[cli.binName])).catch( error => { console.error(error); @@ -88,7 +87,6 @@ const runCli = cli => { } ); } else { - // eslint-disable-next-line node/no-missing-require require(path.resolve(path.dirname(pkgPath), pkg.bin[cli.binName])); } }; diff --git a/cspell.json b/cspell.json index 180091c6728..f93f32eb526 100644 --- a/cspell.json +++ b/cspell.json @@ -27,6 +27,7 @@ "browserified", "browserslist", "browserslistrc", + "browsertest", "Brumme", "bugfix", "bugfixes", @@ -129,6 +130,7 @@ "loadername", "loglevel", "longnameforexport", + "longtest", "mangleable", "MCEP", "mebibytes", diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index 8ff9aa91ec4..45cf35995a2 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -35,6 +35,14 @@ export type Context = string; * References to other configurations to depend on. */ export type Dependencies = string[]; +/** + * Options for the webpack-dev-server. + */ +export type DevServer = + | false + | { + [k: string]: any; + }; /** * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). */ @@ -728,6 +736,14 @@ export type AssetParserDataUrlFunction = ( source: string | Buffer, context: {filename: string; module: import("../lib/Module")} ) => boolean; +/** + * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files. + */ +export type CssGeneratorExportsOnly = boolean; +/** + * Use ES modules named export for css exports. + */ +export type CssParserNamedExports = boolean; /** * A Function returning a Promise resolving to a normalized entry. */ @@ -1047,12 +1063,6 @@ export interface FileCacheOptions { */ version?: string; } -/** - * Options for the webpack-dev-server. - */ -export interface DevServer { - [k: string]: any; -} /** * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object. */ @@ -1636,11 +1646,17 @@ export interface NodeOptions { /** * Include a polyfill for the '__dirname' variable. */ - __dirname?: false | true | "warn-mock" | "mock" | "eval-only"; + __dirname?: false | true | "warn-mock" | "mock" | "node-module" | "eval-only"; /** * Include a polyfill for the '__filename' variable. */ - __filename?: false | true | "warn-mock" | "mock" | "eval-only"; + __filename?: + | false + | true + | "warn-mock" + | "mock" + | "node-module" + | "eval-only"; /** * Include a polyfill for the 'global' variable. */ @@ -2237,6 +2253,10 @@ export interface Environment { * The environment supports arrow functions ('() => { ... }'). */ arrowFunction?: boolean; + /** + * The environment supports async function and await ('async function () { await ... }'). + */ + asyncFunction?: boolean; /** * The environment supports BigInt as literal (123n). */ @@ -2376,6 +2396,10 @@ export interface SnapshotOptions { */ timestamp?: boolean; }; + /** + * List of paths that are not managed by a package manager and the contents are subject to change. + */ + unmanagedPaths?: (RegExp | string)[]; } /** * Stats options object. @@ -2804,22 +2828,77 @@ export interface AssetResourceGeneratorOptions { publicPath?: RawPublicPath; } /** - * Options for css handling. + * Generator options for css/auto modules. */ -export interface CssExperimentOptions { +export interface CssAutoGeneratorOptions { /** * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files. */ - exportsOnly?: boolean; + exportsOnly?: CssGeneratorExportsOnly; +} +/** + * Parser options for css/auto modules. + */ +export interface CssAutoParserOptions { + /** + * Use ES modules named export for css exports. + */ + namedExports?: CssParserNamedExports; } /** * Generator options for css modules. */ -export interface CssGeneratorOptions {} +export interface CssGeneratorOptions { + /** + * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files. + */ + exportsOnly?: CssGeneratorExportsOnly; +} +/** + * Generator options for css/global modules. + */ +export interface CssGlobalGeneratorOptions { + /** + * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files. + */ + exportsOnly?: CssGeneratorExportsOnly; +} +/** + * Parser options for css/global modules. + */ +export interface CssGlobalParserOptions { + /** + * Use ES modules named export for css exports. + */ + namedExports?: CssParserNamedExports; +} +/** + * Generator options for css/module modules. + */ +export interface CssModuleGeneratorOptions { + /** + * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files. + */ + exportsOnly?: CssGeneratorExportsOnly; +} +/** + * Parser options for css/module modules. + */ +export interface CssModuleParserOptions { + /** + * Use ES modules named export for css exports. + */ + namedExports?: CssParserNamedExports; +} /** * Parser options for css modules. */ -export interface CssParserOptions {} +export interface CssParserOptions { + /** + * Use ES modules named export for css exports. + */ + namedExports?: CssParserNamedExports; +} /** * No generator options are supported for this module type. */ @@ -3585,7 +3664,7 @@ export interface ExperimentsExtra { /** * Enable css support. */ - css?: boolean | CssExperimentOptions; + css?: boolean; /** * Compile entrypoints and import()s only when they are accessed. */ @@ -3602,7 +3681,7 @@ export interface ExperimentsNormalizedExtra { /** * Enable css support. */ - css?: false | CssExperimentOptions; + css?: boolean; /** * Compile entrypoints and import()s only when they are accessed. */ @@ -3643,6 +3722,22 @@ export interface GeneratorOptionsByModuleTypeKnown { * Generator options for asset/resource modules. */ "asset/resource"?: AssetResourceGeneratorOptions; + /** + * Generator options for css modules. + */ + css?: CssGeneratorOptions; + /** + * Generator options for css/auto modules. + */ + "css/auto"?: CssAutoGeneratorOptions; + /** + * Generator options for css/global modules. + */ + "css/global"?: CssGlobalGeneratorOptions; + /** + * Generator options for css/module modules. + */ + "css/module"?: CssModuleGeneratorOptions; /** * No generator options are supported for this module type. */ @@ -3691,6 +3786,22 @@ export interface ParserOptionsByModuleTypeKnown { * No parser options are supported for this module type. */ "asset/source"?: EmptyParserOptions; + /** + * Parser options for css modules. + */ + css?: CssParserOptions; + /** + * Parser options for css/auto modules. + */ + "css/auto"?: CssAutoParserOptions; + /** + * Parser options for css/global modules. + */ + "css/global"?: CssGlobalParserOptions; + /** + * Parser options for css/module modules. + */ + "css/module"?: CssModuleParserOptions; /** * Parser options for javascript modules. */ diff --git a/examples/aggressive-merging/webpack.config.js b/examples/aggressive-merging/webpack.config.js index 2887ce355e8..8bc21bfad40 100644 --- a/examples/aggressive-merging/webpack.config.js +++ b/examples/aggressive-merging/webpack.config.js @@ -1,5 +1,5 @@ var path = require("path"); -var { AggressiveMergingPlugin } = require("../../").optimize; +var { AggressiveMergingPlugin } = require("../..").optimize; module.exports = { // mode: "development" || "production", diff --git a/examples/build-common.js b/examples/build-common.js index 3b7d512d393..7293b32d604 100644 --- a/examples/build-common.js +++ b/examples/build-common.js @@ -51,7 +51,30 @@ const doCompileAndReplace = (args, prefix, callback) => { throw new Error("Please install webpack-cli at root."); } - cp.exec(`node ${path.resolve(__dirname, "../bin/webpack.js")} ${args} ${displayReasons} ${commonArgs}`, (error, stdout, stderr) => { + const connectIO = (subprocess) => { + const { stdin, stdout, stderr } = process; + const { stdin: _stdin, stdout: _stdout, stderr: _stderr } = subprocess; + const inputPair = [[stdin, _stdin]]; + const outputPair = [[stdout, _stdout], [stderr, _stderr]]; + inputPair.forEach(pair => { + pair[0].pipe(pair[1]) + }) + outputPair.forEach(pair => { + pair[1].pipe(pair[0]) + }) + disconnectIO = () => { + inputPair.forEach(pair => { + pair[0].unpipe(pair[1]) + }) + outputPair.forEach(pair => { + pair[1].unpipe(pair[0]) + }) + } + } + let disconnectIO = null; + + const subprocess = cp.exec(`node ${path.resolve(__dirname, "../bin/webpack.js")} ${args} ${displayReasons} ${commonArgs}`, (error, stdout, stderr) => { + disconnectIO && disconnectIO(); if (stderr) console.log(stderr); if (error !== null) @@ -64,6 +87,7 @@ const doCompileAndReplace = (args, prefix, callback) => { } callback(); }); + connectIO(subprocess); }; async.series([ diff --git a/examples/dll-user/webpack.config.js b/examples/dll-user/webpack.config.js index c8d0d5210ad..7aae24a69ab 100644 --- a/examples/dll-user/webpack.config.js +++ b/examples/dll-user/webpack.config.js @@ -5,11 +5,11 @@ module.exports = { plugins: [ new webpack.DllReferencePlugin({ context: path.join(__dirname, "..", "dll"), - manifest: require("../dll/dist/alpha-manifest.json") // eslint-disable-line + manifest: require("../dll/dist/alpha-manifest.json") }), new webpack.DllReferencePlugin({ scope: "beta", - manifest: require("../dll/dist/beta-manifest.json"), // eslint-disable-line + manifest: require("../dll/dist/beta-manifest.json"), extensions: [".js", ".jsx"] }) ] diff --git a/examples/stats-detailed/README.md b/examples/stats-detailed/README.md new file mode 100644 index 00000000000..18e05d2780f --- /dev/null +++ b/examples/stats-detailed/README.md @@ -0,0 +1,83 @@ +This configuration will enable the detailed output for the stats report. + +You see that everything is working nicely together. + +# example.js + +```javascript +console.log("Hello World!"); +``` + +# webpack.config.js + +```javascript +const path = require("path"); + +module.exports = { + output: { + path: path.join(__dirname, "dist"), + filename: "output.js" + }, + stats: "detailed" +}; +``` + +# dist/output.js + +```javascript +/******/ (() => { // webpackBootstrap +var __webpack_exports__ = {}; +/*!********************!*\ + !*** ./example.js ***! + \********************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: */ +console.log("Hello World!"); + +/******/ })() +; +``` + +# Info + +## Production mode + +``` +PublicPath: dist/ +asset output.js 28 bytes {179} [emitted] [minimized] (name: main) +Entrypoint main 28 bytes = output.js +chunk {179} (runtime: main) output.js (main) 29 bytes [entry] [rendered] + > ./example.js main +./example.js [144] 29 bytes {179} [depth 0] [built] [code generated] + [no exports used] + Statement (ExpressionStatement) with side effects in source code at 1:0-28 + ModuleConcatenation bailout: Module is not an ECMAScript module + +LOG from webpack.Compilation + 1 modules hashed, 0 from cache (1 variants per module in average) + 100% code generated (1 generated, 0 from cache) ++ 24 hidden lines + +LOG from webpack.FlagDependencyExportsPlugin + 0% of exports of modules have been determined (1 no declared exports, 0 not cached, 0 flagged uncacheable, 0 from cache, 0 from mem cache, 0 additional calculations due to dependencies) ++ 3 hidden lines + +LOG from webpack.buildChunkGraph + 2 queue items processed (1 blocks) + 0 chunk groups connected + 0 chunk groups processed for merging (0 module sets, 0 forked, 0 + 0 modules forked, 0 + 0 modules merged into fork, 0 resulting modules) + 0 chunk group info updated (0 already connected chunk groups reconnected) ++ 5 hidden lines + +LOG from webpack.FileSystemInfo + 1 new snapshots created + 0% root snapshot uncached (0 / 0) + 0% children snapshot uncached (0 / 0) + 0 entries tested + File info in cache: 1 timestamps 1 hashes 1 timestamp hash combinations + File timestamp hash combination snapshot optimization: 0% (0/1) entries shared via 0 shared snapshots (0 times referenced) + Directory info in cache: 0 timestamps 0 hashes 0 timestamp hash combinations + Managed items info in cache: 0 items + +2023-06-23 22:57:08: webpack 5.88.0 compiled successfully (208f5e6e78a48d3e157f) +``` diff --git a/examples/stats-detailed/build.js b/examples/stats-detailed/build.js new file mode 100644 index 00000000000..6da1216015d --- /dev/null +++ b/examples/stats-detailed/build.js @@ -0,0 +1,4 @@ +global.NO_REASONS = true; +global.NO_STATS_OPTIONS = true; +global.STATS_COLORS = true; +require("../build-common"); diff --git a/examples/stats-detailed/example.js b/examples/stats-detailed/example.js new file mode 100644 index 00000000000..019c0f4bc8e --- /dev/null +++ b/examples/stats-detailed/example.js @@ -0,0 +1 @@ +console.log("Hello World!"); diff --git a/examples/stats-detailed/template.md b/examples/stats-detailed/template.md new file mode 100644 index 00000000000..d475f06a46f --- /dev/null +++ b/examples/stats-detailed/template.md @@ -0,0 +1,29 @@ +This configuration will enable the detailed output for the stats report. + +You see that everything is working nicely together. + +# example.js + +```javascript +_{{example.js}}_ +``` + +# webpack.config.js + +```javascript +_{{webpack.config.js}}_ +``` + +# dist/output.js + +```javascript +_{{dist/output.js}}_ +``` + +# Info + +## Production mode + +``` +_{{production:stdout}}_ +``` diff --git a/examples/stats-detailed/webpack.config.js b/examples/stats-detailed/webpack.config.js new file mode 100644 index 00000000000..a237a81fc37 --- /dev/null +++ b/examples/stats-detailed/webpack.config.js @@ -0,0 +1,9 @@ +const path = require("path"); + +module.exports = { + output: { + path: path.join(__dirname, "dist"), + filename: "output.js" + }, + stats: "detailed" +}; diff --git a/examples/stats-none/README.md b/examples/stats-none/README.md new file mode 100644 index 00000000000..b1fe4195d04 --- /dev/null +++ b/examples/stats-none/README.md @@ -0,0 +1,47 @@ +This configuration will enable the none output for the stats report. + +You see that everything is working nicely together. + +# example.js + +```javascript +console.log("Hello World!"); +``` + +# webpack.config.js + +```javascript +const path = require("path"); + +module.exports = { + output: { + path: path.join(__dirname, "dist"), + filename: "output.js" + }, + stats: "none" +}; +``` + +# dist/output.js + +```javascript +/******/ (() => { // webpackBootstrap +var __webpack_exports__ = {}; +/*!********************!*\ + !*** ./example.js ***! + \********************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: */ +console.log("Hello World!"); + +/******/ })() +; +``` + +# Info + +## Production mode + +``` + +``` diff --git a/examples/stats-none/build.js b/examples/stats-none/build.js new file mode 100644 index 00000000000..6da1216015d --- /dev/null +++ b/examples/stats-none/build.js @@ -0,0 +1,4 @@ +global.NO_REASONS = true; +global.NO_STATS_OPTIONS = true; +global.STATS_COLORS = true; +require("../build-common"); diff --git a/examples/stats-none/example.js b/examples/stats-none/example.js new file mode 100644 index 00000000000..019c0f4bc8e --- /dev/null +++ b/examples/stats-none/example.js @@ -0,0 +1 @@ +console.log("Hello World!"); diff --git a/examples/stats-none/template.md b/examples/stats-none/template.md new file mode 100644 index 00000000000..b60135662a4 --- /dev/null +++ b/examples/stats-none/template.md @@ -0,0 +1,29 @@ +This configuration will enable the none output for the stats report. + +You see that everything is working nicely together. + +# example.js + +```javascript +_{{example.js}}_ +``` + +# webpack.config.js + +```javascript +_{{webpack.config.js}}_ +``` + +# dist/output.js + +```javascript +_{{dist/output.js}}_ +``` + +# Info + +## Production mode + +``` +_{{production:stdout}}_ +``` diff --git a/examples/stats-none/webpack.config.js b/examples/stats-none/webpack.config.js new file mode 100644 index 00000000000..8a687239693 --- /dev/null +++ b/examples/stats-none/webpack.config.js @@ -0,0 +1,9 @@ +const path = require("path"); + +module.exports = { + output: { + path: path.join(__dirname, "dist"), + filename: "output.js" + }, + stats: "none" +}; diff --git a/examples/stats-normal/README.md b/examples/stats-normal/README.md new file mode 100644 index 00000000000..becfd3e06c1 --- /dev/null +++ b/examples/stats-normal/README.md @@ -0,0 +1,49 @@ +This configuration will enable the normal output for the stats report. + +You see that everything is working nicely together. + +# example.js + +```javascript +console.log("Hello World!"); +``` + +# webpack.config.js + +```javascript +const path = require("path"); + +module.exports = { + output: { + path: path.join(__dirname, "dist"), + filename: "output.js" + }, + stats: "normal" +}; +``` + +# dist/output.js + +```javascript +/******/ (() => { // webpackBootstrap +var __webpack_exports__ = {}; +/*!********************!*\ + !*** ./example.js ***! + \********************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: */ +console.log("Hello World!"); + +/******/ })() +; +``` + +# Info + +## Production mode + +``` +asset output.js 28 bytes [emitted] [minimized] (name: main) +./example.js 29 bytes [built] [code generated] +webpack 5.88.0 compiled successfully +``` \ No newline at end of file diff --git a/examples/stats-normal/build.js b/examples/stats-normal/build.js new file mode 100644 index 00000000000..6da1216015d --- /dev/null +++ b/examples/stats-normal/build.js @@ -0,0 +1,4 @@ +global.NO_REASONS = true; +global.NO_STATS_OPTIONS = true; +global.STATS_COLORS = true; +require("../build-common"); diff --git a/examples/stats-normal/example.js b/examples/stats-normal/example.js new file mode 100644 index 00000000000..019c0f4bc8e --- /dev/null +++ b/examples/stats-normal/example.js @@ -0,0 +1 @@ +console.log("Hello World!"); diff --git a/examples/stats-normal/template.md b/examples/stats-normal/template.md new file mode 100644 index 00000000000..ed4c81681b5 --- /dev/null +++ b/examples/stats-normal/template.md @@ -0,0 +1,29 @@ +This configuration will enable the normal output for the stats report. + +You see that everything is working nicely together. + +# example.js + +```javascript +_{{example.js}}_ +``` + +# webpack.config.js + +```javascript +_{{webpack.config.js}}_ +``` + +# dist/output.js + +```javascript +_{{dist/output.js}}_ +``` + +# Info + +## Production mode + +``` +_{{production:stdout}}_ +``` \ No newline at end of file diff --git a/examples/stats-normal/webpack.config.js b/examples/stats-normal/webpack.config.js new file mode 100644 index 00000000000..e741993c8d9 --- /dev/null +++ b/examples/stats-normal/webpack.config.js @@ -0,0 +1,9 @@ +const path = require("path"); + +module.exports = { + output: { + path: path.join(__dirname, "dist"), + filename: "output.js" + }, + stats: "normal" +}; diff --git a/examples/stats-summary/README.md b/examples/stats-summary/README.md new file mode 100644 index 00000000000..7ebee7c56d0 --- /dev/null +++ b/examples/stats-summary/README.md @@ -0,0 +1,47 @@ +This configuration will enable the summary output for the stats report. + +You see that everything is working nicely together. + +# example.js + +```javascript +console.log("Hello World!"); +``` + +# webpack.config.js + +```javascript +const path = require("path"); + +module.exports = { + output: { + path: path.join(__dirname, "dist"), + filename: "output.js" + }, + stats: "summary" +}; +``` + +# dist/output.js + +```javascript +/******/ (() => { // webpackBootstrap +var __webpack_exports__ = {}; +/*!********************!*\ + !*** ./example.js ***! + \********************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: */ +console.log("Hello World!"); + +/******/ })() +; +``` + +# Info + +## Production mode + +``` +webpack 5.88.0 compiled successfully +``` diff --git a/examples/stats-summary/build.js b/examples/stats-summary/build.js new file mode 100644 index 00000000000..6da1216015d --- /dev/null +++ b/examples/stats-summary/build.js @@ -0,0 +1,4 @@ +global.NO_REASONS = true; +global.NO_STATS_OPTIONS = true; +global.STATS_COLORS = true; +require("../build-common"); diff --git a/examples/stats-summary/example.js b/examples/stats-summary/example.js new file mode 100644 index 00000000000..019c0f4bc8e --- /dev/null +++ b/examples/stats-summary/example.js @@ -0,0 +1 @@ +console.log("Hello World!"); diff --git a/examples/stats-summary/template.md b/examples/stats-summary/template.md new file mode 100644 index 00000000000..087cfc32b5f --- /dev/null +++ b/examples/stats-summary/template.md @@ -0,0 +1,29 @@ +This configuration will enable the summary output for the stats report. + +You see that everything is working nicely together. + +# example.js + +```javascript +_{{example.js}}_ +``` + +# webpack.config.js + +```javascript +_{{webpack.config.js}}_ +``` + +# dist/output.js + +```javascript +_{{dist/output.js}}_ +``` + +# Info + +## Production mode + +``` +_{{production:stdout}}_ +``` diff --git a/examples/stats-summary/webpack.config.js b/examples/stats-summary/webpack.config.js new file mode 100644 index 00000000000..94e9a0f0b2d --- /dev/null +++ b/examples/stats-summary/webpack.config.js @@ -0,0 +1,9 @@ +const path = require("path"); + +module.exports = { + output: { + path: path.join(__dirname, "dist"), + filename: "output.js" + }, + stats: "summary" +}; diff --git a/examples/wasm-bindgen-esm/README.md b/examples/wasm-bindgen-esm/README.md index e316207b016..8d5e4c44a8a 100644 --- a/examples/wasm-bindgen-esm/README.md +++ b/examples/wasm-bindgen-esm/README.md @@ -26,17 +26,18 @@ document.write(greeting('Bob')); /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, module, __webpack_require__.a, __webpack_require__.* */ /***/ ((module, __webpack_exports__, __webpack_require__) => { -__webpack_require__.a(module, async (__webpack_handle_async_dependencies__) => { +__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { __webpack_require__.r(__webpack_exports__); /* harmony import */ var _pkg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pkg */ 1); var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pkg__WEBPACK_IMPORTED_MODULE_0__]); -_pkg__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? await __webpack_async_dependencies__ : __webpack_async_dependencies__)[0]; +_pkg__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0]; document.write((0,_pkg__WEBPACK_IMPORTED_MODULE_0__.greeting)('Bob')); -}); +__webpack_async_result__(); +} catch(e) { __webpack_async_result__(e); } }); /***/ }), /* 1 */ @@ -49,14 +50,14 @@ document.write((0,_pkg__WEBPACK_IMPORTED_MODULE_0__.greeting)('Bob')); /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, module, __webpack_require__.a, __webpack_require__.d, __webpack_require__.* */ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => { -__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__) => { +__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "greeting": () => (/* binding */ greeting) +/* harmony export */ greeting: () => (/* binding */ greeting) /* harmony export */ }); /* harmony import */ var _hi_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hi_wasm_bg.wasm */ 2); var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_hi_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__]); -_hi_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? await __webpack_async_dependencies__ : __webpack_async_dependencies__)[0]; +_hi_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0]; let WASM_VECTOR_LEN = 0; @@ -161,7 +162,8 @@ function greeting(name) { } -}); +__webpack_async_result__(); +} catch(e) { __webpack_async_result__(e); } }); /***/ }), /* 2 */ @@ -216,75 +218,70 @@ module.exports = __webpack_require__.v(exports, module.id, "ffe21e855d11d22ab54f /************************************************************************/ /******/ /* webpack/runtime/async module */ /******/ (() => { -/******/ var webpackThen = typeof Symbol === "function" ? Symbol("webpack then") : "__webpack_then__"; +/******/ var webpackQueues = typeof Symbol === "function" ? Symbol("webpack queues") : "__webpack_queues__"; /******/ var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__"; -/******/ var completeQueue = (queue) => { -/******/ if(queue) { +/******/ var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__"; +/******/ var resolveQueue = (queue) => { +/******/ if(queue && queue.d < 1) { +/******/ queue.d = 1; /******/ queue.forEach((fn) => (fn.r--)); /******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn())); /******/ } /******/ } -/******/ var completeFunction = (fn) => (!--fn.r && fn()); -/******/ var queueFunction = (queue, fn) => (queue ? queue.push(fn) : completeFunction(fn)); /******/ var wrapDeps = (deps) => (deps.map((dep) => { /******/ if(dep !== null && typeof dep === "object") { -/******/ if(dep[webpackThen]) return dep; +/******/ if(dep[webpackQueues]) return dep; /******/ if(dep.then) { /******/ var queue = []; +/******/ queue.d = 0; /******/ dep.then((r) => { /******/ obj[webpackExports] = r; -/******/ completeQueue(queue); -/******/ queue = 0; +/******/ resolveQueue(queue); +/******/ }, (e) => { +/******/ obj[webpackError] = e; +/******/ resolveQueue(queue); /******/ }); /******/ var obj = {}; -/******/ obj[webpackThen] = (fn, reject) => (queueFunction(queue, fn), dep.catch(reject)); +/******/ obj[webpackQueues] = (fn) => (fn(queue)); /******/ return obj; /******/ } /******/ } /******/ var ret = {}; -/******/ ret[webpackThen] = (fn) => (completeFunction(fn)); -/******/ ret[webpackExports] = dep; -/******/ return ret; +/******/ ret[webpackQueues] = x => {}; +/******/ ret[webpackExports] = dep; +/******/ return ret; /******/ })); /******/ __webpack_require__.a = (module, body, hasAwait) => { -/******/ var queue = hasAwait && []; +/******/ var queue; +/******/ hasAwait && ((queue = []).d = -1); +/******/ var depQueues = new Set(); /******/ var exports = module.exports; /******/ var currentDeps; /******/ var outerResolve; /******/ var reject; -/******/ var isEvaluating = true; -/******/ var nested = false; -/******/ var whenAll = (deps, onResolve, onReject) => { -/******/ if (nested) return; -/******/ nested = true; -/******/ onResolve.r += deps.length; -/******/ deps.map((dep, i) => (dep[webpackThen](onResolve, onReject))); -/******/ nested = false; -/******/ }; /******/ var promise = new Promise((resolve, rej) => { /******/ reject = rej; -/******/ outerResolve = () => (resolve(exports), completeQueue(queue), queue = 0); +/******/ outerResolve = resolve; /******/ }); /******/ promise[webpackExports] = exports; -/******/ promise[webpackThen] = (fn, rejectFn) => { -/******/ if (isEvaluating) { return completeFunction(fn); } -/******/ if (currentDeps) whenAll(currentDeps, fn, rejectFn); -/******/ queueFunction(queue, fn); -/******/ promise.catch(rejectFn); -/******/ }; +/******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {})); /******/ module.exports = promise; /******/ body((deps) => { -/******/ if(!deps) return outerResolve(); /******/ currentDeps = wrapDeps(deps); -/******/ var fn, result; -/******/ var promise = new Promise((resolve, reject) => { -/******/ fn = () => (resolve(result = currentDeps.map((d) => (d[webpackExports])))); +/******/ var fn; +/******/ var getResult = () => (currentDeps.map((d) => { +/******/ if(d[webpackError]) throw d[webpackError]; +/******/ return d[webpackExports]; +/******/ })) +/******/ var promise = new Promise((resolve) => { +/******/ fn = () => (resolve(getResult)); /******/ fn.r = 0; -/******/ whenAll(currentDeps, fn, reject); +/******/ var fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn)))); +/******/ currentDeps.map((dep) => (dep[webpackQueues](fnQueue))); /******/ }); -/******/ return fn.r ? promise : result; -/******/ }).then(outerResolve, reject); -/******/ isEvaluating = false; +/******/ return fn.r ? promise : getResult(); +/******/ }, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))); +/******/ queue && queue.d < 0 && (queue.d = 0); /******/ }; /******/ })(); /******/ @@ -320,14 +317,26 @@ module.exports = __webpack_require__.v(exports, module.id, "ffe21e855d11d22ab54f /******/ (() => { /******/ __webpack_require__.v = (exports, wasmModuleId, wasmModuleHash, importsObj) => { /******/ var req = fetch(__webpack_require__.p + "" + wasmModuleHash + ".wasm"); -/******/ if (typeof WebAssembly.instantiateStreaming === 'function') { -/******/ return WebAssembly.instantiateStreaming(req, importsObj) -/******/ .then((res) => (Object.assign(exports, res.instance.exports))); -/******/ } -/******/ return req +/******/ var fallback = () => (req /******/ .then((x) => (x.arrayBuffer())) /******/ .then((bytes) => (WebAssembly.instantiate(bytes, importsObj))) -/******/ .then((res) => (Object.assign(exports, res.instance.exports))); +/******/ .then((res) => (Object.assign(exports, res.instance.exports)))); +/******/ return req.then((res) => { +/******/ if (typeof WebAssembly.instantiateStreaming === "function") { +/******/ return WebAssembly.instantiateStreaming(res, importsObj) +/******/ .then( +/******/ (res) => (Object.assign(exports, res.instance.exports)), +/******/ (e) => { +/******/ if(res.headers.get("Content-Type") !== "application/wasm") { +/******/ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); +/******/ return fallback(); +/******/ } +/******/ throw e; +/******/ } +/******/ ); +/******/ } +/******/ return fallback(); +/******/ }); /******/ }; /******/ })(); /******/ @@ -358,30 +367,30 @@ module.exports = __webpack_require__.v(exports, module.id, "ffe21e855d11d22ab54f ``` asset ffe21e855d11d22ab54f.wasm 14.8 KiB [emitted] [immutable] (auxiliary name: main) -asset output.js 12.8 KiB [emitted] (name: main) -chunk (runtime: main) output.js (main) 3.03 KiB (javascript) 14.8 KiB (webassembly) 3.35 KiB (runtime) [entry] [rendered] +asset output.js 13.4 KiB [emitted] (name: main) +chunk (runtime: main) output.js (main) 3.03 KiB (javascript) 14.8 KiB (webassembly) 3.68 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 3.35 KiB 6 modules + runtime modules 3.68 KiB 6 modules dependent modules 2.97 KiB (javascript) 14.8 KiB (webassembly) [dependent] 2 modules ./example.js 69 bytes [built] [code generated] [no exports] [used exports unknown] entry ./example.js main -webpack 5.53.0 compiled successfully +webpack 5.90.0 compiled successfully ``` ## Production mode ``` asset f7199313c1125f249cd6.wasm 14.8 KiB [emitted] [immutable] (auxiliary name: main) -asset output.js 2.96 KiB [emitted] [minimized] (name: main) -chunk (runtime: main) output.js (main) 3.03 KiB (javascript) 14.8 KiB (webassembly) 3.08 KiB (runtime) [entry] [rendered] +asset output.js 3.41 KiB [emitted] [minimized] (name: main) +chunk (runtime: main) output.js (main) 3.03 KiB (javascript) 14.8 KiB (webassembly) 3.42 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 3.08 KiB 5 modules + runtime modules 3.42 KiB 5 modules dependent modules 2.97 KiB (javascript) 14.8 KiB (webassembly) [dependent] 2 modules ./example.js 69 bytes [built] [code generated] [no exports] [no exports used] entry ./example.js main -webpack 5.53.0 compiled successfully +webpack 5.90.0 compiled successfully ``` diff --git a/examples/wasm-complex/README.md b/examples/wasm-complex/README.md index 913b4cedce4..1ee4a1db3d9 100644 --- a/examples/wasm-complex/README.md +++ b/examples/wasm-complex/README.md @@ -120,9 +120,9 @@ __webpack_async_result__(); __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "get": () => (/* reexport safe */ _magic_wat__WEBPACK_IMPORTED_MODULE_0__.get), -/* harmony export */ "getNumber": () => (/* reexport safe */ _magic_wat__WEBPACK_IMPORTED_MODULE_0__.getNumber), -/* harmony export */ "set": () => (/* reexport safe */ _magic_wat__WEBPACK_IMPORTED_MODULE_0__.set) +/* harmony export */ get: () => (/* reexport safe */ _magic_wat__WEBPACK_IMPORTED_MODULE_0__.get), +/* harmony export */ getNumber: () => (/* reexport safe */ _magic_wat__WEBPACK_IMPORTED_MODULE_0__.getNumber), +/* harmony export */ set: () => (/* reexport safe */ _magic_wat__WEBPACK_IMPORTED_MODULE_0__.set) /* harmony export */ }); /* harmony import */ var _magic_wat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./magic.wat */ 2); var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_magic_wat__WEBPACK_IMPORTED_MODULE_0__]); @@ -188,7 +188,7 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "memory": () => (/* binding */ memory) +/* harmony export */ memory: () => (/* binding */ memory) /* harmony export */ }); async function getMemoryFromParentInWorker() { await new Promise(r => setTimeout(r, 200)); @@ -215,8 +215,8 @@ __webpack_async_result__(); __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "getNumber": () => (/* binding */ getNumber), -/* harmony export */ "getRandomNumber": () => (/* binding */ getRandomNumber) +/* harmony export */ getNumber: () => (/* binding */ getNumber), +/* harmony export */ getRandomNumber: () => (/* binding */ getRandomNumber) /* harmony export */ }); function getNumber() { return 42; @@ -266,7 +266,7 @@ function getRandomNumber() { /******/ var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__"; /******/ var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__"; /******/ var resolveQueue = (queue) => { -/******/ if(queue && !queue.d) { +/******/ if(queue && queue.d < 1) { /******/ queue.d = 1; /******/ queue.forEach((fn) => (fn.r--)); /******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn())); @@ -297,7 +297,7 @@ function getRandomNumber() { /******/ })); /******/ __webpack_require__.a = (module, body, hasAwait) => { /******/ var queue; -/******/ hasAwait && ((queue = []).d = 1); +/******/ hasAwait && ((queue = []).d = -1); /******/ var depQueues = new Set(); /******/ var exports = module.exports; /******/ var currentDeps; @@ -325,7 +325,7 @@ function getRandomNumber() { /******/ }); /******/ return fn.r ? promise : getResult(); /******/ }, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))); -/******/ queue && (queue.d = 0); +/******/ queue && queue.d < 0 && (queue.d = 0); /******/ }; /******/ })(); /******/ @@ -361,14 +361,26 @@ function getRandomNumber() { /******/ (() => { /******/ __webpack_require__.v = (exports, wasmModuleId, wasmModuleHash, importsObj) => { /******/ var req = fetch(__webpack_require__.p + "" + wasmModuleHash + ".module.wasm"); -/******/ if (typeof WebAssembly.instantiateStreaming === 'function') { -/******/ return WebAssembly.instantiateStreaming(req, importsObj) -/******/ .then((res) => (Object.assign(exports, res.instance.exports))); -/******/ } -/******/ return req +/******/ var fallback = () => (req /******/ .then((x) => (x.arrayBuffer())) /******/ .then((bytes) => (WebAssembly.instantiate(bytes, importsObj))) -/******/ .then((res) => (Object.assign(exports, res.instance.exports))); +/******/ .then((res) => (Object.assign(exports, res.instance.exports)))); +/******/ return req.then((res) => { +/******/ if (typeof WebAssembly.instantiateStreaming === "function") { +/******/ return WebAssembly.instantiateStreaming(res, importsObj) +/******/ .then( +/******/ (res) => (Object.assign(exports, res.instance.exports)), +/******/ (e) => { +/******/ if(res.headers.get("Content-Type") !== "application/wasm") { +/******/ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); +/******/ return fallback(); +/******/ } +/******/ throw e; +/******/ } +/******/ ); +/******/ } +/******/ return fallback(); +/******/ }); /******/ }; /******/ })(); /******/ @@ -398,31 +410,31 @@ function getRandomNumber() { ## Unoptimized ``` -asset output.js 13.2 KiB [emitted] (name: main) +asset output.js 13.8 KiB [emitted] (name: main) asset daa529a2a650ee3943a9.module.wasm 139 bytes [emitted] [immutable] (auxiliary name: main) -chunk (runtime: main) output.js (main) 696 bytes (javascript) 139 bytes (webassembly) 3.24 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 696 bytes (javascript) 139 bytes (webassembly) 3.69 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 3.24 KiB 6 modules + runtime modules 3.69 KiB 6 modules dependent modules 449 bytes (javascript) 139 bytes (webassembly) [dependent] 4 modules ./example.js 247 bytes [built] [code generated] [no exports] [used exports unknown] entry ./example.js main -webpack 5.78.0 compiled successfully +webpack 5.90.0 compiled successfully ``` ## Production mode ``` -asset output.js 2.49 KiB [emitted] [minimized] (name: main) +asset output.js 2.81 KiB [emitted] [minimized] (name: main) asset 05aa07f6a3836ded50d1.module.wasm 139 bytes [emitted] [immutable] (auxiliary name: main) -chunk (runtime: main) output.js (main) 696 bytes (javascript) 139 bytes (webassembly) 2.97 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 696 bytes (javascript) 139 bytes (webassembly) 3.42 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 2.97 KiB 5 modules + runtime modules 3.42 KiB 5 modules dependent modules 449 bytes (javascript) 139 bytes (webassembly) [dependent] 4 modules ./example.js 247 bytes [built] [code generated] [no exports] [no exports used] entry ./example.js main -webpack 5.78.0 compiled successfully +webpack 5.90.0 compiled successfully ``` diff --git a/examples/wasm-simple/README.md b/examples/wasm-simple/README.md index fed989d0e64..38a49528e1f 100644 --- a/examples/wasm-simple/README.md +++ b/examples/wasm-simple/README.md @@ -134,11 +134,11 @@ module.exports = __webpack_require__.v(exports, module.id, "0eaeab8b9fa3cef100d1 __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "add": () => (/* reexport safe */ _add_wasm__WEBPACK_IMPORTED_MODULE_0__.add), -/* harmony export */ "factorial": () => (/* reexport safe */ _factorial_wasm__WEBPACK_IMPORTED_MODULE_1__.factorial), -/* harmony export */ "factorialJavascript": () => (/* binding */ factorialJavascript), -/* harmony export */ "fibonacci": () => (/* reexport safe */ _fibonacci_wasm__WEBPACK_IMPORTED_MODULE_2__.fibonacci), -/* harmony export */ "fibonacciJavascript": () => (/* binding */ fibonacciJavascript) +/* harmony export */ add: () => (/* reexport safe */ _add_wasm__WEBPACK_IMPORTED_MODULE_0__.add), +/* harmony export */ factorial: () => (/* reexport safe */ _factorial_wasm__WEBPACK_IMPORTED_MODULE_1__.factorial), +/* harmony export */ factorialJavascript: () => (/* binding */ factorialJavascript), +/* harmony export */ fibonacci: () => (/* reexport safe */ _fibonacci_wasm__WEBPACK_IMPORTED_MODULE_2__.fibonacci), +/* harmony export */ fibonacciJavascript: () => (/* binding */ fibonacciJavascript) /* harmony export */ }); /* harmony import */ var _add_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.wasm */ 1); /* harmony import */ var _factorial_wasm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./factorial.wasm */ 3); @@ -229,7 +229,7 @@ module.exports = __webpack_require__.v(exports, module.id, "5a6637e8d63cdf9c72da /******/ var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__"; /******/ var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__"; /******/ var resolveQueue = (queue) => { -/******/ if(queue && !queue.d) { +/******/ if(queue && queue.d < 1) { /******/ queue.d = 1; /******/ queue.forEach((fn) => (fn.r--)); /******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn())); @@ -260,7 +260,7 @@ module.exports = __webpack_require__.v(exports, module.id, "5a6637e8d63cdf9c72da /******/ })); /******/ __webpack_require__.a = (module, body, hasAwait) => { /******/ var queue; -/******/ hasAwait && ((queue = []).d = 1); +/******/ hasAwait && ((queue = []).d = -1); /******/ var depQueues = new Set(); /******/ var exports = module.exports; /******/ var currentDeps; @@ -288,7 +288,7 @@ module.exports = __webpack_require__.v(exports, module.id, "5a6637e8d63cdf9c72da /******/ }); /******/ return fn.r ? promise : getResult(); /******/ }, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))); -/******/ queue && (queue.d = 0); +/******/ queue && queue.d < 0 && (queue.d = 0); /******/ }; /******/ })(); /******/ @@ -324,14 +324,26 @@ module.exports = __webpack_require__.v(exports, module.id, "5a6637e8d63cdf9c72da /******/ (() => { /******/ __webpack_require__.v = (exports, wasmModuleId, wasmModuleHash, importsObj) => { /******/ var req = fetch(__webpack_require__.p + "" + wasmModuleHash + ".wasm"); -/******/ if (typeof WebAssembly.instantiateStreaming === 'function') { -/******/ return WebAssembly.instantiateStreaming(req, importsObj) -/******/ .then((res) => (Object.assign(exports, res.instance.exports))); -/******/ } -/******/ return req +/******/ var fallback = () => (req /******/ .then((x) => (x.arrayBuffer())) /******/ .then((bytes) => (WebAssembly.instantiate(bytes, importsObj))) -/******/ .then((res) => (Object.assign(exports, res.instance.exports))); +/******/ .then((res) => (Object.assign(exports, res.instance.exports)))); +/******/ return req.then((res) => { +/******/ if (typeof WebAssembly.instantiateStreaming === "function") { +/******/ return WebAssembly.instantiateStreaming(res, importsObj) +/******/ .then( +/******/ (res) => (Object.assign(exports, res.instance.exports)), +/******/ (e) => { +/******/ if(res.headers.get("Content-Type") !== "application/wasm") { +/******/ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); +/******/ return fallback(); +/******/ } +/******/ throw e; +/******/ } +/******/ ); +/******/ } +/******/ return fallback(); +/******/ }); /******/ }; /******/ })(); /******/ @@ -361,35 +373,35 @@ module.exports = __webpack_require__.v(exports, module.id, "5a6637e8d63cdf9c72da ## Unoptimized ``` -asset output.js 12.6 KiB [emitted] (name: main) +asset output.js 13.2 KiB [emitted] (name: main) asset 5a6637e8d63cdf9c72da.wasm 67 bytes [emitted] [immutable] (auxiliary name: main) asset 35a58b7c95860d720a3c.wasm 62 bytes [emitted] [immutable] (auxiliary name: main) asset 0eaeab8b9fa3cef100d1.wasm 41 bytes [emitted] [immutable] (auxiliary name: main) -chunk (runtime: main) output.js (main) 1.27 KiB (javascript) 170 bytes (webassembly) 3.23 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 1.27 KiB (javascript) 170 bytes (webassembly) 3.68 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 3.23 KiB 6 modules + runtime modules 3.68 KiB 6 modules dependent modules 552 bytes (javascript) 170 bytes (webassembly) [dependent] 4 modules ./example.js 753 bytes [built] [code generated] [no exports] [used exports unknown] entry ./example.js main -webpack 5.78.0 compiled successfully +webpack 5.90.0 compiled successfully ``` ## Production mode ``` -asset output.js 2.57 KiB [emitted] [minimized] (name: main) +asset output.js 2.89 KiB [emitted] [minimized] (name: main) asset 67aca7a09456080b5120.wasm 67 bytes [emitted] [immutable] (auxiliary name: main) asset 36825f9224dde8d88de0.wasm 62 bytes [emitted] [immutable] (auxiliary name: main) asset 10cff76bc58b7aa8f9cb.wasm 41 bytes [emitted] [immutable] (auxiliary name: main) -chunk (runtime: main) output.js (main) 1.27 KiB (javascript) 170 bytes (webassembly) 2.96 KiB (runtime) [entry] [rendered] +chunk (runtime: main) output.js (main) 1.27 KiB (javascript) 170 bytes (webassembly) 3.42 KiB (runtime) [entry] [rendered] > ./example.js main - runtime modules 2.96 KiB 5 modules + runtime modules 3.42 KiB 5 modules dependent modules 552 bytes (javascript) 170 bytes (webassembly) [dependent] 4 modules ./example.js 753 bytes [built] [code generated] [no exports] [no exports used] entry ./example.js main -webpack 5.78.0 compiled successfully +webpack 5.90.0 compiled successfully ``` diff --git a/hot/log.js b/hot/log.js index 81bc8524b45..281771d11ec 100644 --- a/hot/log.js +++ b/hot/log.js @@ -45,11 +45,9 @@ module.exports = function (level, msg) { } }; -/* eslint-disable node/no-unsupported-features/node-builtins */ var group = console.group || dummy; var groupCollapsed = console.groupCollapsed || dummy; var groupEnd = console.groupEnd || dummy; -/* eslint-enable node/no-unsupported-features/node-builtins */ module.exports.group = logGroup(group); diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 00000000000..2cc6d151b2e --- /dev/null +++ b/jest.config.js @@ -0,0 +1,54 @@ +/** @type {import('jest').Config} */ +const config = { + prettierPath: require.resolve("prettier-2"), + forceExit: true, + setupFilesAfterEnv: ["/test/setupTestFramework.js"], + testMatch: [ + "/test/*.test.js", + "/test/*.basictest.js", + "/test/*.longtest.js", + "/test/*.unittest.js" + ], + watchPathIgnorePatterns: [ + "/.git", + "/node_modules", + "/test/js", + "/test/browsertest/js", + "/test/fixtures/temp-cache-fixture", + "/test/fixtures/temp-", + "/benchmark", + "/assembly", + "/tooling", + "/examples/*/dist", + "/coverage", + "/.eslintcache" + ], + modulePathIgnorePatterns: [ + "/.git", + "/node_modules/webpack/node_modules", + "/test/js", + "/test/browsertest/js", + "/test/fixtures/temp-cache-fixture", + "/test/fixtures/temp-", + "/benchmark", + "/examples/*/dist", + "/coverage", + "/.eslintcache" + ], + transformIgnorePatterns: [""], + coverageDirectory: "/coverage", + coveragePathIgnorePatterns: [ + "\\.runtime\\.js$", + "/test", + "/schemas", + "/node_modules" + ], + testEnvironment: "./test/patch-node-env.js", + coverageReporters: ["json"], + snapshotFormat: { + escapeString: true, + printBasicPrototype: true + } +}; + +module.exports = config; diff --git a/lib/APIPlugin.js b/lib/APIPlugin.js index cd4dd872199..cc13392b85d 100644 --- a/lib/APIPlugin.js +++ b/lib/APIPlugin.js @@ -24,10 +24,12 @@ const ChunkNameRuntimeModule = require("./runtime/ChunkNameRuntimeModule"); const GetFullHashRuntimeModule = require("./runtime/GetFullHashRuntimeModule"); /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("./javascript/JavascriptParser").Range} Range */ /** - * @param {boolean} module true if ES module + * @param {boolean | undefined} module true if ES module * @param {string} importMetaName `import.meta` name * @returns {Record} replacements */ @@ -150,7 +152,9 @@ class APIPlugin { compiler.hooks.compilation.tap( PLUGIN_NAME, (compilation, { normalModuleFactory }) => { - const { importMetaName } = compilation.outputOptions; + const importMetaName = /** @type {string} */ ( + compilation.outputOptions.importMetaName + ); const REPLACEMENTS = getReplacements( this.options.module, importMetaName @@ -166,7 +170,7 @@ class APIPlugin { .tap(PLUGIN_NAME, chunk => { compilation.addRuntimeModule( chunk, - new ChunkNameRuntimeModule(chunk.name) + new ChunkNameRuntimeModule(/** @type {string} */ (chunk.name)) ); return true; }); @@ -218,7 +222,7 @@ class APIPlugin { if (info.assign === false) { parser.hooks.assign.for(key).tap(PLUGIN_NAME, expr => { const err = new WebpackError(`${key} must not be assigned`); - err.loc = expr.loc; + err.loc = /** @type {DependencyLocation} */ (expr.loc); throw err; }); } @@ -234,9 +238,9 @@ class APIPlugin { .tap(PLUGIN_NAME, expr => { const dep = new ConstDependency( JSON.stringify(parser.state.module.layer), - expr.range + /** @type {Range} */ (expr.range) ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); @@ -247,8 +251,8 @@ class APIPlugin { ? new BasicEvaluatedExpression().setNull() : new BasicEvaluatedExpression().setString( parser.state.module.layer - ) - ).setRange(expr.range) + ) + ).setRange(/** @type {Range} */ (expr.range)) ); parser.hooks.evaluateTypeof .for("__webpack_layer__") @@ -257,7 +261,7 @@ class APIPlugin { .setString( parser.state.module.layer === null ? "object" : "string" ) - .setRange(expr.range) + .setRange(/** @type {Range} */ (expr.range)) ); parser.hooks.expression @@ -267,10 +271,10 @@ class APIPlugin { "__webpack_module__.id"; const dep = new ConstDependency( parser.state.module.moduleArgument + ".id", - expr.range, + /** @type {Range} */ (expr.range), [RuntimeGlobals.moduleId] ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); @@ -282,10 +286,10 @@ class APIPlugin { "__webpack_module__"; const dep = new ConstDependency( parser.state.module.moduleArgument, - expr.range, + /** @type {Range} */ (expr.range), [RuntimeGlobals.module] ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); diff --git a/lib/ChunkGraph.js b/lib/ChunkGraph.js index a191435197b..0b27a2f6751 100644 --- a/lib/ChunkGraph.js +++ b/lib/ChunkGraph.js @@ -1539,7 +1539,7 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza return withConnections ? BigInt( `0x${this._getModuleGraphHashWithConnections(cgm, module, runtime)}` - ) + ) : this._getModuleGraphHashBigInt(cgm, module, runtime); } diff --git a/lib/CleanPlugin.js b/lib/CleanPlugin.js index 6e5c3b0f7d5..534af201a61 100644 --- a/lib/CleanPlugin.js +++ b/lib/CleanPlugin.js @@ -328,18 +328,18 @@ class CleanPlugin { typeof keep === "function" ? keep : typeof keep === "string" - ? /** - * @param {string} path path - * @returns {boolean} true, if the path should be kept - */ - path => path.startsWith(keep) - : typeof keep === "object" && keep.test - ? /** - * @param {string} path path - * @returns {boolean} true, if the path should be kept - */ - path => keep.test(path) - : () => false; + ? /** + * @param {string} path path + * @returns {boolean} true, if the path should be kept + */ + path => path.startsWith(keep) + : typeof keep === "object" && keep.test + ? /** + * @param {string} path path + * @returns {boolean} true, if the path should be kept + */ + path => keep.test(path) + : () => false; // We assume that no external modification happens while the compiler is active // So we can store the old assets and only diff to them to avoid fs access on diff --git a/lib/Compilation.js b/lib/Compilation.js index a880195717b..1c23bbfa5fd 100644 --- a/lib/Compilation.js +++ b/lib/Compilation.js @@ -885,6 +885,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si this.resolverFactory = compiler.resolverFactory; this.inputFileSystem = compiler.inputFileSystem; this.fileSystemInfo = new FileSystemInfo(this.inputFileSystem, { + unmanagedPaths: compiler.unmanagedPaths, managedPaths: compiler.managedPaths, immutablePaths: compiler.immutablePaths, logger: this.getLogger("webpack.FileSystemInfo"), @@ -1086,7 +1087,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si } /** - * @param {StatsOptions | string} optionsOrPreset stats option value + * @param {StatsOptions | string | undefined} optionsOrPreset stats option value * @param {CreateStatsOptionsContext} context context * @returns {NormalizedStatsOptions} normalized options */ @@ -1177,9 +1178,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si }; if (this.hooks.log.call(name, logEntry) === undefined) { if (logEntry.type === LogType.profileEnd) { - // eslint-disable-next-line node/no-unsupported-features/node-builtins if (typeof console.profileEnd === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins console.profileEnd(`[${name}] ${logEntry.args[0]}`); } } @@ -1192,9 +1191,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si } logEntries.push(logEntry); if (logEntry.type === LogType.profile) { - // eslint-disable-next-line node/no-unsupported-features/node-builtins if (typeof console.profile === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins console.profile(`[${name}] ${logEntry.args[0]}`); } } @@ -1725,6 +1722,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si originModule, module, true, + false, callback ); } @@ -1744,6 +1742,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si * @property {string=} context * @property {boolean=} recursive recurse into dependencies of the created module * @property {boolean=} connectOrigin connect the resolved module with the origin module + * @property {boolean=} checkCycle check the cycle dependencies of the created module */ /** @@ -1759,7 +1758,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si contextInfo, context, recursive = true, - connectOrigin = recursive + connectOrigin = recursive, + checkCycle = !recursive }, callback ) { @@ -1880,6 +1880,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si originModule, module, recursive, + checkCycle, callback ); }); @@ -1887,10 +1888,16 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si ); } - _handleModuleBuildAndDependencies(originModule, module, recursive, callback) { + _handleModuleBuildAndDependencies( + originModule, + module, + recursive, + checkCycle, + callback + ) { // Check for cycles when build is trigger inside another build let creatingModuleDuringBuildSet = undefined; - if (!recursive && this.buildQueue.isProcessing(originModule)) { + if (checkCycle && this.buildQueue.isProcessing(originModule)) { // Track build dependency creatingModuleDuringBuildSet = this.creatingModuleDuringBuild.get(originModule); @@ -1988,8 +1995,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si context: context ? context : originModule - ? originModule.context - : this.compiler.context, + ? originModule.context + : this.compiler.context, dependencies: dependencies }, (err, result) => { @@ -2668,9 +2675,9 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si loaders ? `${ modules.length - } x ${moduleType} with ${this.requestShortener.shorten( + } x ${moduleType} with ${this.requestShortener.shorten( loaders - )}` + )}` : `${modules.length} x ${moduleType}` }` ); @@ -3078,7 +3085,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o `BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation. Do changes to assets earlier, e. g. in Compilation.hooks.processAssets. Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.` - ) + ) : Object.freeze(this.assets); this.summarizeDependencies(); @@ -3341,6 +3348,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o dependencyTemplates, runtimeTemplate, runtime, + runtimes, codeGenerationResults: results, compilation: this }); @@ -4584,8 +4592,8 @@ This prevents using hashes of each other and should be avoided.`); (typeof file === "string" ? file : typeof filenameTemplate === "string" - ? filenameTemplate - : ""); + ? filenameTemplate + : ""); this.errors.push(new ChunkRenderError(chunk, filename, err)); inTry = false; @@ -4607,7 +4615,7 @@ This prevents using hashes of each other and should be avoided.`); ? { ...pathAndInfo.info, ...fileManifest.info - } + } : pathAndInfo.info; } @@ -4927,7 +4935,8 @@ This prevents using hashes of each other and should be avoided.`); hashFunction, runtimeTemplate, hashDigest, - hashDigestLength + hashDigestLength, + errors ); } diff --git a/lib/Compiler.js b/lib/Compiler.js index 7cc074860b9..685a93c72d4 100644 --- a/lib/Compiler.js +++ b/lib/Compiler.js @@ -228,6 +228,8 @@ class Compiler { /** @type {Set} */ this.managedPaths = new Set(); /** @type {Set} */ + this.unmanagedPaths = new Set(); + /** @type {Set} */ this.immutablePaths = new Set(); /** @type {ReadonlySet | undefined} */ @@ -381,6 +383,17 @@ class Compiler { // e.g. move compilation specific info from Modules into ModuleGraph _cleanupLastCompilation() { if (this._lastCompilation !== undefined) { + for (const childCompilation of this._lastCompilation.children) { + for (const module of childCompilation.modules) { + ChunkGraph.clearChunkGraphForModule(module); + ModuleGraph.clearModuleGraphForModule(module); + module.cleanupForCache(); + } + for (const chunk of childCompilation.chunks) { + ChunkGraph.clearChunkGraphForChunk(chunk); + } + } + for (const module of this._lastCompilation.modules) { ChunkGraph.clearChunkGraphForModule(module); ModuleGraph.clearModuleGraphForModule(module); diff --git a/lib/ConcatenationScope.js b/lib/ConcatenationScope.js index 8c26166b153..aa8a0ed7189 100644 --- a/lib/ConcatenationScope.js +++ b/lib/ConcatenationScope.js @@ -114,8 +114,8 @@ class ConcatenationScope { const asiSafeFlag = asiSafe ? "_asiSafe1" : asiSafe === false - ? "_asiSafe0" - : ""; + ? "_asiSafe0" + : ""; const exportData = ids ? Buffer.from(JSON.stringify(ids), "utf-8").toString("hex") : "ns"; diff --git a/lib/ConditionalInitFragment.js b/lib/ConditionalInitFragment.js index 93402f5b50d..54abfd7c7bc 100644 --- a/lib/ConditionalInitFragment.js +++ b/lib/ConditionalInitFragment.js @@ -62,8 +62,8 @@ class ConditionalInitFragment extends InitFragment { } /** - * @param {Context} context context - * @returns {string|Source} the source code that will be included as initialization code + * @param {GenerateContext} context context + * @returns {string | Source} the source code that will be included as initialization code */ getContent(context) { if (this.runtimeCondition === false || !this.content) return ""; @@ -79,7 +79,7 @@ class ConditionalInitFragment extends InitFragment { } /** - * @param {Context} context context + * @param {GenerateContext} context context * @returns {string|Source=} the source code that will be included at the end of the module */ getEndContent(context) { diff --git a/lib/ContextModule.js b/lib/ContextModule.js index 2100481f2ac..d39f8f88098 100644 --- a/lib/ContextModule.js +++ b/lib/ContextModule.js @@ -509,8 +509,8 @@ class ContextModule extends Module { this.context ? [this.context] : typeof this.options.resource === "string" - ? [this.options.resource] - : /** @type {string[]} */ (this.options.resource), + ? [this.options.resource] + : /** @type {string[]} */ (this.options.resource), null, SNAPSHOT_OPTIONS, (err, snapshot) => { @@ -947,8 +947,8 @@ module.exports = webpackAsyncContext;`; const requestPrefix = hasNoChunk ? "Promise.resolve()" : hasMultipleOrNoChunks - ? `Promise.all(ids.slice(${chunksStartPosition}).map(${RuntimeGlobals.ensureChunk}))` - : `${RuntimeGlobals.ensureChunk}(ids[${chunksStartPosition}])`; + ? `Promise.all(ids.slice(${chunksStartPosition}).map(${RuntimeGlobals.ensureChunk}))` + : `${RuntimeGlobals.ensureChunk}(ids[${chunksStartPosition}])`; const returnModuleObject = this.getReturnModuleObjectSource( fakeMap, true, diff --git a/lib/ContextModuleFactory.js b/lib/ContextModuleFactory.js index b30447b8788..65a2131bc69 100644 --- a/lib/ContextModuleFactory.js +++ b/lib/ContextModuleFactory.js @@ -160,7 +160,7 @@ module.exports = class ContextModuleFactory extends ModuleFactory { resolveOptions || EMPTY_RESOLVE_OPTIONS, "dependencyType", dependencies[0].category - ) + ) : resolveOptions ); const loaderResolver = this.resolverFactory.get("loader"); diff --git a/lib/DefinePlugin.js b/lib/DefinePlugin.js index f604523ecd2..ed02a3cbd2d 100644 --- a/lib/DefinePlugin.js +++ b/lib/DefinePlugin.js @@ -23,9 +23,11 @@ const createHash = require("./util/createHash"); /** @typedef {import("estree").Expression} Expression */ /** @typedef {import("./Compiler")} Compiler */ +/** @typedef {import("./Module").BuildInfo} BuildInfo */ /** @typedef {import("./NormalModule")} NormalModule */ /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ /** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("./javascript/JavascriptParser").Range} Range */ /** @typedef {import("./logging/Logger").Logger} Logger */ /** @typedef {null|undefined|RegExp|Function|string|number|boolean|bigint|undefined} CodeValuePrimitive */ @@ -66,7 +68,7 @@ class RuntimeValue { * @returns {CodeValuePrimitive} code */ exec(parser, valueCacheVersions, key) { - const buildInfo = parser.state.module.buildInfo; + const buildInfo = /** @type {BuildInfo} */ (parser.state.module.buildInfo); if (this.options === true) { buildInfo.cacheable = false; } else { @@ -136,19 +138,21 @@ const stringifyObj = ( let code; let arr = Array.isArray(obj); if (arr) { - code = `[${obj - .map(code => - toCode( - code, - parser, - valueCacheVersions, - key, - runtimeTemplate, - logger, - null + code = `[${ + /** @type {any[]} */ (obj) + .map(code => + toCode( + code, + parser, + valueCacheVersions, + key, + runtimeTemplate, + logger, + null + ) ) - ) - .join(",")}]`; + .join(",") + }]`; } else { let keys = Object.keys(obj); if (objKeys) { @@ -157,7 +161,7 @@ const stringifyObj = ( } code = `{${keys .map(key => { - const code = obj[key]; + const code = /** @type {{[k: string]: any}} */ (obj)[key]; return ( JSON.stringify(key) + ":" + @@ -263,6 +267,10 @@ const toCode = ( return strCode; }; +/** + * @param {CodeValue} code code + * @returns {string | undefined} result + */ const toCacheVersion = code => { if (code === null) { return "null"; @@ -285,7 +293,7 @@ const toCacheVersion = code => { if (typeof code === "object") { const items = Object.keys(code).map(key => ({ key, - value: toCacheVersion(code[key]) + value: toCacheVersion(/** @type {Record} */ (code)[key]) })); if (items.some(({ value }) => value === undefined)) return undefined; return `{${items.map(({ key, value }) => `${key}: ${value}`).join(", ")}}`; @@ -353,14 +361,21 @@ class DefinePlugin { const handler = parser => { const mainValue = compilation.valueCacheVersions.get(VALUE_DEP_MAIN); parser.hooks.program.tap(PLUGIN_NAME, () => { - const { buildInfo } = parser.state.module; + const buildInfo = /** @type {BuildInfo} */ ( + parser.state.module.buildInfo + ); if (!buildInfo.valueDependencies) buildInfo.valueDependencies = new Map(); buildInfo.valueDependencies.set(VALUE_DEP_MAIN, mainValue); }); + /** + * @param {string} key key + */ const addValueDependency = key => { - const { buildInfo } = parser.state.module; + const buildInfo = /** @type {BuildInfo} */ ( + parser.state.module.buildInfo + ); buildInfo.valueDependencies.set( VALUE_DEP_PREFIX + key, compilation.valueCacheVersions.get(VALUE_DEP_PREFIX + key) @@ -376,7 +391,7 @@ class DefinePlugin { /** * Walk definitions - * @param {Object} definitions Definitions map + * @param {Record} definitions Definitions map * @param {string} prefix Prefix string * @returns {void} */ @@ -389,7 +404,10 @@ class DefinePlugin { !(code instanceof RuntimeValue) && !(code instanceof RegExp) ) { - walkDefinitions(code, prefix + key + "."); + walkDefinitions( + /** @type {Record} */ (code), + prefix + key + "." + ); applyObjectDefine(prefix + key, code); return; } @@ -458,7 +476,7 @@ class DefinePlugin { ) ); recurse = false; - res.setRange(expr.range); + res.setRange(/** @type {Range} */ (expr.range)); return res; }); parser.hooks.expression.for(key).tap(PLUGIN_NAME, expr => { @@ -470,7 +488,7 @@ class DefinePlugin { originalKey, runtimeTemplate, logger, - !parser.isAsiPosition(expr.range[0]), + !parser.isAsiPosition(/** @type {Range} */ (expr.range)[0]), parser.destructuringAssignmentPropertiesFor(expr) ); @@ -517,7 +535,7 @@ class DefinePlugin { : "typeof (" + codeCode + ")"; const res = parser.evaluate(typeofCode); recurseTypeof = false; - res.setRange(expr.range); + res.setRange(/** @type {Range} */ (expr.range)); return res; }); parser.hooks.typeof.for(key).tap(PLUGIN_NAME, expr => { @@ -559,7 +577,7 @@ class DefinePlugin { return new BasicEvaluatedExpression() .setTruthy() .setSideEffects(false) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); }); parser.hooks.evaluateTypeof .for(key) @@ -576,7 +594,7 @@ class DefinePlugin { key, runtimeTemplate, logger, - !parser.isAsiPosition(expr.range[0]), + !parser.isAsiPosition(/** @type {Range} */ (expr.range)[0]), parser.destructuringAssignmentPropertiesFor(expr) ); @@ -622,7 +640,7 @@ class DefinePlugin { /** * Walk definitions - * @param {Object} definitions Definitions map + * @param {Record} definitions Definitions map * @param {string} prefix Prefix string * @returns {void} */ @@ -649,7 +667,10 @@ class DefinePlugin { !(code instanceof RuntimeValue) && !(code instanceof RegExp) ) { - walkDefinitionsForValues(code, prefix + key + "."); + walkDefinitionsForValues( + /** @type {Record} */ (code), + prefix + key + "." + ); } }); }; diff --git a/lib/DependencyTemplate.js b/lib/DependencyTemplate.js index 67a4d7b8305..b568d0c0ebe 100644 --- a/lib/DependencyTemplate.js +++ b/lib/DependencyTemplate.js @@ -26,10 +26,12 @@ * @property {ChunkGraph} chunkGraph the chunk graph * @property {Set} runtimeRequirements the requirements for runtime * @property {Module} module current module - * @property {RuntimeSpec} runtime current runtimes, for which code is generated + * @property {RuntimeSpec} runtime current runtime, for which code is generated + * @property {RuntimeSpec[]} [runtimes] current runtimes, for which code is generated * @property {InitFragment[]} initFragments mutable array of init fragments for the current module * @property {ConcatenationScope=} concatenationScope when in a concatenated module, information about other concatenated modules * @property {CodeGenerationResults} codeGenerationResults the code generation results + * @property {InitFragment[]} chunkInitFragments chunkInitFragments */ /** diff --git a/lib/EnvironmentNotSupportAsyncWarning.js b/lib/EnvironmentNotSupportAsyncWarning.js new file mode 100644 index 00000000000..1a1ea9ece66 --- /dev/null +++ b/lib/EnvironmentNotSupportAsyncWarning.js @@ -0,0 +1,52 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Gengkun He @ahabhgk +*/ + +"use strict"; + +const WebpackError = require("./WebpackError"); +const makeSerializable = require("./util/makeSerializable"); + +/** @typedef {import("./Module")} Module */ +/** @typedef {import("./Compilation")} Compilation */ +/** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ +/** @typedef {"asyncWebAssembly" | "topLevelAwait" | "external promise" | "external script" | "external import" | "external module"} Feature */ + +class EnvironmentNotSupportAsyncWarning extends WebpackError { + /** + * Creates an instance of EnvironmentNotSupportAsyncWarning. + * @param {Module} module module + * @param {Feature} feature feature + */ + constructor(module, feature) { + const message = `The generated code contains 'async/await' because this module is using "${feature}". +However, your target environment does not appear to support 'async/await'. +As a result, the code may not run as expected or may cause runtime errors.`; + super(message); + + this.name = "EnvironmentNotSupportAsyncWarning"; + this.module = module; + } + + /** + * Creates an instance of EnvironmentNotSupportAsyncWarning. + * @param {Module} module module + * @param {RuntimeTemplate} runtimeTemplate compilation + * @param {Feature} feature feature + */ + static check(module, runtimeTemplate, feature) { + if (!runtimeTemplate.supportsAsyncFunction()) { + module.addWarning(new EnvironmentNotSupportAsyncWarning(module, feature)); + } + } +} + +makeSerializable( + EnvironmentNotSupportAsyncWarning, + "webpack/lib/EnvironmentNotSupportAsyncWarning" +); + +module.exports = EnvironmentNotSupportAsyncWarning; diff --git a/lib/EvalDevToolModulePlugin.js b/lib/EvalDevToolModulePlugin.js index b0a47db88f7..003080806d5 100644 --- a/lib/EvalDevToolModulePlugin.js +++ b/lib/EvalDevToolModulePlugin.js @@ -82,7 +82,7 @@ class EvalDevToolModulePlugin { compilation.outputOptions.trustedTypes ? `${RuntimeGlobals.createScript}(${JSON.stringify( content + footer - )})` + )})` : JSON.stringify(content + footer) });` ); diff --git a/lib/EvalSourceMapDevToolPlugin.js b/lib/EvalSourceMapDevToolPlugin.js index b3803b11ddb..4ef3dc28c57 100644 --- a/lib/EvalSourceMapDevToolPlugin.js +++ b/lib/EvalSourceMapDevToolPlugin.js @@ -129,7 +129,7 @@ class EvalSourceMapDevToolPlugin { // Clone (flat) the sourcemap to ensure that the mutations below do not persist. sourceMap = { ...sourceMap }; - const context = compiler.options.context; + const context = /** @type {string} */ (compiler.options.context); const root = compiler.root; const modules = sourceMap.sources.map(source => { if (!source.startsWith("webpack://")) return source; @@ -182,7 +182,7 @@ class EvalSourceMapDevToolPlugin { compilation.outputOptions.trustedTypes ? `${RuntimeGlobals.createScript}(${JSON.stringify( content + footer - )})` + )})` : JSON.stringify(content + footer) });` ) diff --git a/lib/ExportsInfoApiPlugin.js b/lib/ExportsInfoApiPlugin.js index 5d469f6bfe9..faf4594bbd0 100644 --- a/lib/ExportsInfoApiPlugin.js +++ b/lib/ExportsInfoApiPlugin.js @@ -48,12 +48,12 @@ class ExportsInfoApiPlugin { /** @type {Range} */ (expr.range), members.slice(0, -1), members[members.length - 1] - ) + ) : new ExportsInfoDependency( /** @type {Range} */ (expr.range), null, members[0] - ); + ); dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addDependency(dep); return true; diff --git a/lib/ExternalModule.js b/lib/ExternalModule.js index 7f00a20a975..a8fb263bf0c 100644 --- a/lib/ExternalModule.js +++ b/lib/ExternalModule.js @@ -7,6 +7,7 @@ const { OriginalSource, RawSource } = require("webpack-sources"); const ConcatenationScope = require("./ConcatenationScope"); +const EnvironmentNotSupportAsyncWarning = require("./EnvironmentNotSupportAsyncWarning"); const { UsageState } = require("./ExportsInfo"); const InitFragment = require("./InitFragment"); const Module = require("./Module"); @@ -217,7 +218,12 @@ register( } ); -const generateModuleRemapping = (input, exportsInfo, runtime) => { +const generateModuleRemapping = ( + input, + exportsInfo, + runtime, + runtimeTemplate +) => { if (exportsInfo.otherExportsInfo.getUsed(runtime) === UsageState.Unused) { const properties = []; for (const exportInfo of exportsInfo.orderedExports) { @@ -235,9 +241,9 @@ const generateModuleRemapping = (input, exportsInfo, runtime) => { } } properties.push( - `[${JSON.stringify(used)}]: () => ${input}${propertyAccess([ - exportInfo.name - ])}` + `[${JSON.stringify(used)}]: ${runtimeTemplate.returningFunction( + `${input}${propertyAccess([exportInfo.name])}` + )}` ); } return `x({ ${properties.join(", ")} })`; @@ -248,21 +254,21 @@ const generateModuleRemapping = (input, exportsInfo, runtime) => { * @param {string|string[]} moduleAndSpecifiers the module request * @param {ExportsInfo} exportsInfo exports info of this module * @param {RuntimeSpec} runtime the runtime - * @param {string | HashConstructor=} hashFunction the hash function to use + * @param {RuntimeTemplate} runtimeTemplate the runtime template * @returns {SourceData} the generated source */ const getSourceForModuleExternal = ( moduleAndSpecifiers, exportsInfo, runtime, - hashFunction + runtimeTemplate ) => { if (!Array.isArray(moduleAndSpecifiers)) moduleAndSpecifiers = [moduleAndSpecifiers]; const initFragment = new ModuleExternalInitFragment( moduleAndSpecifiers[0], undefined, - hashFunction + runtimeTemplate.outputOptions.hashFunction ); const baseAccess = `${initFragment.getNamespaceIdentifier()}${propertyAccess( moduleAndSpecifiers, @@ -271,12 +277,19 @@ const getSourceForModuleExternal = ( const moduleRemapping = generateModuleRemapping( baseAccess, exportsInfo, - runtime + runtime, + runtimeTemplate ); let expression = moduleRemapping || baseAccess; return { expression, - init: `var x = y => { var x = {}; ${RuntimeGlobals.definePropertyGetters}(x, y); return x; }\nvar y = x => () => x`, + init: `var x = ${runtimeTemplate.basicFunction( + "y", + `var x = {}; ${RuntimeGlobals.definePropertyGetters}(x, y); return x` + )} \nvar y = ${runtimeTemplate.returningFunction( + runtimeTemplate.returningFunction("x"), + "x" + )}`, runtimeRequirements: moduleRemapping ? RUNTIME_REQUIREMENTS_FOR_MODULE : undefined, @@ -355,7 +368,7 @@ const getSourceForAmdOrUmdExternal = ( externalVariable, Array.isArray(request) ? request.join(".") : request, runtimeTemplate - ) + ) : undefined, expression: externalVariable }; @@ -491,6 +504,11 @@ class ExternalModule extends Module { } } else { this.buildMeta.async = true; + EnvironmentNotSupportAsyncWarning.check( + this, + compilation.runtimeTemplate, + "external module" + ); if (!Array.isArray(request) || request.length === 1) { this.buildMeta.exportsType = "namespace"; canMangle = false; @@ -498,11 +516,28 @@ class ExternalModule extends Module { } break; case "script": + this.buildMeta.async = true; + EnvironmentNotSupportAsyncWarning.check( + this, + compilation.runtimeTemplate, + "external script" + ); + break; case "promise": this.buildMeta.async = true; + EnvironmentNotSupportAsyncWarning.check( + this, + compilation.runtimeTemplate, + "external promise" + ); break; case "import": this.buildMeta.async = true; + EnvironmentNotSupportAsyncWarning.check( + this, + compilation.runtimeTemplate, + "external import" + ); if (!Array.isArray(request) || request.length === 1) { this.buildMeta.exportsType = "namespace"; canMangle = false; @@ -569,7 +604,7 @@ class ExternalModule extends Module { ? getSourceForCommonJsExternalInNodeModule( request, runtimeTemplate.outputOptions.importMetaName - ) + ) : getSourceForCommonJsExternal(request); case "amd": case "amd-require": @@ -610,7 +645,7 @@ class ExternalModule extends Module { request, moduleGraph.getExportsInfo(this), runtime, - runtimeTemplate.outputOptions.hashFunction + runtimeTemplate ); } case "var": diff --git a/lib/ExternalModuleFactoryPlugin.js b/lib/ExternalModuleFactoryPlugin.js index 5dae85c7184..bd917ba49b4 100644 --- a/lib/ExternalModuleFactoryPlugin.js +++ b/lib/ExternalModuleFactoryPlugin.js @@ -192,7 +192,7 @@ class ExternalModuleFactoryPlugin { data.resolveOptions || EMPTY_RESOLVE_OPTIONS, "dependencyType", dependencyType - ) + ) : data.resolveOptions ); if (options) resolver = resolver.withOptions(options); diff --git a/lib/FileSystemInfo.js b/lib/FileSystemInfo.js index df01c158c12..59bf473368c 100644 --- a/lib/FileSystemInfo.js +++ b/lib/FileSystemInfo.js @@ -729,7 +729,8 @@ class SnapshotOptimization { } const parseString = str => { - if (str[0] === "'") str = `"${str.slice(1, -1).replace(/"/g, '\\"')}"`; + if (str[0] === "'" || str[0] === "`") + str = `"${str.slice(1, -1).replace(/"/g, '\\"')}"`; return JSON.parse(str); }; @@ -898,6 +899,7 @@ class FileSystemInfo { /** * @param {InputFileSystem} fs file system * @param {Object} options options + * @param {Iterable=} options.unmanagedPaths paths that are not managed by a package manager and the contents are subject to change * @param {Iterable=} options.managedPaths paths that are only managed by a package manager * @param {Iterable=} options.immutablePaths paths that are immutable * @param {Logger=} options.logger logger used to log invalid snapshots @@ -906,6 +908,7 @@ class FileSystemInfo { constructor( fs, { + unmanagedPaths = [], managedPaths = [], immutablePaths = [], logger, @@ -1040,6 +1043,14 @@ class FileSystemInfo { parallelism: 10, processor: this._getManagedItemDirectoryInfo.bind(this) }); + const _unmanagedPaths = Array.from(unmanagedPaths); + this.unmanagedPathsWithSlash = /** @type {string[]} */ ( + _unmanagedPaths.filter(p => typeof p === "string") + ).map(p => join(fs, p, "_").slice(0, -1)); + this.unmanagedPathsRegExps = /** @type {RegExp[]} */ ( + _unmanagedPaths.filter(p => typeof p !== "string") + ); + this.managedPaths = Array.from(managedPaths); this.managedPathsWithSlash = /** @type {string[]} */ ( this.managedPaths.filter(p => typeof p === "string") @@ -1733,7 +1744,7 @@ class FileSystemInfo { type: RBDT_RESOLVE_ESM_FILE, context, path: dependency, - expected: undefined, + expected: imp.d > -1 ? false : undefined, issuer: job }); } catch (e) { @@ -2028,6 +2039,12 @@ class FileSystemInfo { } }; const checkManaged = (path, managedSet) => { + for (const unmanagedPath of this.unmanagedPathsRegExps) { + if (unmanagedPath.test(path)) return false; + } + for (const unmanagedPath of this.unmanagedPathsWithSlash) { + if (path.startsWith(unmanagedPath)) return false; + } for (const immutablePath of this.immutablePathsRegExps) { if (immutablePath.test(path)) { managedSet.add(path); @@ -3346,7 +3363,7 @@ class FileSystemInfo { : { ...timestamp, ...hash - }; + }; this._contextTshs.set(path, result); callback(null, result); }; diff --git a/lib/FlagDependencyExportsPlugin.js b/lib/FlagDependencyExportsPlugin.js index defbf3781a8..9befc25447a 100644 --- a/lib/FlagDependencyExportsPlugin.js +++ b/lib/FlagDependencyExportsPlugin.js @@ -246,7 +246,7 @@ class FlagDependencyExportsPlugin { from, fromExport === undefined ? [name] : fromExport, priority - )) + )) ) { changed = true; } diff --git a/lib/Generator.js b/lib/Generator.js index ffa93230ac4..76099c44e77 100644 --- a/lib/Generator.js +++ b/lib/Generator.js @@ -27,6 +27,7 @@ * @property {ChunkGraph} chunkGraph the chunk graph * @property {Set} runtimeRequirements the requirements for runtime * @property {RuntimeSpec} runtime the runtime + * @property {RuntimeSpec[]} [runtimes] the runtimes * @property {ConcatenationScope=} concatenationScope when in concatenated module, information about other concatenated modules * @property {CodeGenerationResults=} codeGenerationResults code generation results of other modules (need to have a codeGenerationDependency to use that) * @property {string} type which kind of code should be generated diff --git a/lib/HotModuleReplacementPlugin.js b/lib/HotModuleReplacementPlugin.js index 9e117403c68..6a8eb98e10d 100644 --- a/lib/HotModuleReplacementPlugin.js +++ b/lib/HotModuleReplacementPlugin.js @@ -447,7 +447,7 @@ class HotModuleReplacementPlugin { : compilation.codeGenerationResults.getHash( module, chunk.runtime - ); + ); if (records.chunkModuleHashes[key] !== hash) { updatedModules.add(module, chunk); } @@ -571,7 +571,7 @@ class HotModuleReplacementPlugin { : compilation.codeGenerationResults.getHash( module, newRuntime - ); + ); if (hash !== oldHash) { if (module.type === WEBPACK_MODULE_TYPE_RUNTIME) { newRuntimeModules = newRuntimeModules || []; @@ -735,7 +735,7 @@ To fix this, make sure to include [runtime] in the output.hotUpdateMainFilename Array.from(removedModules, m => chunkGraph.getModuleId(m) ) - ) + ) }; const source = new RawSource(JSON.stringify(hotUpdateMainJson)); diff --git a/lib/InitFragment.js b/lib/InitFragment.js index 415660b5d34..5440670d9de 100644 --- a/lib/InitFragment.js +++ b/lib/InitFragment.js @@ -36,15 +36,15 @@ const sortFragmentWithIndex = ([a, i], [b, j]) => { }; /** - * @template Context + * @template GenerateContext */ class InitFragment { /** - * @param {string|Source} content the source code that will be included as initialization code + * @param {string | Source} content the source code that will be included as initialization code * @param {number} stage category of initialization code (contribute to order) * @param {number} position position in the category (contribute to order) * @param {string=} key unique key to avoid emitting the same initialization code twice - * @param {string|Source=} endContent the source code that will be included at the end of the module + * @param {string | Source=} endContent the source code that will be included at the end of the module */ constructor(content, stage, position, key, endContent) { this.content = content; @@ -55,15 +55,15 @@ class InitFragment { } /** - * @param {Context} context context - * @returns {string|Source} the source code that will be included as initialization code + * @param {GenerateContext} context context + * @returns {string | Source} the source code that will be included as initialization code */ getContent(context) { return this.content; } /** - * @param {Context} context context + * @param {GenerateContext} context context * @returns {string|Source=} the source code that will be included at the end of the module */ getEndContent(context) { @@ -91,7 +91,7 @@ class InitFragment { for (const [fragment] of sortedFragments) { if ( typeof ( - /** @type {InitFragment & { mergeAll?: (fragments: InitFragment[]) => InitFragment[] }} */ + /** @type {InitFragment & { mergeAll?: (fragments: InitFragment[]) => InitFragment[] }} */ (fragment).mergeAll ) === "function" ) { diff --git a/lib/LibManifestPlugin.js b/lib/LibManifestPlugin.js index 32939ed46d6..e3d5c3ec3f5 100644 --- a/lib/LibManifestPlugin.js +++ b/lib/LibManifestPlugin.js @@ -46,7 +46,10 @@ class LibManifestPlugin { */ apply(compiler) { compiler.hooks.emit.tapAsync( - "LibManifestPlugin", + { + name: "LibManifestPlugin", + stage: 110 + }, (compilation, callback) => { const moduleGraph = compilation.moduleGraph; asyncLib.forEach( diff --git a/lib/Module.js b/lib/Module.js index 7d8ebf4dcd3..5f05a848545 100644 --- a/lib/Module.js +++ b/lib/Module.js @@ -59,7 +59,8 @@ const makeSerializable = require("./util/makeSerializable"); * @property {RuntimeTemplate} runtimeTemplate the runtime template * @property {ModuleGraph} moduleGraph the module graph * @property {ChunkGraph} chunkGraph the chunk graph - * @property {RuntimeSpec} runtime the runtimes code should be generated for + * @property {RuntimeSpec} runtime the runtime code should be generated for + * @property {RuntimeSpec[]} [runtimes] the runtimes code should be generated for * @property {ConcatenationScope=} concatenationScope when in concatenated module, information about other concatenated modules * @property {CodeGenerationResults} codeGenerationResults code generation results of other modules (need to have a codeGenerationDependency to use that) * @property {Compilation=} compilation the compilation diff --git a/lib/ModuleFilenameHelpers.js b/lib/ModuleFilenameHelpers.js index 236c7ec8df8..949a011ee21 100644 --- a/lib/ModuleFilenameHelpers.js +++ b/lib/ModuleFilenameHelpers.js @@ -162,7 +162,7 @@ ModuleFilenameHelpers.createFilename = ( ? options : { moduleFilenameTemplate: options - }) + }) }; let absoluteResourcePath; diff --git a/lib/ModuleInfoHeaderPlugin.js b/lib/ModuleInfoHeaderPlugin.js index 2ee0b2a8122..0ed0f2527aa 100644 --- a/lib/ModuleInfoHeaderPlugin.js +++ b/lib/ModuleInfoHeaderPlugin.js @@ -96,7 +96,7 @@ const printExportsInfoToSource = ( .map(e => JSON.stringify(e).slice(1, -1)) .join(".")}` : "" - }` + }` : "" }` ) + "\n" diff --git a/lib/MultiStats.js b/lib/MultiStats.js index d236aef43f4..4f443bdb42b 100644 --- a/lib/MultiStats.js +++ b/lib/MultiStats.js @@ -59,8 +59,8 @@ class MultiStats { ...(typeof childOptions === "string" ? { preset: childOptions } : childOptions && typeof childOptions === "object" - ? childOptions - : undefined) + ? childOptions + : undefined) }, context ); diff --git a/lib/NodeStuffPlugin.js b/lib/NodeStuffPlugin.js index 4f288068666..e11d452ab01 100644 --- a/lib/NodeStuffPlugin.js +++ b/lib/NodeStuffPlugin.js @@ -13,6 +13,7 @@ const NodeStuffInWebError = require("./NodeStuffInWebError"); const RuntimeGlobals = require("./RuntimeGlobals"); const CachedConstDependency = require("./dependencies/CachedConstDependency"); const ConstDependency = require("./dependencies/ConstDependency"); +const ExternalModuleDependency = require("./dependencies/ExternalModuleDependency"); const { evaluateToString, expressionIsUnsupported @@ -52,6 +53,11 @@ class NodeStuffPlugin { compiler.hooks.compilation.tap( PLUGIN_NAME, (compilation, { normalModuleFactory }) => { + compilation.dependencyTemplates.set( + ExternalModuleDependency, + new ExternalModuleDependency.Template() + ); + /** * @param {JavascriptParser} parser the parser * @param {JavascriptParserOptions} parserOptions options @@ -128,6 +134,35 @@ class NodeStuffPlugin { }); }; + /** + * @param {string} expressionName expression name + * @param {(value: string) => string} fn function + * @returns {void} + */ + const setUrlModuleConstant = (expressionName, fn) => { + parser.hooks.expression + .for(expressionName) + .tap(PLUGIN_NAME, expr => { + const dep = new ExternalModuleDependency( + "url", + [ + { + name: "fileURLToPath", + value: "__webpack_fileURLToPath__" + } + ], + undefined, + fn("__webpack_fileURLToPath__"), + /** @type {Range} */ (expr.range), + expressionName + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); + parser.state.module.addPresentationalDependency(dep); + + return true; + }); + }; + /** * @param {string} expressionName expression name * @param {string} value value @@ -150,6 +185,12 @@ class NodeStuffPlugin { "__filename is a Node.js feature and isn't available in browsers." ); break; + case "node-module": + setUrlModuleConstant( + "__filename", + functionName => `${functionName}(import.meta.url)` + ); + break; case true: setModuleConstant("__filename", module => relative(compiler.inputFileSystem, context, module.resource) @@ -177,6 +218,13 @@ class NodeStuffPlugin { "__dirname is a Node.js feature and isn't available in browsers." ); break; + case "node-module": + setUrlModuleConstant( + "__dirname", + functionName => + `${functionName}(import.meta.url + "/..").slice(0, -1)` + ); + break; case true: setModuleConstant("__dirname", module => relative(compiler.inputFileSystem, context, module.context) diff --git a/lib/NormalModule.js b/lib/NormalModule.js index 87b78f30f06..fa0cc1fac1f 100644 --- a/lib/NormalModule.js +++ b/lib/NormalModule.js @@ -132,14 +132,14 @@ const contextifySourceMap = (context, sourceMap, associatedObjectForCache) => { const mapper = !sourceRoot ? source => source : sourceRoot.endsWith("/") - ? source => - source.startsWith("/") - ? `${sourceRoot.slice(0, -1)}${source}` - : `${sourceRoot}${source}` - : source => - source.startsWith("/") - ? `${sourceRoot}${source}` - : `${sourceRoot}/${source}`; + ? source => + source.startsWith("/") + ? `${sourceRoot.slice(0, -1)}${source}` + : `${sourceRoot}${source}` + : source => + source.startsWith("/") + ? `${sourceRoot}${source}` + : `${sourceRoot}/${source}`; const newSources = sourceMap.sources.map(source => contextifySourceUrl(context, mapper(source), associatedObjectForCache) ); @@ -782,7 +782,7 @@ class NormalModule extends Module { currentLoader ? compilation.runtimeTemplate.requestShortener.shorten( currentLoader.loader - ) + ) : "unknown" }) didn't return a Buffer or String` ); @@ -1181,6 +1181,7 @@ class NormalModule extends Module { moduleGraph, chunkGraph, runtime, + runtimes, concatenationScope, codeGenerationResults, sourceTypes @@ -1204,7 +1205,7 @@ class NormalModule extends Module { const source = this.error ? new RawSource( "throw new Error(" + JSON.stringify(this.error.message) + ");" - ) + ) : this.generator.generate(this, { dependencyTemplates, runtimeTemplate, @@ -1212,11 +1213,12 @@ class NormalModule extends Module { chunkGraph, runtimeRequirements, runtime, + runtimes, concatenationScope, codeGenerationResults, getData, type - }); + }); if (source) { sources.set(type, new CachedSource(source)); diff --git a/lib/NormalModuleFactory.js b/lib/NormalModuleFactory.js index a0d8b767f2f..9b28c778c38 100644 --- a/lib/NormalModuleFactory.js +++ b/lib/NormalModuleFactory.js @@ -411,8 +411,8 @@ class NormalModuleFactory extends ModuleFactory { noPreAutoLoaders || noPrePostAutoLoaders ? 2 : noAutoLoaders - ? 1 - : 0 + ? 1 + : 0 ) .split(/!+/); unresolvedResource = rawElements.pop(); @@ -676,7 +676,7 @@ class NormalModuleFactory extends ModuleFactory { resolveOptions || EMPTY_RESOLVE_OPTIONS, "dependencyType", dependencyType - ) + ) : resolveOptions ); this.resolveResource( @@ -1063,10 +1063,10 @@ If changing the source code is not an option there is also a resolve options cal const type = /\.mjs$/i.test(parsedResult.path) ? "module" : /\.cjs$/i.test(parsedResult.path) - ? "commonjs" - : resolveRequest.descriptionFileData === undefined - ? undefined - : resolveRequest.descriptionFileData.type; + ? "commonjs" + : resolveRequest.descriptionFileData === undefined + ? undefined + : resolveRequest.descriptionFileData.type; const resolved = { loader: parsedResult.path, diff --git a/lib/RuntimeTemplate.js b/lib/RuntimeTemplate.js index e4b6a141c7b..692ded112c5 100644 --- a/lib/RuntimeTemplate.js +++ b/lib/RuntimeTemplate.js @@ -102,6 +102,10 @@ class RuntimeTemplate { return this.outputOptions.environment.arrowFunction; } + supportsAsyncFunction() { + return this.outputOptions.environment.asyncFunction; + } + supportsOptionalChaining() { return this.outputOptions.environment.optionalChaining; } @@ -222,7 +226,7 @@ class RuntimeTemplate { ? `var [${items.join(", ")}] = ${value};` : Template.asString( items.map((item, i) => `var ${item} = ${value}[${i}];`) - ); + ); } destructureObject(items, value) { @@ -230,7 +234,7 @@ class RuntimeTemplate { ? `var {${items.join(", ")}} = ${value};` : Template.asString( items.map(item => `var ${item} = ${value}${propertyAccess([item])};`) - ); + ); } iife(args, body) { @@ -242,7 +246,7 @@ class RuntimeTemplate { ? `for(const ${variable} of ${array}) {\n${Template.indent(body)}\n}` : `${array}.forEach(function(${variable}) {\n${Template.indent( body - )}\n});`; + )}\n});`; } /** @@ -343,10 +347,10 @@ class RuntimeTemplate { moduleId === null ? JSON.stringify("Module is not available (weak dependency)") : idExpr - ? `"Module '" + ${idExpr} + "' is not available (weak dependency)"` - : JSON.stringify( - `Module '${moduleId}' is not available (weak dependency)` - ); + ? `"Module '" + ${idExpr} + "' is not available (weak dependency)"` + : JSON.stringify( + `Module '${moduleId}' is not available (weak dependency)` + ); const comment = request ? Template.toNormalComment(request) + " " : ""; const errorStatements = `var e = new Error(${errorMessage}); ` + @@ -840,8 +844,8 @@ class RuntimeTemplate { return asiSafe ? `(${importVar}_default()${propertyAccess(exportName, 1)})` : asiSafe === false - ? `;(${importVar}_default()${propertyAccess(exportName, 1)})` - : `${importVar}_default.a${propertyAccess(exportName, 1)}`; + ? `;(${importVar}_default()${propertyAccess(exportName, 1)})` + : `${importVar}_default.a${propertyAccess(exportName, 1)}`; } case "default-only": case "default-with-named": @@ -898,8 +902,8 @@ class RuntimeTemplate { return asiSafe ? `(0,${access})` : asiSafe === false - ? `;(0,${access})` - : `/*#__PURE__*/Object(${access})`; + ? `;(0,${access})` + : `/*#__PURE__*/Object(${access})`; } return access; } else { diff --git a/lib/SourceMapDevToolPlugin.js b/lib/SourceMapDevToolPlugin.js index 2bbad9ca88e..608fe302463 100644 --- a/lib/SourceMapDevToolPlugin.js +++ b/lib/SourceMapDevToolPlugin.js @@ -486,7 +486,7 @@ class SourceMapDevToolPlugin { outputFs, `/${options.fileContext}`, `/${filename}` - ) + ) : filename, contentHash: sourceMapContentHash }; @@ -501,7 +501,7 @@ class SourceMapDevToolPlugin { outputFs, dirname(outputFs, `/${file}`), `/${sourceMapFile}` - ); + ); /** @type {Source} */ let asset = new RawSource(source); if (currentSourceMappingURLComment !== false) { diff --git a/lib/Stats.js b/lib/Stats.js index 567683b7bd7..efb4d95ba7b 100644 --- a/lib/Stats.js +++ b/lib/Stats.js @@ -65,6 +65,10 @@ class Stats { }); } + /** + * @param {(string|StatsOptions)=} options stats options + * @returns {string} string output + */ toString(options) { options = this.compilation.createStatsOptions(options, { forToString: true diff --git a/lib/WebpackOptionsApply.js b/lib/WebpackOptionsApply.js index b5a4867de96..4ba16055767 100644 --- a/lib/WebpackOptionsApply.js +++ b/lib/WebpackOptionsApply.js @@ -307,7 +307,7 @@ class WebpackOptionsApply extends OptionsApply { if (options.experiments.css) { const CssModulesPlugin = require("./css/CssModulesPlugin"); - new CssModulesPlugin(options.experiments.css).apply(compiler); + new CssModulesPlugin().apply(compiler); } if (options.experiments.lazyCompilation) { @@ -329,7 +329,7 @@ class WebpackOptionsApply extends OptionsApply { options.externalsPresets.node ? "node" : "web" }.js` ) - }), + }), entries: !lazyOptions || lazyOptions.entries !== false, imports: !lazyOptions || lazyOptions.imports !== false, test: (lazyOptions && lazyOptions.test) || undefined @@ -588,7 +588,8 @@ class WebpackOptionsApply extends OptionsApply { const AddManagedPathsPlugin = require("./cache/AddManagedPathsPlugin"); new AddManagedPathsPlugin( options.snapshot.managedPaths, - options.snapshot.immutablePaths + options.snapshot.immutablePaths, + options.snapshot.unmanagedPaths ).apply(compiler); if (options.cache && typeof options.cache === "object") { diff --git a/lib/asset/AssetModulesPlugin.js b/lib/asset/AssetModulesPlugin.js index 9ab0157b6c9..f77fc82885b 100644 --- a/lib/asset/AssetModulesPlugin.js +++ b/lib/asset/AssetModulesPlugin.js @@ -208,9 +208,8 @@ class AssetModulesPlugin { codeGenResult.data.get("fullContentHash") }); } catch (e) { - /** @type {Error} */ ( - e - ).message += `\nduring rendering of asset ${module.identifier()}`; + /** @type {Error} */ (e).message += + `\nduring rendering of asset ${module.identifier()}`; throw e; } } diff --git a/lib/async-modules/AwaitDependenciesInitFragment.js b/lib/async-modules/AwaitDependenciesInitFragment.js index 2bec90769bd..7a991ab5aa4 100644 --- a/lib/async-modules/AwaitDependenciesInitFragment.js +++ b/lib/async-modules/AwaitDependenciesInitFragment.js @@ -42,8 +42,8 @@ class AwaitDependenciesInitFragment extends InitFragment { } /** - * @param {Context} context context - * @returns {string|Source} the source code that will be included as initialization code + * @param {GenerateContext} context context + * @returns {string | Source} the source code that will be included as initialization code */ getContent({ runtimeRequirements }) { runtimeRequirements.add(RuntimeGlobals.module); diff --git a/lib/buildChunkGraph.js b/lib/buildChunkGraph.js index a484b844997..3e2a673fb97 100644 --- a/lib/buildChunkGraph.js +++ b/lib/buildChunkGraph.js @@ -266,12 +266,18 @@ const visitModules = ( /** @type {Map} */ const blockChunkGroups = new Map(); + /** @type {Map} */ + const blockByChunkGroups = new Map(); + /** @type {Map} */ const namedChunkGroups = new Map(); /** @type {Map} */ const namedAsyncEntrypoints = new Map(); + /** @type {Set} */ + const outdatedOrderIndexChunkGroups = new Set(); + const ADD_AND_ENTER_ENTRY_MODULE = 0; const ADD_AND_ENTER_MODULE = 1; const ENTER_MODULE = 2; @@ -524,6 +530,7 @@ const visitModules = ( blockConnections.set(b, []); } blockChunkGroups.set(b, /** @type {ChunkGroupInfo} */ (cgi)); + blockByChunkGroups.set(cgi, b); } else if (entryOptions) { entrypoint = /** @type {Entrypoint} */ (cgi.chunkGroup); } else { @@ -1208,6 +1215,7 @@ const visitModules = ( chunkGroupsForCombining.add(cgi); } } + outdatedOrderIndexChunkGroups.add(info); } outdatedChunkGroupInfo.clear(); }; @@ -1254,6 +1262,51 @@ const visitModules = ( } } + for (const info of outdatedOrderIndexChunkGroups) { + const { chunkGroup, runtime } = info; + + const block = blockByChunkGroups.get(info); + + if (!block) { + continue; + } + + let preOrderIndex = 0; + let postOrderIndex = 0; + + const process = (current, visited = new Set()) => { + if (visited.has(current)) { + return; + } + + visited.add(current); + + const blockModules = getBlockModules(current, runtime); + if (blockModules === undefined) { + return; + } + + for (let i = 0; i < blockModules.length; i += 2) { + const refModule = /** @type {Module} */ (blockModules[i]); + const activeState = /** @type {ConnectionState} */ ( + blockModules[i + 1] + ); + if (activeState === false) { + continue; + } + + if (refModule) { + chunkGroup.setModulePreOrderIndex(refModule, preOrderIndex++); + process(refModule, visited); + chunkGroup.setModulePostOrderIndex(refModule, postOrderIndex++); + } + } + }; + + process(block); + } + outdatedOrderIndexChunkGroups.clear(); + logger.log( `${statProcessedQueueItems} queue items processed (${statProcessedBlocks} blocks)` ); diff --git a/lib/cache/AddManagedPathsPlugin.js b/lib/cache/AddManagedPathsPlugin.js index 702aa6c6b0b..d8e860f5272 100644 --- a/lib/cache/AddManagedPathsPlugin.js +++ b/lib/cache/AddManagedPathsPlugin.js @@ -11,10 +11,12 @@ class AddManagedPathsPlugin { /** * @param {Iterable} managedPaths list of managed paths * @param {Iterable} immutablePaths list of immutable paths + * @param {Iterable} unmanagedPaths list of unmanaged paths */ - constructor(managedPaths, immutablePaths) { + constructor(managedPaths, immutablePaths, unmanagedPaths) { this.managedPaths = new Set(managedPaths); this.immutablePaths = new Set(immutablePaths); + this.unmanagedPaths = new Set(unmanagedPaths); } /** @@ -29,6 +31,9 @@ class AddManagedPathsPlugin { for (const immutablePath of this.immutablePaths) { compiler.immutablePaths.add(immutablePath); } + for (const unmanagedPath of this.unmanagedPaths) { + compiler.unmanagedPaths.add(unmanagedPath); + } } } diff --git a/lib/cache/IdleFileCachePlugin.js b/lib/cache/IdleFileCachePlugin.js index 8a82644fe29..2f913331c61 100644 --- a/lib/cache/IdleFileCachePlugin.js +++ b/lib/cache/IdleFileCachePlugin.js @@ -199,11 +199,18 @@ class IdleFileCachePlugin { }s.` ); } - idleTimer = setTimeout(() => { - idleTimer = undefined; - isIdle = true; - resolvedPromise.then(processIdleTasks); - }, Math.min(isInitialStore ? idleTimeoutForInitialStore : Infinity, isLargeChange ? idleTimeoutAfterLargeChanges : Infinity, idleTimeout)); + idleTimer = setTimeout( + () => { + idleTimer = undefined; + isIdle = true; + resolvedPromise.then(processIdleTasks); + }, + Math.min( + isInitialStore ? idleTimeoutForInitialStore : Infinity, + isLargeChange ? idleTimeoutAfterLargeChanges : Infinity, + idleTimeout + ) + ); idleTimer.unref(); } ); diff --git a/lib/cache/PackFileCacheStrategy.js b/lib/cache/PackFileCacheStrategy.js index 3462e914c40..be0a6a56cb9 100644 --- a/lib/cache/PackFileCacheStrategy.js +++ b/lib/cache/PackFileCacheStrategy.js @@ -539,7 +539,7 @@ class Pack { map.set(identifier, content.content.get(identifier)); } return new PackContentItems(map); - }) + }) : undefined; } } @@ -1046,8 +1046,8 @@ class PackFileCacheStrategy { compression === "brotli" ? ".pack.br" : compression === "gzip" - ? ".pack.gz" - : ".pack"; + ? ".pack.gz" + : ".pack"; this.snapshot = snapshot; /** @type {Set} */ this.buildDependencies = new Set(); diff --git a/lib/cache/ResolverCachePlugin.js b/lib/cache/ResolverCachePlugin.js index 4659d617a3c..b402731d26c 100644 --- a/lib/cache/ResolverCachePlugin.js +++ b/lib/cache/ResolverCachePlugin.js @@ -264,7 +264,7 @@ class ResolverCachePlugin { yields = undefined; callbacks = false; } - } + } : (err, result) => { if (callbacks === undefined) { callback(err, result); @@ -276,7 +276,7 @@ class ResolverCachePlugin { activeRequests.delete(identifier); callbacks = false; } - }; + }; /** * @param {Error=} err error if any * @param {CacheEntry=} cacheEntry cache entry diff --git a/lib/config/browserslistTargetHandler.js b/lib/config/browserslistTargetHandler.js index 6a0e8a739cb..eba8459e05c 100644 --- a/lib/config/browserslistTargetHandler.js +++ b/lib/config/browserslistTargetHandler.js @@ -60,11 +60,11 @@ const load = (input, context) => { const config = query ? query : configPath - ? browserslist.loadConfig({ - config: configPath, - env - }) - : browserslist.loadConfig({ path: context, env }); + ? browserslist.loadConfig({ + config: configPath, + env + }) + : browserslist.loadConfig({ path: context, env }); if (!config) return; return browserslist(config); @@ -90,7 +90,9 @@ const resolve = browsers => { // safari TP supports all features for normal safari parsedVersion === "TP" ? [Infinity, Infinity] - : parsedVersion.split("."); + : parsedVersion.includes("-") + ? parsedVersion.split("-")[0].split(".") + : parsedVersion.split("."); if (typeof requiredVersion === "number") { return +parsedMajor >= requiredVersion; } @@ -118,8 +120,8 @@ const resolve = browsers => { samsung: [8, 2], android: 63, and_qq: [10, 4], - // baidu: Not supported - // and_uc: Not supported + baidu: [13, 18], + and_uc: [15, 5], kaios: [3, 0], node: [12, 17] }); @@ -144,7 +146,7 @@ const resolve = browsers => { android: 37, and_qq: [10, 4], // Supported correctly in strict mode, otherwise supported without block scope - // baidu: Not supported + baidu: [13, 18], and_uc: [12, 12], kaios: [2, 5], node: [6, 0] @@ -222,9 +224,9 @@ const resolve = browsers => { ios_saf: 14, samsung: [9, 2], android: 67, - // and_qq: Not supported - // baidu: Not supported - // and_uc: Not supported + and_qq: [13, 1], + baidu: [13, 18], + and_uc: [15, 5], kaios: [3, 0], node: [10, 4] }), @@ -244,8 +246,8 @@ const resolve = browsers => { samsung: [8, 0], android: 61, and_qq: [10, 4], - // baidu: Not supported - // and_uc: Not supported + baidu: [13, 18], + and_uc: [15, 5], kaios: [3, 0], node: [12, 17] }), @@ -310,6 +312,25 @@ const resolve = browsers => { kaios: [2, 5], node: 4 }), + asyncFunction: rawChecker({ + chrome: 55, + and_chr: 55, + edge: 15, + firefox: 52, + and_ff: 52, + // ie: Not supported, + opera: 42, + op_mob: 42, + safari: 11, + ios_saf: 11, + samsung: [6, 2], + android: 55, + and_qq: [13, 1], + baidu: [13, 18], + and_uc: [15, 5], + kaios: 3, + node: [7, 6] + }), browser: browserProperty, electron: false, node: nodeProperty, diff --git a/lib/config/defaults.js b/lib/config/defaults.js index 097e62ea0e0..2b8292e526c 100644 --- a/lib/config/defaults.js +++ b/lib/config/defaults.js @@ -29,7 +29,8 @@ const { /** @typedef {import("../../declarations/WebpackOptions").CacheOptionsNormalized} CacheOptions */ /** @typedef {import("../../declarations/WebpackOptions").Context} Context */ -/** @typedef {import("../../declarations/WebpackOptions").CssExperimentOptions} CssExperimentOptions */ +/** @typedef {import("../../declarations/WebpackOptions").CssGeneratorOptions} CssGeneratorOptions */ +/** @typedef {import("../../declarations/WebpackOptions").CssParserOptions} CssParserOptions */ /** @typedef {import("../../declarations/WebpackOptions").EntryDescription} EntryDescription */ /** @typedef {import("../../declarations/WebpackOptions").EntryNormalized} Entry */ /** @typedef {import("../../declarations/WebpackOptions").EntryStaticNormalized} EntryStaticNormalized */ @@ -39,6 +40,7 @@ const { /** @typedef {import("../../declarations/WebpackOptions").ExternalsPresets} ExternalsPresets */ /** @typedef {import("../../declarations/WebpackOptions").ExternalsType} ExternalsType */ /** @typedef {import("../../declarations/WebpackOptions").FileCacheOptions} FileCacheOptions */ +/** @typedef {import("../../declarations/WebpackOptions").GeneratorOptionsByModuleTypeKnown} GeneratorOptionsByModuleTypeKnown */ /** @typedef {import("../../declarations/WebpackOptions").InfrastructureLogging} InfrastructureLogging */ /** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../../declarations/WebpackOptions").Library} Library */ @@ -159,11 +161,11 @@ const applyWebpackOptionsDefaults = options => { target === false ? /** @type {false} */ (false) : typeof target === "string" - ? getTargetProperties(target, /** @type {Context} */ (options.context)) - : getTargetsProperties( - /** @type {string[]} */ (target), - /** @type {Context} */ (options.context) - ); + ? getTargetProperties(target, /** @type {Context} */ (options.context)) + : getTargetsProperties( + /** @type {string[]} */ (target), + /** @type {Context} */ (options.context) + ); const development = mode === "development"; const production = mode === "production" || !mode; @@ -223,7 +225,8 @@ const applyWebpackOptionsDefaults = options => { /** @type {NonNullable} */ (options.experiments.css), futureDefaults, - isNode: targetProperties && targetProperties.node === true + isNode: targetProperties && targetProperties.node === true, + targetProperties }); applyOutputDefaults(options.output, { @@ -260,14 +263,15 @@ const applyWebpackOptionsDefaults = options => { validExternalTypes.includes(options.output.library.type) ? /** @type {ExternalsType} */ (options.output.library.type) : options.output.module - ? "module" - : "var"; + ? "module" + : "var"; }); applyNodeDefaults(options.node, { futureDefaults: /** @type {NonNullable} */ (options.experiments.futureDefaults), + outputModule: options.output.module, targetProperties }); @@ -335,7 +339,7 @@ const applyExperimentsDefaults = ( D(experiments, "lazyCompilation", undefined); D(experiments, "buildHttp", undefined); D(experiments, "cacheUnaffected", experiments.futureDefaults); - F(experiments, "css", () => (experiments.futureDefaults ? {} : undefined)); + F(experiments, "css", () => (experiments.futureDefaults ? true : undefined)); // TODO webpack 6: remove this. topLevelAwait should be enabled by default let shouldEnableTopLevelAwait = true; @@ -348,14 +352,6 @@ const applyExperimentsDefaults = ( D(experiments.buildHttp, "frozen", production); D(experiments.buildHttp, "upgrade", false); } - - if (typeof experiments.css === "object") { - D( - experiments.css, - "exportsOnly", - !targetProperties || !targetProperties.document - ); - } }; /** @@ -448,7 +444,7 @@ const applySnapshotDefaults = (snapshot, { production, futureDefaults }) => { process.versions.pnp === "3" ? [ /^(.+?(?:[\\/]\.yarn[\\/]unplugged[\\/][^\\/]+)?[\\/]node_modules[\\/])/ - ] + ] : [/^(.+?[\\/]node_modules[\\/])/] ); F(snapshot, "immutablePaths", () => @@ -468,7 +464,6 @@ const applySnapshotDefaults = (snapshot, { production, futureDefaults }) => { } } else { const match = /^(.+?[\\/]node_modules[\\/])/.exec( - // eslint-disable-next-line node/no-extraneous-require require.resolve("watchpack") ); if (match) { @@ -477,6 +472,7 @@ const applySnapshotDefaults = (snapshot, { production, futureDefaults }) => { } return []; }); + F(snapshot, "unmanagedPaths", () => []); A(snapshot, "immutablePaths", () => { if (process.versions.pnp === "1") { const match = @@ -543,20 +539,46 @@ const applyJavascriptParserOptionsDefaults = ( if (futureDefaults) D(parserOptions, "exportsPresence", "error"); }; +/** + * @param {CssGeneratorOptions} generatorOptions generator options + * @param {Object} options options + * @param {TargetProperties | false} options.targetProperties target properties + * @returns {void} + */ +const applyCssGeneratorOptionsDefaults = ( + generatorOptions, + { targetProperties } +) => { + D( + generatorOptions, + "exportsOnly", + !targetProperties || !targetProperties.document + ); +}; + /** * @param {ModuleOptions} module options * @param {Object} options options * @param {boolean} options.cache is caching enabled * @param {boolean} options.syncWebAssembly is syncWebAssembly enabled * @param {boolean} options.asyncWebAssembly is asyncWebAssembly enabled - * @param {CssExperimentOptions|false} options.css is css enabled + * @param {boolean} options.css is css enabled * @param {boolean} options.futureDefaults is future defaults enabled * @param {boolean} options.isNode is node target platform + * @param {TargetProperties | false} options.targetProperties target properties * @returns {void} */ const applyModuleDefaults = ( module, - { cache, syncWebAssembly, asyncWebAssembly, css, futureDefaults, isNode } + { + cache, + syncWebAssembly, + asyncWebAssembly, + css, + futureDefaults, + isNode, + targetProperties + } ) => { if (cache) { D( @@ -607,6 +629,20 @@ const applyModuleDefaults = ( } ); + if (css) { + F(module.parser, "css", () => ({})); + + D(module.parser.css, "namedExports", true); + + F(module.generator, "css", () => ({})); + + applyCssGeneratorOptionsDefaults( + /** @type {NonNullable} */ + (module.generator.css), + { targetProperties } + ); + } + A(module, "defaultRules", () => { const esm = { type: JAVASCRIPT_MODULE_TYPE_ESM, @@ -818,9 +854,8 @@ const applyOutputDefaults = ( } catch (e) { if (/** @type {Error & { code: string }} */ (e).code !== "ENOENT") { /** @type {Error & { code: string }} */ - ( - e - ).message += `\nwhile determining default 'output.uniqueName' from 'name' in ${pkgPath}`; + (e).message += + `\nwhile determining default 'output.uniqueName' from 'name' in ${pkgPath}`; throw e; } return ""; @@ -870,22 +905,11 @@ const applyOutputDefaults = ( D(output, "webassemblyModuleFilename", "[hash].module.wasm"); D(output, "compareBeforeEmit", true); D(output, "charset", true); - F(output, "hotUpdateGlobal", () => - Template.toIdentifier( - "webpackHotUpdate" + - Template.toIdentifier( - /** @type {NonNullable} */ (output.uniqueName) - ) - ) - ); - F(output, "chunkLoadingGlobal", () => - Template.toIdentifier( - "webpackChunk" + - Template.toIdentifier( - /** @type {NonNullable} */ (output.uniqueName) - ) - ) + const uniqueNameId = Template.toIdentifier( + /** @type {NonNullable} */ (output.uniqueName) ); + F(output, "hotUpdateGlobal", () => "webpackHotUpdate" + uniqueNameId); + F(output, "chunkLoadingGlobal", () => "webpackChunk" + uniqueNameId); F(output, "globalObject", () => { if (tp) { if (tp.global) return "global"; @@ -1014,6 +1038,7 @@ const applyOutputDefaults = ( D(output, "hashFunction", futureDefaults ? "xxhash64" : "md4"); D(output, "hashDigest", "hex"); D(output, "hashDigestLength", futureDefaults ? 16 : 20); + D(output, "strictModuleErrorHandling", false); D(output, "strictModuleExceptionHandling", false); const environment = /** @type {Environment} */ (output.environment); @@ -1050,6 +1075,12 @@ const applyOutputDefaults = ( () => tp && optimistic(/** @type {boolean | undefined} */ (tp.arrowFunction)) ); + F( + environment, + "asyncFunction", + () => + tp && optimistic(/** @type {boolean | undefined} */ (tp.asyncFunction)) + ); F( environment, "forOf", @@ -1256,9 +1287,13 @@ const applyLoaderDefaults = (loader, { targetProperties, environment }) => { * @param {Object} options options * @param {TargetProperties | false} options.targetProperties target properties * @param {boolean} options.futureDefaults is future defaults enabled + * @param {boolean} options.outputModule is output type is module * @returns {void} */ -const applyNodeDefaults = (node, { futureDefaults, targetProperties }) => { +const applyNodeDefaults = ( + node, + { futureDefaults, outputModule, targetProperties } +) => { if (node === false) return; F(node, "global", () => { @@ -1266,16 +1301,16 @@ const applyNodeDefaults = (node, { futureDefaults, targetProperties }) => { // TODO webpack 6 should always default to false return futureDefaults ? "warn" : true; }); - F(node, "__filename", () => { - if (targetProperties && targetProperties.node) return "eval-only"; - // TODO webpack 6 should always default to false - return futureDefaults ? "warn-mock" : "mock"; - }); - F(node, "__dirname", () => { - if (targetProperties && targetProperties.node) return "eval-only"; + + const handlerForNames = () => { + if (targetProperties && targetProperties.node) + return outputModule ? "node-module" : "eval-only"; // TODO webpack 6 should always default to false return futureDefaults ? "warn-mock" : "mock"; - }); + }; + + F(node, "__filename", handlerForNames); + F(node, "__dirname", handlerForNames); }; /** @@ -1296,7 +1331,7 @@ const applyPerformanceDefaults = (performance, { production }) => { * @param {Object} options options * @param {boolean} options.production is production * @param {boolean} options.development is development - * @param {CssExperimentOptions|false} options.css is css enabled + * @param {boolean} options.css is css enabled * @param {boolean} options.records using records * @returns {void} */ @@ -1390,7 +1425,7 @@ const applyOptimizationDefaults = ( * @param {string} options.context build context * @param {TargetProperties | false} options.targetProperties target properties * @param {Mode} options.mode mode - * @param {CssExperimentOptions|false} options.css is css enabled + * @param {boolean} options.css is css enabled * @returns {ResolveOptions} resolve options */ const getResolveDefaults = ({ @@ -1481,7 +1516,8 @@ const getResolveDefaults = ({ mainFiles: [], mainFields: ["style", "..."], conditionNames: styleConditions, - extensions: [".css"] + extensions: [".css"], + preferRelative: true }; } diff --git a/lib/config/normalization.js b/lib/config/normalization.js index 0c5aceccf63..a1acda77f74 100644 --- a/lib/config/normalization.js +++ b/lib/config/normalization.js @@ -109,7 +109,7 @@ const keyedNestedConfig = (value, fn, customKeys) => { obj ), /** @type {Record} */ ({}) - ); + ); if (customKeys) { for (const key of Object.keys(customKeys)) { if (!(key in result)) { @@ -175,19 +175,20 @@ const getNormalizedWebpackOptions = config => { ), context: config.context, dependencies: config.dependencies, - devServer: optionalNestedConfig(config.devServer, devServer => ({ - ...devServer - })), + devServer: optionalNestedConfig(config.devServer, devServer => { + if (devServer === false) return false; + return { ...devServer }; + }), devtool: config.devtool, entry: config.entry === undefined ? { main: {} } : typeof config.entry === "function" - ? ( - fn => () => - Promise.resolve().then(fn).then(getNormalizedEntryStatic) - )(config.entry) - : getNormalizedEntryStatic(config.entry), + ? ( + fn => () => + Promise.resolve().then(fn).then(getNormalizedEntryStatic) + )(config.entry) + : getNormalizedEntryStatic(config.entry), experiments: nestedConfig(config.experiments, experiments => ({ ...experiments, buildHttp: optionalNestedConfig(experiments.buildHttp, options => @@ -196,9 +197,6 @@ const getNormalizedWebpackOptions = config => { lazyCompilation: optionalNestedConfig( experiments.lazyCompilation, options => (options === true ? {} : options) - ), - css: optionalNestedConfig(experiments.css, options => - options === true ? {} : options ) })), externals: /** @type {NonNullable} */ (config.externals), @@ -227,7 +225,7 @@ const getNormalizedWebpackOptions = config => { } return true; }; - }) + }) : undefined, infrastructureLogging: cloneObject(config.infrastructureLogging), loader: cloneObject(config.loader), @@ -292,7 +290,7 @@ const getNormalizedWebpackOptions = config => { ? handledDeprecatedNoEmitOnErrors( optimization.noEmitOnErrors, optimization.emitOnErrors - ) + ) : optimization.emitOnErrors }; }), @@ -306,10 +304,10 @@ const getNormalizedWebpackOptions = config => { "type" in library ? library : libraryAsName || output.libraryTarget - ? /** @type {LibraryOptions} */ ({ - name: libraryAsName - }) - : undefined; + ? /** @type {LibraryOptions} */ ({ + name: libraryAsName + }) + : undefined; /** @type {OutputNormalized} */ const result = { assetModuleFilename: output.assetModuleFilename, @@ -382,6 +380,7 @@ const getNormalizedWebpackOptions = config => { publicPath: output.publicPath, sourceMapFilename: output.sourceMapFilename, sourcePrefix: output.sourcePrefix, + strictModuleErrorHandling: output.strictModuleErrorHandling, strictModuleExceptionHandling: output.strictModuleExceptionHandling, trustedTypes: optionalNestedConfig( output.trustedTypes, diff --git a/lib/config/target.js b/lib/config/target.js index da026c329e3..eade455603e 100644 --- a/lib/config/target.js +++ b/lib/config/target.js @@ -61,6 +61,7 @@ const getDefaultTarget = context => { * @property {boolean | null} module ESM syntax is available (when in module) * @property {boolean | null} optionalChaining optional chaining is available * @property {boolean | null} templateLiteral template literal is available + * @property {boolean | null} asyncFunction async functions and await are available */ ///** @typedef {PlatformTargetProperties | ApiTargetProperties | EcmaTargetProperties | PlatformTargetProperties & ApiTargetProperties | PlatformTargetProperties & EcmaTargetProperties | ApiTargetProperties & EcmaTargetProperties} TargetProperties */ @@ -192,6 +193,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis templateLiteral: v(4), optionalChaining: v(14), arrowFunction: v(6), + asyncFunction: v(7, 6), forOf: v(5), destructuring: v(6), bigIntLiteral: v(10, 4), @@ -233,6 +235,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis templateLiteral: v(1, 1), optionalChaining: v(8), arrowFunction: v(1, 1), + asyncFunction: v(1, 7), forOf: v(0, 36), destructuring: v(1, 1), bigIntLiteral: v(4), @@ -270,6 +273,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis templateLiteral: v(0, 13), optionalChaining: v(0, 44), arrowFunction: v(0, 15), + asyncFunction: v(0, 21), forOf: v(0, 13), destructuring: v(0, 15), bigIntLiteral: v(0, 32), @@ -294,6 +298,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis forOf: v >= 2015, destructuring: v >= 2015, module: v >= 2015, + asyncFunction: v >= 2017, globalThis: v >= 2020, bigIntLiteral: v >= 2020, dynamicImport: v >= 2020, diff --git a/lib/container/ContainerReferencePlugin.js b/lib/container/ContainerReferencePlugin.js index f860fbac32e..59657c1ffd7 100644 --- a/lib/container/ContainerReferencePlugin.js +++ b/lib/container/ContainerReferencePlugin.js @@ -113,7 +113,7 @@ class ContainerReferencePlugin { ? external.slice(9) : `webpack/container/reference/${key}${ i ? `/fallback-${i}` : "" - }` + }` ), `.${data.request.slice(key.length)}`, config.shareScope diff --git a/lib/css/CssExportsGenerator.js b/lib/css/CssExportsGenerator.js index 0fc400e0fdd..26baa1817f2 100644 --- a/lib/css/CssExportsGenerator.js +++ b/lib/css/CssExportsGenerator.js @@ -47,6 +47,7 @@ class CssExportsGenerator extends Generator { generateContext.runtimeRequirements.add(RuntimeGlobals.module); + let chunkInitFragments; const runtimeRequirements = new Set(); const templateContext = { @@ -60,7 +61,19 @@ class CssExportsGenerator extends Generator { concatenationScope: generateContext.concatenationScope, codeGenerationResults: generateContext.codeGenerationResults, initFragments, - cssExports + cssExports, + get chunkInitFragments() { + if (!chunkInitFragments) { + const data = generateContext.getData(); + chunkInitFragments = data.get("chunkInitFragments"); + if (!chunkInitFragments) { + chunkInitFragments = []; + data.set("chunkInitFragments", chunkInitFragments); + } + } + + return chunkInitFragments; + } }; /** diff --git a/lib/css/CssGenerator.js b/lib/css/CssGenerator.js index e18c70b0f27..0be867771d1 100644 --- a/lib/css/CssGenerator.js +++ b/lib/css/CssGenerator.js @@ -38,6 +38,7 @@ class CssGenerator extends Generator { generateContext.runtimeRequirements.add(RuntimeGlobals.hasCssModules); + let chunkInitFragments; const templateContext = { runtimeTemplate: generateContext.runtimeTemplate, dependencyTemplates: generateContext.dependencyTemplates, @@ -49,7 +50,19 @@ class CssGenerator extends Generator { concatenationScope: generateContext.concatenationScope, codeGenerationResults: generateContext.codeGenerationResults, initFragments, - cssExports + cssExports, + get chunkInitFragments() { + if (!chunkInitFragments) { + const data = generateContext.getData(); + chunkInitFragments = data.get("chunkInitFragments"); + if (!chunkInitFragments) { + chunkInitFragments = []; + data.set("chunkInitFragments", chunkInitFragments); + } + } + + return chunkInitFragments; + } }; /** diff --git a/lib/css/CssLoadingRuntimeModule.js b/lib/css/CssLoadingRuntimeModule.js index a0b164f326e..3c8226bc4bb 100644 --- a/lib/css/CssLoadingRuntimeModule.js +++ b/lib/css/CssLoadingRuntimeModule.js @@ -129,7 +129,7 @@ class CssLoadingRuntimeModule extends RuntimeModule { `link.crossOrigin = ${JSON.stringify(crossOriginLoading)};` ), "}" - ]) + ]) : "" ]); @@ -141,7 +141,7 @@ class CssLoadingRuntimeModule extends RuntimeModule { { expr: "uniqueName" }, "-", { expr: "chunkId" } - ) + ) : runtimeTemplate.concatenation("--webpack-", { expr: "chunkId" }); return Template.asString([ @@ -158,7 +158,7 @@ class CssLoadingRuntimeModule extends RuntimeModule { uniqueName ? `var uniqueName = ${JSON.stringify( runtimeTemplate.outputOptions.uniqueName - )};` + )};` : "// data-webpack is not used as build has no uniqueName", `var loadCssChunkData = ${runtimeTemplate.basicFunction( "target, link, chunkId", @@ -210,10 +210,10 @@ class CssLoadingRuntimeModule extends RuntimeModule { { expr: "token" }, "-", { expr: "exports[x]" } - ) + ) : runtimeTemplate.concatenation({ expr: "token" }, "-", { expr: "exports[x]" - }) + }) }`, "x" )}); exportsWithDashes.forEach(${runtimeTemplate.expressionFunction( @@ -292,18 +292,18 @@ class CssLoadingRuntimeModule extends RuntimeModule { initialChunkIdsWithCss.size > 2 ? `${JSON.stringify( Array.from(initialChunkIdsWithCss) - )}.forEach(loadCssChunkData.bind(null, ${ + )}.forEach(loadCssChunkData.bind(null, ${ RuntimeGlobals.moduleFactories - }, 0));` + }, 0));` : initialChunkIdsWithCss.size > 0 - ? `${Array.from( - initialChunkIdsWithCss, - id => - `loadCssChunkData(${ - RuntimeGlobals.moduleFactories - }, 0, ${JSON.stringify(id)});` - ).join("")}` - : "// no initial css", + ? `${Array.from( + initialChunkIdsWithCss, + id => + `loadCssChunkData(${ + RuntimeGlobals.moduleFactories + }, 0, ${JSON.stringify(id)});` + ).join("")}` + : "// no initial css", "", withLoading ? Template.asString([ @@ -345,11 +345,11 @@ class CssLoadingRuntimeModule extends RuntimeModule { 'if(event.type !== "load") {', Template.indent([ "var errorType = event && event.type;", - "var realSrc = event && event.target && event.target.src;", - "error.message = 'Loading css chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';", + "var realHref = event && event.target && event.target.href;", + "error.message = 'Loading css chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realHref + ')';", "error.name = 'ChunkLoadError';", "error.type = errorType;", - "error.request = realSrc;", + "error.request = realHref;", "installedChunkData[1](error);" ]), "} else {", @@ -372,7 +372,7 @@ class CssLoadingRuntimeModule extends RuntimeModule { ]), "}" ])};` - ]) + ]) : "// no chunk loading", "", withHmr @@ -435,11 +435,11 @@ class CssLoadingRuntimeModule extends RuntimeModule { 'if(event.type !== "load") {', Template.indent([ "var errorType = event && event.type;", - "var realSrc = event && event.target && event.target.src;", - "error.message = 'Loading css hot update chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';", + "var realHref = event && event.target && event.target.href;", + "error.message = 'Loading css hot update chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realHref + ')';", "error.name = 'ChunkLoadError';", "error.type = errorType;", - "error.request = realSrc;", + "error.request = realHref;", "reject(error);" ]), "} else {", @@ -464,7 +464,7 @@ class CssLoadingRuntimeModule extends RuntimeModule { ])});` ] )}` - ]) + ]) : "// no hmr" ]); } diff --git a/lib/css/CssModulesPlugin.js b/lib/css/CssModulesPlugin.js index 103ea670eab..c967ad542e1 100644 --- a/lib/css/CssModulesPlugin.js +++ b/lib/css/CssModulesPlugin.js @@ -33,7 +33,6 @@ const CssGenerator = require("./CssGenerator"); const CssParser = require("./CssParser"); /** @typedef {import("webpack-sources").Source} Source */ -/** @typedef {import("../../declarations/WebpackOptions").CssExperimentOptions} CssExperimentOptions */ /** @typedef {import("../../declarations/WebpackOptions").Output} OutputOptions */ /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../ChunkGraph")} ChunkGraph */ @@ -59,22 +58,59 @@ const getSchema = name => { }; }; -const validateGeneratorOptions = createSchemaValidation( - require("../../schemas/plugins/css/CssGeneratorOptions.check.js"), - () => getSchema("CssGeneratorOptions"), - { - name: "Css Modules Plugin", - baseDataPath: "parser" - } -); -const validateParserOptions = createSchemaValidation( - require("../../schemas/plugins/css/CssParserOptions.check.js"), - () => getSchema("CssParserOptions"), - { - name: "Css Modules Plugin", - baseDataPath: "parser" - } -); +const generatorValidationOptions = { + name: "Css Modules Plugin", + baseDataPath: "generator" +}; +const validateGeneratorOptions = { + css: createSchemaValidation( + require("../../schemas/plugins/css/CssGeneratorOptions.check.js"), + () => getSchema("CssGeneratorOptions"), + generatorValidationOptions + ), + "css/auto": createSchemaValidation( + require("../../schemas/plugins/css/CssAutoGeneratorOptions.check.js"), + () => getSchema("CssAutoGeneratorOptions"), + generatorValidationOptions + ), + "css/module": createSchemaValidation( + require("../../schemas/plugins/css/CssModuleGeneratorOptions.check.js"), + () => getSchema("CssModuleGeneratorOptions"), + generatorValidationOptions + ), + "css/global": createSchemaValidation( + require("../../schemas/plugins/css/CssGlobalGeneratorOptions.check.js"), + () => getSchema("CssGlobalGeneratorOptions"), + generatorValidationOptions + ) +}; + +const parserValidationOptions = { + name: "Css Modules Plugin", + baseDataPath: "parser" +}; +const validateParserOptions = { + css: createSchemaValidation( + require("../../schemas/plugins/css/CssParserOptions.check.js"), + () => getSchema("CssParserOptions"), + parserValidationOptions + ), + "css/auto": createSchemaValidation( + require("../../schemas/plugins/css/CssAutoParserOptions.check.js"), + () => getSchema("CssAutoParserOptions"), + parserValidationOptions + ), + "css/module": createSchemaValidation( + require("../../schemas/plugins/css/CssModuleParserOptions.check.js"), + () => getSchema("CssModuleParserOptions"), + parserValidationOptions + ), + "css/global": createSchemaValidation( + require("../../schemas/plugins/css/CssGlobalParserOptions.check.js"), + () => getSchema("CssGlobalParserOptions"), + parserValidationOptions + ) +}; /** * @param {string} str string @@ -95,12 +131,6 @@ const escapeCss = (str, omitOptionalUnderscore) => { const plugin = "CssModulesPlugin"; class CssModulesPlugin { - /** - * @param {CssExperimentOptions} options options - */ - constructor({ exportsOnly = false }) { - this._exportsOnly = exportsOnly; - } /** * Apply the plugin * @param {Compiler} compiler the compiler instance @@ -156,27 +186,33 @@ class CssModulesPlugin { normalModuleFactory.hooks.createParser .for(type) .tap(plugin, parserOptions => { - validateParserOptions(parserOptions); + validateParserOptions[type](parserOptions); + const { namedExports } = parserOptions; switch (type) { case CSS_MODULE_TYPE: case CSS_MODULE_TYPE_AUTO: - return new CssParser(); + return new CssParser({ + namedExports + }); case CSS_MODULE_TYPE_GLOBAL: return new CssParser({ - allowModeSwitch: false + allowModeSwitch: false, + namedExports }); case CSS_MODULE_TYPE_MODULE: return new CssParser({ - defaultMode: "local" + defaultMode: "local", + namedExports }); } }); normalModuleFactory.hooks.createGenerator .for(type) .tap(plugin, generatorOptions => { - validateGeneratorOptions(generatorOptions); - return this._exportsOnly + validateGeneratorOptions[type](generatorOptions); + + return generatorOptions.exportsOnly ? new CssExportsGenerator() : new CssGenerator(); }); @@ -589,9 +625,9 @@ class CssModulesPlugin { return v === shortcutValue ? `${escapeCss(n)}/` : v === "--" + shortcutValue - ? `${escapeCss(n)}%` - : `${escapeCss(n)}(${escapeCss(v)})`; - }).join("") + ? `${escapeCss(n)}%` + : `${escapeCss(n)}(${escapeCss(v)})`; + }).join("") : "" }${escapeCss(moduleId)}` ); diff --git a/lib/css/CssParser.js b/lib/css/CssParser.js index 98a937d93a8..b4a92116b9c 100644 --- a/lib/css/CssParser.js +++ b/lib/css/CssParser.js @@ -131,10 +131,15 @@ const CSS_MODE_AT_IMPORT_INVALID = 3; const CSS_MODE_AT_NAMESPACE_INVALID = 4; class CssParser extends Parser { - constructor({ allowModeSwitch = true, defaultMode = "global" } = {}) { + constructor({ + allowModeSwitch = true, + defaultMode = "global", + namedExports = true + } = {}) { super(); this.allowModeSwitch = allowModeSwitch; this.defaultMode = defaultMode; + this.namedExports = namedExports; } /** @@ -911,7 +916,7 @@ class CssParser extends Parser { ) { modeData = balanced[balanced.length - 1] ? /** @type {"local" | "global"} */ - (balanced[balanced.length - 1][0]) + (balanced[balanced.length - 1][0]) : undefined; const dep = new ConstDependency("", [start, end]); module.addPresentationalDependency(dep); @@ -1024,7 +1029,7 @@ class CssParser extends Parser { } module.buildInfo.strict = true; - module.buildMeta.exportsType = "namespace"; + module.buildMeta.exportsType = this.namedExports ? "namespace" : "default"; module.addDependency(new StaticExportsDependency([], true)); return state; } diff --git a/lib/debug/ProfilingPlugin.js b/lib/debug/ProfilingPlugin.js index cc896fe2c8b..40b17aef8fe 100644 --- a/lib/debug/ProfilingPlugin.js +++ b/lib/debug/ProfilingPlugin.js @@ -31,7 +31,7 @@ const validate = createSchemaValidation( let inspector = undefined; try { - // eslint-disable-next-line node/no-unsupported-features/node-builtins + // eslint-disable-next-line n/no-unsupported-features/node-builtins inspector = require("inspector"); } catch (e) { console.log("Unable to CPU profile in < node 8.0"); @@ -374,7 +374,7 @@ const makeInterceptorFor = (instance, tracer) => hookName => ({ name, type, fn - }); + }); return { ...tapInfo, fn: newFn diff --git a/lib/dependencies/AMDDefineDependency.js b/lib/dependencies/AMDDefineDependency.js index 7421243a076..9f58ad084c3 100644 --- a/lib/dependencies/AMDDefineDependency.js +++ b/lib/dependencies/AMDDefineDependency.js @@ -108,10 +108,10 @@ const DEFINITIONS = { class AMDDefineDependency extends NullDependency { /** * @param {Range} range range - * @param {Range} arrayRange array range - * @param {Range} functionRange function range - * @param {Range} objectRange object range - * @param {boolean} namedModule true, when define is called with a name + * @param {Range | null} arrayRange array range + * @param {Range | null} functionRange function range + * @param {Range | null} objectRange object range + * @param {boolean | null} namedModule true, when define is called with a name */ constructor(range, arrayRange, functionRange, objectRange, namedModule) { super(); diff --git a/lib/dependencies/AMDDefineDependencyParserPlugin.js b/lib/dependencies/AMDDefineDependencyParserPlugin.js index 016fed69811..ed78fefd568 100644 --- a/lib/dependencies/AMDDefineDependencyParserPlugin.js +++ b/lib/dependencies/AMDDefineDependencyParserPlugin.js @@ -16,11 +16,20 @@ const DynamicExports = require("./DynamicExports"); const LocalModuleDependency = require("./LocalModuleDependency"); const { addLocalModule, getLocalModule } = require("./LocalModulesHelpers"); +/** @typedef {import("estree").ArrowFunctionExpression} ArrowFunctionExpression */ /** @typedef {import("estree").CallExpression} CallExpression */ +/** @typedef {import("estree").Expression} Expression */ +/** @typedef {import("estree").FunctionExpression} FunctionExpression */ +/** @typedef {import("estree").Literal} Literal */ +/** @typedef {import("estree").SpreadElement} SpreadElement */ +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("../javascript/BasicEvaluatedExpression")} BasicEvaluatedExpression */ /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ /** - * @param {CallExpression} expr expression + * @param {Expression | SpreadElement} expr expression * @returns {boolean} true if it's a bound function expression */ const isBoundFunctionExpression = expr => { @@ -33,12 +42,22 @@ const isBoundFunctionExpression = expr => { return true; }; +/** @typedef {FunctionExpression | ArrowFunctionExpression} UnboundFunctionExpression */ + +/** + * @param {Expression | SpreadElement} expr expression + * @returns {boolean} true when unbound function expression + */ const isUnboundFunctionExpression = expr => { if (expr.type === "FunctionExpression") return true; if (expr.type === "ArrowFunctionExpression") return true; return false; }; +/** + * @param {Expression | SpreadElement} expr expression + * @returns {boolean} true when callable + */ const isCallable = expr => { if (isUnboundFunctionExpression(expr)) return true; if (isBoundFunctionExpression(expr)) return true; @@ -46,6 +65,9 @@ const isCallable = expr => { }; class AMDDefineDependencyParserPlugin { + /** + * @param {JavascriptParserOptions} options parserOptions + */ constructor(options) { this.options = options; } @@ -63,12 +85,23 @@ class AMDDefineDependencyParserPlugin { ); } + /** + * @param {JavascriptParser} parser the parser + * @param {CallExpression} expr call expression + * @param {BasicEvaluatedExpression} param param + * @param {Record} identifiers identifiers + * @param {string=} namedModule named module + * @returns {boolean | undefined} result + */ processArray(parser, expr, param, identifiers, namedModule) { if (param.isArray()) { - param.items.forEach((param, idx) => { + /** @type {BasicEvaluatedExpression[]} */ + (param.items).forEach((param, idx) => { if ( param.isString() && - ["require", "module", "exports"].includes(param.string) + ["require", "module", "exports"].includes( + /** @type {string} */ (param.string) + ) ) identifiers[idx] = param.string; const result = this.processItem(parser, expr, param, namedModule); @@ -78,6 +111,7 @@ class AMDDefineDependencyParserPlugin { }); return true; } else if (param.isConstArray()) { + /** @type {(string | LocalModuleDependency | AMDRequireItemDependency)[]} */ const deps = []; param.array.forEach((request, idx) => { let dep; @@ -91,26 +125,38 @@ class AMDDefineDependencyParserPlugin { } else if ((localModule = getLocalModule(parser.state, request))) { localModule.flagUsed(); dep = new LocalModuleDependency(localModule, undefined, false); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); } else { dep = this.newRequireItemDependency(request); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.current.addDependency(dep); } deps.push(dep); }); - const dep = this.newRequireArrayDependency(deps, param.range); - dep.loc = expr.loc; + const dep = this.newRequireArrayDependency( + deps, + /** @type {Range} */ (param.range) + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.module.addPresentationalDependency(dep); return true; } } + + /** + * @param {JavascriptParser} parser the parser + * @param {CallExpression} expr call expression + * @param {BasicEvaluatedExpression} param param + * @param {string=} namedModule named module + * @returns {boolean} result + */ processItem(parser, expr, param, namedModule) { if (param.isConditional()) { - param.options.forEach(param => { + /** @type {BasicEvaluatedExpression[]} */ + (param.options).forEach(param => { const result = this.processItem(parser, expr, param); if (result === undefined) { this.processContext(parser, expr, param); @@ -120,19 +166,29 @@ class AMDDefineDependencyParserPlugin { } else if (param.isString()) { let dep, localModule; if (param.string === "require") { - dep = new ConstDependency(RuntimeGlobals.require, param.range, [ - RuntimeGlobals.require - ]); + dep = new ConstDependency( + RuntimeGlobals.require, + /** @type {Range} */ (param.range), + [RuntimeGlobals.require] + ); } else if (param.string === "exports") { - dep = new ConstDependency("exports", param.range, [ - RuntimeGlobals.exports - ]); + dep = new ConstDependency( + "exports", + /** @type {Range} */ (param.range), + [RuntimeGlobals.exports] + ); } else if (param.string === "module") { - dep = new ConstDependency("module", param.range, [ - RuntimeGlobals.module - ]); + dep = new ConstDependency( + "module", + /** @type {Range} */ (param.range), + [RuntimeGlobals.module] + ); } else if ( - (localModule = getLocalModule(parser.state, param.string, namedModule)) + (localModule = getLocalModule( + parser.state, + /** @type {string} */ (param.string), + namedModule + )) ) { localModule.flagUsed(); dep = new LocalModuleDependency(localModule, param.range, false); @@ -142,15 +198,22 @@ class AMDDefineDependencyParserPlugin { parser.state.current.addDependency(dep); return true; } - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; } } + + /** + * @param {JavascriptParser} parser the parser + * @param {CallExpression} expr call expression + * @param {BasicEvaluatedExpression} param param + * @returns {boolean | undefined} result + */ processContext(parser, expr, param) { const dep = ContextDependencyHelpers.create( AMDRequireContextDependency, - param.range, + /** @type {Range} */ (param.range), param, expr, this.options, @@ -160,12 +223,17 @@ class AMDDefineDependencyParserPlugin { parser ); if (!dep) return; - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.current.addDependency(dep); return true; } + /** + * @param {JavascriptParser} parser the parser + * @param {CallExpression} expr call expression + * @returns {boolean | undefined} result + */ processCallDefine(parser, expr) { let array, fn, obj, namedModule; switch (expr.arguments.length) { @@ -214,7 +282,7 @@ class AMDDefineDependencyParserPlugin { break; case 3: // define("…", […], f() {…}) - namedModule = expr.arguments[0].value; + namedModule = /** @type {TODO} */ (expr).arguments[0].value; array = expr.arguments[1]; if (isCallable(expr.arguments[2])) { // define("…", […], f() {}) @@ -236,10 +304,10 @@ class AMDDefineDependencyParserPlugin { let fnParamsOffset = 0; if (fn) { if (isUnboundFunctionExpression(fn)) { - fnParams = fn.params; + fnParams = /** @type {UnboundFunctionExpression} */ (fn).params; } else if (isBoundFunctionExpression(fn)) { - fnParams = fn.callee.object.params; - fnParamsOffset = fn.arguments.length - 1; + fnParams = /** @type {TODO} */ (fn).callee.object.params; + fnParamsOffset = /** @type {TODO} */ (fn).arguments.length - 1; if (fnParamsOffset < 0) { fnParamsOffset = 0; } @@ -247,6 +315,7 @@ class AMDDefineDependencyParserPlugin { } let fnRenames = new Map(); if (array) { + /** @type {Record} */ const identifiers = {}; const param = parser.evaluateExpression(array); const result = this.processArray( @@ -278,6 +347,7 @@ class AMDDefineDependencyParserPlugin { }); } } + /** @type {boolean | undefined} */ let inTry; if (fn && isUnboundFunctionExpression(fn)) { inTry = parser.scope.inTry; @@ -285,7 +355,7 @@ class AMDDefineDependencyParserPlugin { for (const [name, varInfo] of fnRenames) { parser.setVariable(name, varInfo); } - parser.scope.inTry = inTry; + parser.scope.inTry = /** @type {boolean} */ (inTry); if (fn.body.type === "BlockStatement") { parser.detectMode(fn.body.body); const prev = parser.prevStatement; @@ -299,7 +369,8 @@ class AMDDefineDependencyParserPlugin { } else if (fn && isBoundFunctionExpression(fn)) { inTry = parser.scope.inTry; parser.inScope( - fn.callee.object.params.filter( + /** @type {TODO} */ + (fn).callee.object.params.filter( i => !["require", "module", "exports"].includes(i.name) ), () => { @@ -318,21 +389,21 @@ class AMDDefineDependencyParserPlugin { } } ); - if (fn.arguments) { - parser.walkExpressions(fn.arguments); + if (/** @type {TODO} */ (fn).arguments) { + parser.walkExpressions(/** @type {TODO} */ (fn).arguments); } } else if (fn || obj) { parser.walkExpression(fn || obj); } const dep = this.newDefineDependency( - expr.range, - array ? array.range : null, - fn ? fn.range : null, - obj ? obj.range : null, + /** @type {Range} */ (expr.range), + array ? /** @type {Range} */ (array.range) : null, + fn ? /** @type {Range} */ (fn.range) : null, + obj ? /** @type {Range} */ (obj.range) : null, namedModule ? namedModule : null ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); if (namedModule) { dep.localModule = addLocalModule(parser.state, namedModule); } @@ -340,6 +411,14 @@ class AMDDefineDependencyParserPlugin { return true; } + /** + * @param {Range} range range + * @param {Range | null} arrayRange array range + * @param {Range | null} functionRange function range + * @param {Range | null} objectRange object range + * @param {boolean | null} namedModule true, when define is called with a name + * @returns {AMDDefineDependency} AMDDefineDependency + */ newDefineDependency( range, arrayRange, @@ -355,11 +434,24 @@ class AMDDefineDependencyParserPlugin { namedModule ); } + + /** + * @param {TODO[]} depsArray deps array + * @param {Range} range range + * @returns {AMDRequireArrayDependency} AMDRequireArrayDependency + */ newRequireArrayDependency(depsArray, range) { return new AMDRequireArrayDependency(depsArray, range); } + + /** + * @param {string} request request + * @param {Range=} range range + * @returns {AMDRequireItemDependency} AMDRequireItemDependency + */ newRequireItemDependency(request, range) { return new AMDRequireItemDependency(request, range); } } + module.exports = AMDDefineDependencyParserPlugin; diff --git a/lib/dependencies/AMDPlugin.js b/lib/dependencies/AMDPlugin.js index f9178162008..2ae03b78bc7 100644 --- a/lib/dependencies/AMDPlugin.js +++ b/lib/dependencies/AMDPlugin.js @@ -35,7 +35,9 @@ const UnsupportedDependency = require("./UnsupportedDependency"); /** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ /** @typedef {import("../../declarations/WebpackOptions").ModuleOptionsNormalized} ModuleOptions */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ /** @typedef {import("../javascript/JavascriptParser")} Parser */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ const PLUGIN_NAME = "AMDPlugin"; @@ -135,6 +137,11 @@ class AMDPlugin { const handler = (parser, parserOptions) => { if (parserOptions.amd !== undefined && !parserOptions.amd) return; + /** + * @param {string} optionExpr option expression + * @param {string} rootName root name + * @param {function(): TODO} getMembers callback + */ const tapOptionsHooks = (optionExpr, rootName, getMembers) => { parser.hooks.expression .for(optionExpr) @@ -177,10 +184,10 @@ class AMDPlugin { parser.hooks.expression.for("define").tap(PLUGIN_NAME, expr => { const dep = new ConstDependency( RuntimeGlobals.amdDefine, - expr.range, + /** @type {Range} */ (expr.range), [RuntimeGlobals.amdDefine] ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; }); @@ -197,10 +204,10 @@ class AMDPlugin { parser.hooks.rename.for("define").tap(PLUGIN_NAME, expr => { const dep = new ConstDependency( RuntimeGlobals.amdDefine, - expr.range, + /** @type {Range} */ (expr.range), [RuntimeGlobals.amdDefine] ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return false; }); diff --git a/lib/dependencies/AMDRequireArrayDependency.js b/lib/dependencies/AMDRequireArrayDependency.js index 96dc54bdf45..d37966be213 100644 --- a/lib/dependencies/AMDRequireArrayDependency.js +++ b/lib/dependencies/AMDRequireArrayDependency.js @@ -15,10 +15,12 @@ const NullDependency = require("./NullDependency"); /** @typedef {import("../javascript/JavascriptParser").Range} Range */ /** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ /** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ +/** @typedef {import("./AMDRequireItemDependency")} AMDRequireItemDependency */ +/** @typedef {import("./LocalModuleDependency")} LocalModuleDependency */ class AMDRequireArrayDependency extends NullDependency { /** - * @param {TODO} depsArray deps array + * @param {(string | LocalModuleDependency | AMDRequireItemDependency)[]} depsArray deps array * @param {Range} range range */ constructor(depsArray, range) { @@ -81,6 +83,11 @@ AMDRequireArrayDependency.Template = class AMDRequireArrayDependencyTemplate ext source.replace(dep.range[0], dep.range[1] - 1, content); } + /** + * @param {AMDRequireArrayDependency} dep the dependency for which the template should be applied + * @param {DependencyTemplateContext} templateContext the context object + * @returns {string} content + */ getContent(dep, templateContext) { const requires = dep.depsArray.map(dependency => { return this.contentForDependency(dependency, templateContext); @@ -88,6 +95,11 @@ AMDRequireArrayDependency.Template = class AMDRequireArrayDependencyTemplate ext return `[${requires.join(", ")}]`; } + /** + * @param {TODO} dep the dependency for which the template should be applied + * @param {DependencyTemplateContext} templateContext the context object + * @returns {string} content + */ contentForDependency( dep, { runtimeTemplate, moduleGraph, chunkGraph, runtimeRequirements } diff --git a/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js b/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js index 39ab56c5529..60cfe23a787 100644 --- a/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +++ b/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js @@ -19,13 +19,30 @@ const { getLocalModule } = require("./LocalModulesHelpers"); const UnsupportedDependency = require("./UnsupportedDependency"); const getFunctionExpression = require("./getFunctionExpression"); +/** @typedef {import("estree").CallExpression} CallExpression */ +/** @typedef {import("estree").Expression} Expression */ +/** @typedef {import("estree").SourceLocation} SourceLocation */ +/** @typedef {import("estree").SpreadElement} SpreadElement */ +/** @typedef {import("../../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ +/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */ +/** @typedef {import("../Module").BuildInfo} BuildInfo */ +/** @typedef {import("../javascript/BasicEvaluatedExpression")} BasicEvaluatedExpression */ /** @typedef {import("../javascript/JavascriptParser")} JavascriptParser */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ class AMDRequireDependenciesBlockParserPlugin { + /** + * @param {JavascriptParserOptions} options parserOptions + */ constructor(options) { this.options = options; } + /** + * @param {JavascriptParser} parser the parser + * @param {Expression | SpreadElement} expression expression + * @returns {boolean} need bind this + */ processFunctionArgument(parser, expression) { let bindThis = true; const fnData = getFunctionExpression(expression); @@ -65,9 +82,15 @@ class AMDRequireDependenciesBlockParserPlugin { ); } + /** + * @param {JavascriptParser} parser the parser + * @param {CallExpression} expr call expression + * @param {BasicEvaluatedExpression} param param + * @returns {boolean | undefined} result + */ processArray(parser, expr, param) { if (param.isArray()) { - for (const p of param.items) { + for (const p of /** @type {BasicEvaluatedExpression[]} */ (param.items)) { const result = this.processItem(parser, expr, p); if (result === undefined) { this.processContext(parser, expr, p); @@ -75,8 +98,9 @@ class AMDRequireDependenciesBlockParserPlugin { } return true; } else if (param.isConstArray()) { + /** @type {(string | LocalModuleDependency | AMDRequireItemDependency)[]} */ const deps = []; - for (const request of param.array) { + for (const request of /** @type {any[]} */ (param.array)) { let dep, localModule; if (request === "require") { dep = RuntimeGlobals.require; @@ -85,26 +109,38 @@ class AMDRequireDependenciesBlockParserPlugin { } else if ((localModule = getLocalModule(parser.state, request))) { localModule.flagUsed(); dep = new LocalModuleDependency(localModule, undefined, false); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); } else { dep = this.newRequireItemDependency(request); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.current.addDependency(dep); } deps.push(dep); } - const dep = this.newRequireArrayDependency(deps, param.range); - dep.loc = expr.loc; + const dep = this.newRequireArrayDependency( + deps, + /** @type {Range} */ (param.range) + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.module.addPresentationalDependency(dep); return true; } } + + /** + * @param {JavascriptParser} parser the parser + * @param {CallExpression} expr call expression + * @param {BasicEvaluatedExpression} param param + * @returns {boolean | undefined} result + */ processItem(parser, expr, param) { if (param.isConditional()) { - for (const p of param.options) { + for (const p of /** @type {BasicEvaluatedExpression[]} */ ( + param.options + )) { const result = this.processItem(parser, expr, p); if (result === undefined) { this.processContext(parser, expr, p); @@ -114,40 +150,59 @@ class AMDRequireDependenciesBlockParserPlugin { } else if (param.isString()) { let dep, localModule; if (param.string === "require") { - dep = new ConstDependency(RuntimeGlobals.require, param.string, [ - RuntimeGlobals.require - ]); + dep = new ConstDependency( + RuntimeGlobals.require, + /** @type {TODO} */ (param.string), + [RuntimeGlobals.require] + ); } else if (param.string === "module") { dep = new ConstDependency( - parser.state.module.buildInfo.moduleArgument, - param.range, + /** @type {BuildInfo} */ + (parser.state.module.buildInfo).moduleArgument, + /** @type {Range} */ (param.range), [RuntimeGlobals.module] ); } else if (param.string === "exports") { dep = new ConstDependency( - parser.state.module.buildInfo.exportsArgument, - param.range, + /** @type {BuildInfo} */ + (parser.state.module.buildInfo).exportsArgument, + /** @type {Range} */ (param.range), [RuntimeGlobals.exports] ); - } else if ((localModule = getLocalModule(parser.state, param.string))) { + } else if ( + (localModule = getLocalModule( + parser.state, + /** @type {string} */ (param.string) + )) + ) { localModule.flagUsed(); dep = new LocalModuleDependency(localModule, param.range, false); } else { - dep = this.newRequireItemDependency(param.string, param.range); - dep.loc = expr.loc; + dep = this.newRequireItemDependency( + /** @type {string} */ (param.string), + param.range + ); + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.current.addDependency(dep); return true; } - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); parser.state.module.addPresentationalDependency(dep); return true; } } + + /** + * @param {JavascriptParser} parser the parser + * @param {CallExpression} expr call expression + * @param {BasicEvaluatedExpression} param param + * @returns {boolean | undefined} result + */ processContext(parser, expr, param) { const dep = ContextDependencyHelpers.create( AMDRequireContextDependency, - param.range, + /** @type {Range} */ (param.range), param, expr, this.options, @@ -157,38 +212,55 @@ class AMDRequireDependenciesBlockParserPlugin { parser ); if (!dep) return; - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); dep.optional = !!parser.scope.inTry; parser.state.current.addDependency(dep); return true; } + /** + * @param {BasicEvaluatedExpression} param param + * @returns {string | undefined} result + */ processArrayForRequestString(param) { if (param.isArray()) { - const result = param.items.map(item => - this.processItemForRequestString(item) - ); + const result = + /** @type {BasicEvaluatedExpression[]} */ + (param.items).map(item => this.processItemForRequestString(item)); if (result.every(Boolean)) return result.join(" "); } else if (param.isConstArray()) { - return param.array.join(" "); + return /** @type {string[]} */ (param.array).join(" "); } } + /** + * @param {BasicEvaluatedExpression} param param + * @returns {string | undefined} result + */ processItemForRequestString(param) { if (param.isConditional()) { - const result = param.options.map(item => - this.processItemForRequestString(item) - ); + const result = + /** @type {BasicEvaluatedExpression[]} */ + (param.options).map(item => this.processItemForRequestString(item)); if (result.every(Boolean)) return result.join("|"); } else if (param.isString()) { return param.string; } } + /** + * @param {JavascriptParser} parser the parser + * @param {CallExpression} expr call expression + * @returns {boolean | undefined} result + */ processCallRequire(parser, expr) { + /** @type {BasicEvaluatedExpression | undefined} */ let param; + /** @type {AMDRequireDependenciesBlock | undefined | null} */ let depBlock; + /** @type {AMDRequireDependency | undefined} */ let dep; + /** @type {boolean | undefined} */ let result; const old = parser.state.current; @@ -196,57 +268,76 @@ class AMDRequireDependenciesBlockParserPlugin { if (expr.arguments.length >= 1) { param = parser.evaluateExpression(expr.arguments[0]); depBlock = this.newRequireDependenciesBlock( - expr.loc, - this.processArrayForRequestString(param) + /** @type {DependencyLocation} */ (expr.loc), + /** @type {string} */ (this.processArrayForRequestString(param)) ); dep = this.newRequireDependency( - expr.range, - param.range, - expr.arguments.length > 1 ? expr.arguments[1].range : null, - expr.arguments.length > 2 ? expr.arguments[2].range : null + /** @type {Range} */ (expr.range), + /** @type {Range} */ (param.range), + expr.arguments.length > 1 + ? /** @type {Range} */ (expr.arguments[1].range) + : null, + expr.arguments.length > 2 + ? /** @type {Range} */ (expr.arguments[2].range) + : null ); - dep.loc = expr.loc; + dep.loc = /** @type {DependencyLocation} */ (expr.loc); depBlock.addDependency(dep); - parser.state.current = depBlock; + parser.state.current = /** @type {TODO} */ (depBlock); } if (expr.arguments.length === 1) { parser.inScope([], () => { - result = this.processArray(parser, expr, param); + result = this.processArray( + parser, + expr, + /** @type {BasicEvaluatedExpression} */ (param) + ); }); parser.state.current = old; if (!result) return; - parser.state.current.addBlock(depBlock); + parser.state.current.addBlock( + /** @type {AMDRequireDependenciesBlock} */ (depBlock) + ); return true; } if (expr.arguments.length === 2 || expr.arguments.length === 3) { try { parser.inScope([], () => { - result = this.processArray(parser, expr, param); + result = this.processArray( + parser, + expr, + /** @type {BasicEvaluatedExpression} */ (param) + ); }); if (!result) { - const dep = new UnsupportedDependency("unsupported", expr.range); + const dep = new UnsupportedDependency( + "unsupported", + /** @type {Range} */ (expr.range) + ); old.addPresentationalDependency(dep); if (parser.state.module) { parser.state.module.addError( new UnsupportedFeatureWarning( "Cannot statically analyse 'require(…, …)' in line " + - expr.loc.start.line, - expr.loc + /** @type {SourceLocation} */ (expr.loc).start.line, + /** @type {DependencyLocation} */ (expr.loc) ) ); } depBlock = null; return true; } - dep.functionBindThis = this.processFunctionArgument( + /** @type {AMDRequireDependency} */ + (dep).functionBindThis = this.processFunctionArgument( parser, expr.arguments[1] ); if (expr.arguments.length === 3) { - dep.errorCallbackBindThis = this.processFunctionArgument( + /** @type {AMDRequireDependency} */ + (dep).errorCallbackBindThis = this.processFunctionArgument( parser, expr.arguments[2] ); @@ -259,9 +350,22 @@ class AMDRequireDependenciesBlockParserPlugin { } } + /** + * @param {DependencyLocation} loc location + * @param {string} request request + * @returns {AMDRequireDependenciesBlock} AMDRequireDependenciesBlock + */ newRequireDependenciesBlock(loc, request) { return new AMDRequireDependenciesBlock(loc, request); } + + /** + * @param {Range} outerRange outer range + * @param {Range} arrayRange array range + * @param {Range | null} functionRange function range + * @param {Range | null} errorCallbackRange error callback range + * @returns {AMDRequireDependency} dependency + */ newRequireDependency( outerRange, arrayRange, @@ -275,9 +379,21 @@ class AMDRequireDependenciesBlockParserPlugin { errorCallbackRange ); } + + /** + * @param {string} request request + * @param {Range=} range range + * @returns {AMDRequireItemDependency} AMDRequireItemDependency + */ newRequireItemDependency(request, range) { return new AMDRequireItemDependency(request, range); } + + /** + * @param {(string | LocalModuleDependency | AMDRequireItemDependency)[]} depsArray deps array + * @param {Range} range range + * @returns {AMDRequireArrayDependency} AMDRequireArrayDependency + */ newRequireArrayDependency(depsArray, range) { return new AMDRequireArrayDependency(depsArray, range); } diff --git a/lib/dependencies/AMDRequireDependency.js b/lib/dependencies/AMDRequireDependency.js index 8ec3ddb6843..930348fc948 100644 --- a/lib/dependencies/AMDRequireDependency.js +++ b/lib/dependencies/AMDRequireDependency.js @@ -21,8 +21,8 @@ class AMDRequireDependency extends NullDependency { /** * @param {Range} outerRange outer range * @param {Range} arrayRange array range - * @param {Range} functionRange function range - * @param {Range} errorCallbackRange error callback range + * @param {Range | null} functionRange function range + * @param {Range | null} errorCallbackRange error callback range */ constructor(outerRange, arrayRange, functionRange, errorCallbackRange) { super(); diff --git a/lib/dependencies/AMDRequireItemDependency.js b/lib/dependencies/AMDRequireItemDependency.js index 2218eba3e5d..614633ad324 100644 --- a/lib/dependencies/AMDRequireItemDependency.js +++ b/lib/dependencies/AMDRequireItemDependency.js @@ -14,7 +14,7 @@ const ModuleDependencyTemplateAsRequireId = require("./ModuleDependencyTemplateA class AMDRequireItemDependency extends ModuleDependency { /** * @param {string} request the request string - * @param {Range} range location in source code + * @param {Range=} range location in source code */ constructor(request, range) { super(request); diff --git a/lib/dependencies/CachedConstDependency.js b/lib/dependencies/CachedConstDependency.js index e02aa8af1ed..60826f5a859 100644 --- a/lib/dependencies/CachedConstDependency.js +++ b/lib/dependencies/CachedConstDependency.js @@ -38,6 +38,13 @@ class CachedConstDependency extends NullDependency { this._hashUpdate = undefined; } + /** + * @returns {string} hash update + */ + _createHashUpdate() { + return `${this.identifier}${this.range}${this.expression}`; + } + /** * Update the hash * @param {Hash} hash hash to be updated @@ -46,7 +53,7 @@ class CachedConstDependency extends NullDependency { */ updateHash(hash, context) { if (this._hashUpdate === undefined) - this._hashUpdate = "" + this.identifier + this.range + this.expression; + this._hashUpdate = this._createHashUpdate(); hash.update(this._hashUpdate); } diff --git a/lib/dependencies/CommonJsFullRequireDependency.js b/lib/dependencies/CommonJsFullRequireDependency.js index f8ceb13a46a..74f6c42de3b 100644 --- a/lib/dependencies/CommonJsFullRequireDependency.js +++ b/lib/dependencies/CommonJsFullRequireDependency.js @@ -7,6 +7,7 @@ const Template = require("../Template"); const { equals } = require("../util/ArrayHelpers"); +const { getTrimmedIdsAndRange } = require("../util/chainedImports"); const makeSerializable = require("../util/makeSerializable"); const propertyAccess = require("../util/propertyAccess"); const ModuleDependency = require("./ModuleDependency"); @@ -26,11 +27,18 @@ class CommonJsFullRequireDependency extends ModuleDependency { * @param {string} request the request string * @param {Range} range location in source code * @param {string[]} names accessed properties on module + * @param {Range[]=} idRanges ranges for members of ids; the two arrays are right-aligned */ - constructor(request, range, names) { + constructor( + request, + range, + names, + idRanges /* TODO webpack 6 make this non-optional. It must always be set to properly trim ids. */ + ) { super(request); this.range = range; this.names = names; + this.idRanges = idRanges; this.call = false; this.asiSafe = undefined; } @@ -60,6 +68,7 @@ class CommonJsFullRequireDependency extends ModuleDependency { serialize(context) { const { write } = context; write(this.names); + write(this.idRanges); write(this.call); write(this.asiSafe); super.serialize(context); @@ -71,6 +80,7 @@ class CommonJsFullRequireDependency extends ModuleDependency { deserialize(context) { const { read } = context; this.names = read(); + this.idRanges = read(); this.call = read(); this.asiSafe = read(); super.deserialize(context); @@ -117,15 +127,26 @@ CommonJsFullRequireDependency.Template = class CommonJsFullRequireDependencyTemp weak: dep.weak, runtimeRequirements }); + + const { + trimmedRange: [trimmedRangeStart, trimmedRangeEnd], + trimmedIds + } = getTrimmedIdsAndRange( + dep.names, + dep.range, + dep.idRanges, + moduleGraph, + dep + ); + if (importedModule) { - const ids = dep.names; const usedImported = moduleGraph .getExportsInfo(importedModule) - .getUsedName(ids, runtime); + .getUsedName(trimmedIds, runtime); if (usedImported) { - const comment = equals(usedImported, ids) + const comment = equals(usedImported, trimmedIds) ? "" - : Template.toNormalComment(propertyAccess(ids)) + " "; + : Template.toNormalComment(propertyAccess(trimmedIds)) + " "; const access = `${comment}${propertyAccess(usedImported)}`; requireExpr = dep.asiSafe === true @@ -133,7 +154,7 @@ CommonJsFullRequireDependency.Template = class CommonJsFullRequireDependencyTemp : `${requireExpr}${access}`; } } - source.replace(dep.range[0], dep.range[1] - 1, requireExpr); + source.replace(trimmedRangeStart, trimmedRangeEnd - 1, requireExpr); } }; diff --git a/lib/dependencies/CommonJsImportsParserPlugin.js b/lib/dependencies/CommonJsImportsParserPlugin.js index 93a6d2642a3..744405230c5 100644 --- a/lib/dependencies/CommonJsImportsParserPlugin.js +++ b/lib/dependencies/CommonJsImportsParserPlugin.js @@ -65,7 +65,7 @@ class CommonJsImportsParserPlugin { //#region metadata /** - * @param {TODO} expression expression + * @param {string} expression expression * @param {() => string[]} getMembers get members */ const tapRequireExpression = (expression, getMembers) => { @@ -379,9 +379,16 @@ class CommonJsImportsParserPlugin { * @param {string[]} calleeMembers callee members * @param {CallExpression} callExpr call expression * @param {string[]} members members + * @param {Range[]} memberRanges member ranges * @returns {boolean | void} true when handled */ - const chainHandler = (expr, calleeMembers, callExpr, members) => { + const chainHandler = ( + expr, + calleeMembers, + callExpr, + members, + memberRanges + ) => { if (callExpr.arguments.length !== 1) return; const param = parser.evaluateExpression(callExpr.arguments[0]); if ( @@ -391,7 +398,8 @@ class CommonJsImportsParserPlugin { const dep = new CommonJsFullRequireDependency( /** @type {string} */ (param.string), /** @type {Range} */ (expr.range), - members + members, + /** @type {Range[]} */ memberRanges ); dep.asiSafe = !parser.isAsiPosition( /** @type {Range} */ (expr.range)[0] @@ -407,9 +415,16 @@ class CommonJsImportsParserPlugin { * @param {string[]} calleeMembers callee members * @param {CallExpression} callExpr call expression * @param {string[]} members members + * @param {Range[]} memberRanges member ranges * @returns {boolean | void} true when handled */ - const callChainHandler = (expr, calleeMembers, callExpr, members) => { + const callChainHandler = ( + expr, + calleeMembers, + callExpr, + members, + memberRanges + ) => { if (callExpr.arguments.length !== 1) return; const param = parser.evaluateExpression(callExpr.arguments[0]); if ( @@ -419,7 +434,8 @@ class CommonJsImportsParserPlugin { const dep = new CommonJsFullRequireDependency( /** @type {string} */ (param.string), /** @type {Range} */ (expr.callee.range), - members + members, + /** @type {Range[]} */ memberRanges ); dep.call = true; dep.asiSafe = !parser.isAsiPosition( diff --git a/lib/dependencies/ContextElementDependency.js b/lib/dependencies/ContextElementDependency.js index 1ceaadb0431..cfdcbdcda07 100644 --- a/lib/dependencies/ContextElementDependency.js +++ b/lib/dependencies/ContextElementDependency.js @@ -66,7 +66,7 @@ class ContextElementDependency extends ModuleDependency { ? this.referencedExports.map(e => ({ name: e, canMangle: false - })) + })) : Dependency.EXPORTS_OBJECT_REFERENCED; } diff --git a/lib/dependencies/ExternalModuleDependency.js b/lib/dependencies/ExternalModuleDependency.js new file mode 100644 index 00000000000..4bd468690f6 --- /dev/null +++ b/lib/dependencies/ExternalModuleDependency.js @@ -0,0 +1,107 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const makeSerializable = require("../util/makeSerializable"); +const CachedConstDependency = require("./CachedConstDependency"); +const ExternalModuleInitFragment = require("./ExternalModuleInitFragment"); + +/** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ +/** @typedef {import("../Dependency")} Dependency */ +/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */ +/** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ +/** @typedef {import("../javascript/JavascriptModulesPlugin").ChunkRenderContext} ChunkRenderContext */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ +/** @typedef {import("../util/Hash")} Hash */ + +class ExternalModuleDependency extends CachedConstDependency { + /** + * @param {string} module module + * @param {{ name: string, value: string }[]} importSpecifiers import specifiers + * @param {string | undefined} defaultImport default import + * @param {string} expression expression + * @param {Range} range range + * @param {string} identifier identifier + */ + constructor( + module, + importSpecifiers, + defaultImport, + expression, + range, + identifier + ) { + super(expression, range, identifier); + + this.importedModule = module; + this.specifiers = importSpecifiers; + this.default = defaultImport; + } + + /** + * @returns {string} hash update + */ + _createHashUpdate() { + return `${this.importedModule}${JSON.stringify(this.specifiers)}${ + this.default || "null" + }${super._createHashUpdate()}`; + } + + /** + * @param {ObjectSerializerContext} context context + */ + serialize(context) { + super.serialize(context); + const { write } = context; + write(this.importedModule); + write(this.specifiers); + write(this.default); + } + + /** + * @param {ObjectDeserializerContext} context context + */ + deserialize(context) { + super.deserialize(context); + const { read } = context; + this.importedModule = read(); + this.specifiers = read(); + this.default = read(); + } +} + +makeSerializable( + ExternalModuleDependency, + "webpack/lib/dependencies/ExternalModuleDependency" +); + +ExternalModuleDependency.Template = class ExternalModuleDependencyTemplate extends ( + CachedConstDependency.Template +) { + /** + * @param {Dependency} dependency the dependency for which the template should be applied + * @param {ReplaceSource} source the current replace source which can be modified + * @param {DependencyTemplateContext} templateContext the context object + * @returns {void} + */ + apply(dependency, source, templateContext) { + super.apply(dependency, source, templateContext); + const dep = /** @type {ExternalModuleDependency} */ (dependency); + const { chunkInitFragments } = templateContext; + + chunkInitFragments.push( + new ExternalModuleInitFragment( + dep.importedModule, + dep.specifiers, + dep.default + ) + ); + } +}; + +module.exports = ExternalModuleDependency; diff --git a/lib/dependencies/ExternalModuleInitFragment.js b/lib/dependencies/ExternalModuleInitFragment.js new file mode 100644 index 00000000000..2b8ec4c9204 --- /dev/null +++ b/lib/dependencies/ExternalModuleInitFragment.js @@ -0,0 +1,131 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Ivan Kopeykin @vankop +*/ + +"use strict"; + +const InitFragment = require("../InitFragment"); +const makeSerializable = require("../util/makeSerializable"); + +/** @typedef {import("webpack-sources").Source} Source */ +/** @typedef {import("../Generator").GenerateContext} GenerateContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ +/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ +/** @typedef {Map>} ImportSpecifiers */ + +/** + * @extends {InitFragment} + */ +class ExternalModuleInitFragment extends InitFragment { + /** + * @param {string} importedModule imported module + * @param {Array<{ name: string, value?: string }>|ImportSpecifiers} specifiers import specifiers + * @param {string=} defaultImport default import + */ + constructor(importedModule, specifiers, defaultImport) { + super( + undefined, + InitFragment.STAGE_CONSTANTS, + 0, + `external module imports|${importedModule}|${defaultImport || "null"}` + ); + this.importedModule = importedModule; + if (Array.isArray(specifiers)) { + /** @type {ImportSpecifiers} */ + this.specifiers = new Map(); + for (const { name, value } of specifiers) { + let specifiers = this.specifiers.get(name); + if (!specifiers) { + specifiers = new Set(); + this.specifiers.set(name, specifiers); + } + specifiers.add(value || name); + } + } else { + this.specifiers = specifiers; + } + this.defaultImport = defaultImport; + } + + /** + * @param {ExternalModuleInitFragment} other other + * @returns {ExternalModuleInitFragment} ExternalModuleInitFragment + */ + merge(other) { + const newSpecifiersMap = new Map(this.specifiers); + for (const [name, specifiers] of other.specifiers) { + if (newSpecifiersMap.has(name)) { + const currentSpecifiers = newSpecifiersMap.get(name); + for (const spec of specifiers) currentSpecifiers.add(spec); + } else { + newSpecifiersMap.set(name, specifiers); + } + } + return new ExternalModuleInitFragment( + this.importedModule, + newSpecifiersMap, + this.defaultImport + ); + } + + /** + * @param {GenerateContext} context context + * @returns {string | Source} the source code that will be included as initialization code + */ + getContent({ runtimeRequirements }) { + const namedImports = []; + + for (const [name, specifiers] of this.specifiers) { + for (const spec of specifiers) { + if (spec === name) { + namedImports.push(name); + } else { + namedImports.push(`${name} as ${spec}`); + } + } + } + + let importsString = + namedImports.length > 0 ? `{${namedImports.join(",")}}` : ""; + + if (this.defaultImport) { + importsString = `${this.defaultImport}${ + importsString ? `, ${importsString}` : "" + }`; + } + + return `import ${importsString} from ${JSON.stringify( + this.importedModule + )};`; + } + + /** + * @param {ObjectSerializerContext} context context + */ + serialize(context) { + super.serialize(context); + const { write } = context; + write(this.importedModule); + write(this.specifiers); + write(this.defaultImport); + } + + /** + * @param {ObjectDeserializerContext} context context + */ + deserialize(context) { + super.deserialize(context); + const { read } = context; + this.importedModule = read(); + this.specifiers = read(); + this.defaultImport = read(); + } +} + +makeSerializable( + ExternalModuleInitFragment, + "webpack/lib/dependencies/ExternalModuleInitFragment" +); + +module.exports = ExternalModuleInitFragment; diff --git a/lib/dependencies/HarmonyAcceptDependency.js b/lib/dependencies/HarmonyAcceptDependency.js index 00a367d82c7..4817b722d7e 100644 --- a/lib/dependencies/HarmonyAcceptDependency.js +++ b/lib/dependencies/HarmonyAcceptDependency.js @@ -91,7 +91,7 @@ HarmonyAcceptDependency.Template = class HarmonyAcceptDependencyTemplate extends ? HarmonyImportDependency.Template.getImportEmittedRuntime( module, referencedModule - ) + ) : false }; }) diff --git a/lib/dependencies/HarmonyDetectionParserPlugin.js b/lib/dependencies/HarmonyDetectionParserPlugin.js index 0fbc7a660f1..4cf84fc1ec5 100644 --- a/lib/dependencies/HarmonyDetectionParserPlugin.js +++ b/lib/dependencies/HarmonyDetectionParserPlugin.js @@ -5,6 +5,7 @@ "use strict"; +const EnvironmentNotSupportAsyncWarning = require("../EnvironmentNotSupportAsyncWarning"); const { JAVASCRIPT_MODULE_TYPE_ESM } = require("../ModuleTypeConstants"); const DynamicExports = require("./DynamicExports"); const HarmonyCompatibilityDependency = require("./HarmonyCompatibilityDependency"); @@ -65,7 +66,7 @@ module.exports = class HarmonyDetectionParserPlugin { const module = parser.state.module; if (!this.topLevelAwait) { throw new Error( - "The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)" + "The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enable it)" ); } if (!HarmonyExports.isEnabled(parser.state)) { @@ -75,6 +76,11 @@ module.exports = class HarmonyDetectionParserPlugin { } /** @type {BuildMeta} */ (module.buildMeta).async = true; + EnvironmentNotSupportAsyncWarning.check( + module, + parser.state.compilation.runtimeTemplate, + "topLevelAwait" + ); }); /** diff --git a/lib/dependencies/HarmonyExportDependencyParserPlugin.js b/lib/dependencies/HarmonyExportDependencyParserPlugin.js index bec73a10452..e96af33a1fa 100644 --- a/lib/dependencies/HarmonyExportDependencyParserPlugin.js +++ b/lib/dependencies/HarmonyExportDependencyParserPlugin.js @@ -31,10 +31,10 @@ module.exports = class HarmonyExportDependencyParserPlugin { options.reexportExportsPresence !== undefined ? ExportPresenceModes.fromUserOption(options.reexportExportsPresence) : options.exportsPresence !== undefined - ? ExportPresenceModes.fromUserOption(options.exportsPresence) - : options.strictExportPresence - ? ExportPresenceModes.ERROR - : ExportPresenceModes.AUTO; + ? ExportPresenceModes.fromUserOption(options.exportsPresence) + : options.strictExportPresence + ? ExportPresenceModes.ERROR + : ExportPresenceModes.AUTO; } apply(parser) { @@ -97,20 +97,20 @@ module.exports = class HarmonyExportDependencyParserPlugin { expr.type.endsWith("Declaration") && expr.id ? expr.id.name : isFunctionDeclaration - ? { - id: expr.id ? expr.id.name : undefined, - range: [ - expr.range[0], - expr.params.length > 0 - ? expr.params[0].range[0] - : expr.body.range[0] - ], - prefix: `${expr.async ? "async " : ""}function${ - expr.generator ? "*" : "" - } `, - suffix: `(${expr.params.length > 0 ? "" : ") "}` - } - : undefined + ? { + id: expr.id ? expr.id.name : undefined, + range: [ + expr.range[0], + expr.params.length > 0 + ? expr.params[0].range[0] + : expr.body.range[0] + ], + prefix: `${expr.async ? "async " : ""}function${ + expr.generator ? "*" : "" + } `, + suffix: `(${expr.params.length > 0 ? "" : ") "}` + } + : undefined ); dep.loc = Object.create(statement.loc); dep.loc.index = -1; diff --git a/lib/dependencies/HarmonyExportInitFragment.js b/lib/dependencies/HarmonyExportInitFragment.js index d99137caabb..b69e9439939 100644 --- a/lib/dependencies/HarmonyExportInitFragment.js +++ b/lib/dependencies/HarmonyExportInitFragment.js @@ -130,8 +130,8 @@ class HarmonyExportInitFragment extends InitFragment { } /** - * @param {Context} context context - * @returns {string|Source} the source code that will be included as initialization code + * @param {GenerateContext} context context + * @returns {string | Source} the source code that will be included as initialization code */ getContent({ runtimeTemplate, runtimeRequirements }) { runtimeRequirements.add(RuntimeGlobals.exports); @@ -141,10 +141,10 @@ class HarmonyExportInitFragment extends InitFragment { this.unusedExports.size > 1 ? `/* unused harmony exports ${joinIterableWithComma( this.unusedExports - )} */\n` + )} */\n` : this.unusedExports.size > 0 - ? `/* unused harmony export ${first(this.unusedExports)} */\n` - : ""; + ? `/* unused harmony export ${first(this.unusedExports)} */\n` + : ""; const definitions = []; const orderedExportMap = Array.from(this.exportMap).sort(([a], [b]) => a < b ? -1 : 1 @@ -160,7 +160,7 @@ class HarmonyExportInitFragment extends InitFragment { this.exportMap.size > 0 ? `/* harmony export */ ${RuntimeGlobals.definePropertyGetters}(${ this.exportsArgument - }, {${definitions.join(",")}\n/* harmony export */ });\n` + }, {${definitions.join(",")}\n/* harmony export */ });\n` : ""; return `${definePart}${unusedPart}`; } diff --git a/lib/dependencies/HarmonyImportDependency.js b/lib/dependencies/HarmonyImportDependency.js index b4a65530610..2f9c17640af 100644 --- a/lib/dependencies/HarmonyImportDependency.js +++ b/lib/dependencies/HarmonyImportDependency.js @@ -157,8 +157,8 @@ class HarmonyImportDependency extends ModuleDependency { const moreInfo = !Array.isArray(providedExports) ? " (possible exports unknown)" : providedExports.length === 0 - ? " (module has no exports)" - : ` (possible exports: ${providedExports.join(", ")})`; + ? " (module has no exports)" + : ` (possible exports: ${providedExports.join(", ")})`; return [ new HarmonyLinkingError( `export ${ids @@ -287,8 +287,8 @@ HarmonyImportDependency.Template = class HarmonyImportDependencyTemplate extends const runtimeCondition = dep.weak ? false : connection - ? filterRuntime(runtime, r => connection.isTargetActive(r)) - : true; + ? filterRuntime(runtime, r => connection.isTargetActive(r)) + : true; if (module && referencedModule) { let emittedModules = importEmittedMap.get(module); diff --git a/lib/dependencies/HarmonyImportDependencyParserPlugin.js b/lib/dependencies/HarmonyImportDependencyParserPlugin.js index d0e195e0e94..f3b49d2436f 100644 --- a/lib/dependencies/HarmonyImportDependencyParserPlugin.js +++ b/lib/dependencies/HarmonyImportDependencyParserPlugin.js @@ -75,10 +75,10 @@ module.exports = class HarmonyImportDependencyParserPlugin { options.importExportsPresence !== undefined ? ExportPresenceModes.fromUserOption(options.importExportsPresence) : options.exportsPresence !== undefined - ? ExportPresenceModes.fromUserOption(options.exportsPresence) - : options.strictExportPresence - ? ExportPresenceModes.ERROR - : ExportPresenceModes.AUTO; + ? ExportPresenceModes.fromUserOption(options.exportsPresence) + : options.strictExportPresence + ? ExportPresenceModes.ERROR + : ExportPresenceModes.AUTO; this.strictThisContextOnImports = options.strictThisContextOnImports; } @@ -240,7 +240,7 @@ module.exports = class HarmonyImportDependencyParserPlugin { ? getNonOptionalMemberChain( expression, members.length - nonOptionalMembers.length - ) + ) : expression; const ids = settings.ids.concat(nonOptionalMembers); const dep = new HarmonyImportSpecifierDependency( @@ -286,7 +286,7 @@ module.exports = class HarmonyImportDependencyParserPlugin { ? getNonOptionalMemberChain( callee, members.length - nonOptionalMembers.length - ) + ) : callee; const ids = settings.ids.concat(nonOptionalMembers); const dep = new HarmonyImportSpecifierDependency( diff --git a/lib/dependencies/HarmonyImportSpecifierDependency.js b/lib/dependencies/HarmonyImportSpecifierDependency.js index 9de0f23bf86..ef922417b63 100644 --- a/lib/dependencies/HarmonyImportSpecifierDependency.js +++ b/lib/dependencies/HarmonyImportSpecifierDependency.js @@ -9,6 +9,7 @@ const Dependency = require("../Dependency"); const { getDependencyUsedByExportsCondition } = require("../optimize/InnerGraph"); +const { getTrimmedIdsAndRange } = require("../util/chainedImports"); const makeSerializable = require("../util/makeSerializable"); const propertyAccess = require("../util/propertyAccess"); const HarmonyImportDependency = require("./HarmonyImportDependency"); @@ -324,30 +325,16 @@ HarmonyImportSpecifierDependency.Template = class HarmonyImportSpecifierDependen // Skip rendering depending when dependency is conditional if (connection && !connection.isTargetActive(runtime)) return; - const ids = dep.getIds(moduleGraph); // determine minimal set of IDs. - let trimmedIds = this._trimIdsToThoseImported(ids, moduleGraph, dep); - - let [rangeStart, rangeEnd] = dep.range; - if (trimmedIds.length !== ids.length) { - // The array returned from dep.idRanges is right-aligned with the array returned from dep.getIds. - // Meaning, the two arrays may not always have the same number of elements, but the last element of - // dep.idRanges corresponds to [the expression fragment to the left of] the last element of dep.getIds. - // Use this to find the correct replacement range based on the number of ids that were trimmed. - const idx = - dep.idRanges === undefined - ? -1 /* trigger failure case below */ - : dep.idRanges.length + (trimmedIds.length - ids.length); - if (idx < 0 || idx >= dep.idRanges.length) { - // cspell:ignore minifiers - // Should not happen but we can't throw an error here because of backward compatibility with - // external plugins in wp5. Instead, we just disable trimming for now. This may break some minifiers. - trimmedIds = ids; - // TODO webpack 6 remove the "trimmedIds = ids" above and uncomment the following line instead. - // throw new Error("Missing range starts data for id replacement trimming."); - } else { - [rangeStart, rangeEnd] = dep.idRanges[idx]; - } - } + const { + trimmedRange: [trimmedRangeStart, trimmedRangeEnd], + trimmedIds + } = getTrimmedIdsAndRange( + dep.getIds(moduleGraph), + dep.range, + dep.idRanges, + moduleGraph, + dep + ); const exportExpr = this._getCodeForIds( dep, @@ -356,47 +343,10 @@ HarmonyImportSpecifierDependency.Template = class HarmonyImportSpecifierDependen trimmedIds ); if (dep.shorthand) { - source.insert(rangeEnd, `: ${exportExpr}`); + source.insert(trimmedRangeEnd, `: ${exportExpr}`); } else { - source.replace(rangeStart, rangeEnd - 1, exportExpr); - } - } - - /** - * @summary Determine which IDs in the id chain are actually referring to namespaces or imports, - * and which are deeper member accessors on the imported object. Only the former should be re-rendered. - * @param {string[]} ids ids - * @param {ModuleGraph} moduleGraph moduleGraph - * @param {HarmonyImportSpecifierDependency} dependency dependency - * @returns {string[]} generated code - */ - _trimIdsToThoseImported(ids, moduleGraph, dependency) { - /** @type {string[]} */ - let trimmedIds = []; - const exportsInfo = moduleGraph.getExportsInfo( - /** @type {Module} */ (moduleGraph.getModule(dependency)) - ); - let currentExportsInfo = /** @type {ExportsInfo=} */ exportsInfo; - for (let i = 0; i < ids.length; i++) { - if (i === 0 && ids[i] === "default") { - continue; // ExportInfo for the next level under default is still at the root ExportsInfo, so don't advance currentExportsInfo - } - const exportInfo = currentExportsInfo.getExportInfo(ids[i]); - if (exportInfo.provided === false) { - // json imports have nested ExportInfo for elements that things that are not actually exported, so check .provided - trimmedIds = ids.slice(0, i); - break; - } - const nestedInfo = exportInfo.getNestedExportsInfo(); - if (!nestedInfo) { - // once all nested exports are traversed, the next item is the actual import so stop there - trimmedIds = ids.slice(0, i + 1); - break; - } - currentExportsInfo = nestedInfo; + source.replace(trimmedRangeStart, trimmedRangeEnd - 1, exportExpr); } - // Never trim to nothing. This can happen for invalid imports (e.g. import { notThere } from "./module", or import { anything } from "./missingModule") - return trimmedIds.length ? trimmedIds : ids; } /** diff --git a/lib/dependencies/ImportDependency.js b/lib/dependencies/ImportDependency.js index a0eaffec32f..2e1b029041b 100644 --- a/lib/dependencies/ImportDependency.js +++ b/lib/dependencies/ImportDependency.js @@ -48,12 +48,32 @@ class ImportDependency extends ModuleDependency { * @returns {(string[] | ReferencedExport)[]} referenced exports */ getReferencedExports(moduleGraph, runtime) { - return this.referencedExports - ? this.referencedExports.map(e => ({ - name: e, - canMangle: false - })) - : Dependency.EXPORTS_OBJECT_REFERENCED; + if (!this.referencedExports) return Dependency.EXPORTS_OBJECT_REFERENCED; + const refs = []; + for (const referencedExport of this.referencedExports) { + if (referencedExport[0] === "default") { + const selfModule = moduleGraph.getParentModule(this); + const importedModule = + /** @type {Module} */ + (moduleGraph.getModule(this)); + const exportsType = importedModule.getExportsType( + moduleGraph, + /** @type {BuildMeta} */ + (selfModule.buildMeta).strictHarmonyModule + ); + if ( + exportsType === "default-only" || + exportsType === "default-with-named" + ) { + return Dependency.EXPORTS_OBJECT_REFERENCED; + } + } + refs.push({ + name: referencedExport, + canMangle: false + }); + } + return refs; } /** diff --git a/lib/dependencies/JsonExportsDependency.js b/lib/dependencies/JsonExportsDependency.js index fb38cc4fe3d..c688e00e74d 100644 --- a/lib/dependencies/JsonExportsDependency.js +++ b/lib/dependencies/JsonExportsDependency.js @@ -28,7 +28,7 @@ const getExportsFromData = data => { canMangle: true, exports: getExportsFromData(item) }; - }) + }) : undefined; } else { const exports = []; diff --git a/lib/dependencies/LoaderPlugin.js b/lib/dependencies/LoaderPlugin.js index 3132cfdffc2..f30c90c149a 100644 --- a/lib/dependencies/LoaderPlugin.js +++ b/lib/dependencies/LoaderPlugin.js @@ -185,7 +185,8 @@ class LoaderPlugin { issuerLayer: options.layer }, context: loaderContext.context, - connectOrigin: false + connectOrigin: false, + checkCycle: true }, err => { compilation.buildQueue.decreaseParallelism(); diff --git a/lib/dependencies/LocalModuleDependency.js b/lib/dependencies/LocalModuleDependency.js index 93aee8d21e4..2cde22fe145 100644 --- a/lib/dependencies/LocalModuleDependency.js +++ b/lib/dependencies/LocalModuleDependency.js @@ -19,7 +19,7 @@ const NullDependency = require("./NullDependency"); class LocalModuleDependency extends NullDependency { /** * @param {LocalModule} localModule local module - * @param {Range} range range + * @param {Range | undefined} range range * @param {boolean} callNew true, when the local module should be called with new */ constructor(localModule, range, callNew) { diff --git a/lib/dependencies/PureExpressionDependency.js b/lib/dependencies/PureExpressionDependency.js index 0b7372fe7f7..d56427d69ef 100644 --- a/lib/dependencies/PureExpressionDependency.js +++ b/lib/dependencies/PureExpressionDependency.js @@ -7,7 +7,7 @@ const { UsageState } = require("../ExportsInfo"); const makeSerializable = require("../util/makeSerializable"); -const { filterRuntime } = require("../util/runtime"); +const { filterRuntime, deepMergeRuntime } = require("../util/runtime"); const NullDependency = require("./NullDependency"); /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ @@ -93,7 +93,14 @@ PureExpressionDependency.Template = class PureExpressionDependencyTemplate exten apply( dependency, source, - { chunkGraph, moduleGraph, runtime, runtimeTemplate, runtimeRequirements } + { + chunkGraph, + moduleGraph, + runtime, + runtimes, + runtimeTemplate, + runtimeRequirements + } ) { const dep = /** @type {PureExpressionDependency} */ (dependency); @@ -101,7 +108,8 @@ PureExpressionDependency.Template = class PureExpressionDependencyTemplate exten if (usedByExports !== false) { const selfModule = moduleGraph.getParentModule(dep); const exportsInfo = moduleGraph.getExportsInfo(selfModule); - const runtimeCondition = filterRuntime(runtime, runtime => { + const merged = deepMergeRuntime(runtimes, runtime); + const runtimeCondition = filterRuntime(merged, runtime => { for (const exportName of usedByExports) { if (exportsInfo.getUsed(exportName, runtime) !== UsageState.Unused) { return true; @@ -113,7 +121,7 @@ PureExpressionDependency.Template = class PureExpressionDependencyTemplate exten if (runtimeCondition !== false) { const condition = runtimeTemplate.runtimeConditionExpression({ chunkGraph, - runtime, + runtime: merged, runtimeCondition, runtimeRequirements }); diff --git a/lib/dependencies/RequireIncludeDependency.js b/lib/dependencies/RequireIncludeDependency.js index f0ab47c1a20..3a25e84a8ff 100644 --- a/lib/dependencies/RequireIncludeDependency.js +++ b/lib/dependencies/RequireIncludeDependency.js @@ -69,7 +69,7 @@ RequireIncludeDependency.Template = class RequireIncludeDependencyTemplate exten `require.include ${runtimeTemplate.requestShortener.shorten( dep.request )}` - ) + ) : ""; source.replace(dep.range[0], dep.range[1] - 1, `undefined${comment}`); diff --git a/lib/dependencies/WebpackIsIncludedDependency.js b/lib/dependencies/WebpackIsIncludedDependency.js index ba41e4e162e..0b308734ee7 100644 --- a/lib/dependencies/WebpackIsIncludedDependency.js +++ b/lib/dependencies/WebpackIsIncludedDependency.js @@ -71,7 +71,7 @@ WebpackIsIncludedDependency.Template = class WebpackIsIncludedDependencyTemplate `__webpack_is_included__ ${runtimeTemplate.requestShortener.shorten( dep.request )}` - ) + ) : ""; source.replace( diff --git a/lib/dependencies/WorkerPlugin.js b/lib/dependencies/WorkerPlugin.js index cdbea3e56b8..d36d76d966f 100644 --- a/lib/dependencies/WorkerPlugin.js +++ b/lib/dependencies/WorkerPlugin.js @@ -184,8 +184,9 @@ class WorkerPlugin { } } const insertType = expr.properties.length > 0 ? "comma" : "single"; - const insertLocation = - expr.properties[expr.properties.length - 1].range[1]; + const insertLocation = /** @type {Range} */ ( + expr.properties[expr.properties.length - 1].range + )[1]; return { expressions, otherElements, @@ -240,7 +241,7 @@ class WorkerPlugin { insertLocation: arg2 ? /** @type {Range} */ (arg2.range) : /** @type {Range} */ (arg1.range)[1] - }; + }; const { options: importOptions, errors: commentErrors } = parser.parseCommentOptions(/** @type {Range} */ (expr.range)); @@ -429,6 +430,12 @@ class WorkerPlugin { const pattern = item.slice(1, firstDot); const itemMembers = item.slice(firstDot + 1, -2); + parser.hooks.preDeclarator.tap(PLUGIN_NAME, (decl, statement) => { + if (decl.id.type === "Identifier" && decl.id.name === pattern) { + parser.tagVariable(decl.id.name, WorkerSpecifierTag); + return true; + } + }); parser.hooks.pattern.for(pattern).tap(PLUGIN_NAME, pattern => { parser.tagVariable(pattern.name, WorkerSpecifierTag); return true; diff --git a/lib/dependencies/getFunctionExpression.js b/lib/dependencies/getFunctionExpression.js index f99123180e4..bb14cc66abc 100644 --- a/lib/dependencies/getFunctionExpression.js +++ b/lib/dependencies/getFunctionExpression.js @@ -9,8 +9,8 @@ /** @typedef {import("estree").SpreadElement} SpreadElement */ /** - * @param {Expression} expr expressions - * @returns {{fn: TODO, expressions: (Expression | SpreadElement)[], needThis: boolean | undefined }} function expression with additional information + * @param {Expression | SpreadElement} expr expressions + * @returns {{fn: TODO, expressions: (Expression | SpreadElement)[], needThis: boolean | undefined } | undefined} function expression with additional information */ module.exports = expr => { // diff --git a/lib/esm/ModuleChunkLoadingRuntimeModule.js b/lib/esm/ModuleChunkLoadingRuntimeModule.js index c29f0f50d26..5287e70f280 100644 --- a/lib/esm/ModuleChunkLoadingRuntimeModule.js +++ b/lib/esm/ModuleChunkLoadingRuntimeModule.js @@ -172,7 +172,7 @@ class ModuleChunkLoadingRuntimeModule extends RuntimeModule { ]), "}", withOnChunkLoad ? `${RuntimeGlobals.onChunksLoaded}();` : "" - ])}` + ])}` : "// no install chunk", "", withLoading @@ -222,25 +222,25 @@ class ModuleChunkLoadingRuntimeModule extends RuntimeModule { "}" ]), "}" - ]) + ]) : Template.indent(["installedChunks[chunkId] = 0;"]) )};` - ]) + ]) : "// no chunk on demand loading", "", withExternalInstallChunk ? Template.asString([ `${RuntimeGlobals.externalInstallChunk} = installChunk;` - ]) + ]) : "// no external install chunk", "", withOnChunkLoad ? `${ RuntimeGlobals.onChunksLoaded - }.j = ${runtimeTemplate.returningFunction( + }.j = ${runtimeTemplate.returningFunction( "installedChunks[chunkId] === 0", "chunkId" - )};` + )};` : "// no on chunks loaded" ]); } diff --git a/lib/hmr/HotModuleReplacement.runtime.js b/lib/hmr/HotModuleReplacement.runtime.js index 0ac94cbc5a7..a54aa0e628c 100644 --- a/lib/hmr/HotModuleReplacement.runtime.js +++ b/lib/hmr/HotModuleReplacement.runtime.js @@ -35,7 +35,6 @@ module.exports = function () { var currentUpdateApplyHandlers; var queuedInvalidatedModules; - // eslint-disable-next-line no-unused-vars $hmrModuleData$ = currentModuleData; $interceptModuleExecution$.push(function (options) { @@ -96,8 +95,8 @@ module.exports = function () { Object.defineProperty(fn, name, createPropertyDescriptor(name)); } } - fn.e = function (chunkId) { - return trackBlockingPromise(require.e(chunkId)); + fn.e = function (chunkId, fetchPriority) { + return trackBlockingPromise(require.e(chunkId, fetchPriority)); }; return fn; } @@ -289,8 +288,7 @@ module.exports = function () { updatedModules ); return promises; - }, - []) + }, []) ).then(function () { return waitForBlockingPromises(function () { if (applyOnUpdate) { diff --git a/lib/hmr/lazyCompilationBackend.js b/lib/hmr/lazyCompilationBackend.js index 3f480555998..dcc0130d136 100644 --- a/lib/hmr/lazyCompilationBackend.js +++ b/lib/hmr/lazyCompilationBackend.js @@ -37,7 +37,7 @@ module.exports = options => (compiler, callback) => { : (() => { const http = isHttps ? require("https") : require("http"); return http.createServer.bind(http, options.server); - })(); + })(); const listen = typeof options.listen === "function" ? options.listen @@ -46,7 +46,7 @@ module.exports = options => (compiler, callback) => { if (typeof listen === "object" && !("port" in listen)) listen = { ...listen, port: undefined }; server.listen(listen); - }; + }; const protocol = options.protocol || (isHttps ? "https" : "http"); @@ -109,8 +109,8 @@ module.exports = options => (compiler, callback) => { addr.address === "::" || addr.address === "0.0.0.0" ? `${protocol}://localhost:${addr.port}` : addr.family === "IPv6" - ? `${protocol}://[${addr.address}]:${addr.port}` - : `${protocol}://${addr.address}:${addr.port}`; + ? `${protocol}://[${addr.address}]:${addr.port}` + : `${protocol}://${addr.address}:${addr.port}`; logger.log( `Server-Sent-Events server for lazy compilation open at ${urlBase}.` ); diff --git a/lib/ids/DeterministicModuleIdsPlugin.js b/lib/ids/DeterministicModuleIdsPlugin.js index 6f19f66f24c..0cfd973ae56 100644 --- a/lib/ids/DeterministicModuleIdsPlugin.js +++ b/lib/ids/DeterministicModuleIdsPlugin.js @@ -66,7 +66,7 @@ class DeterministicModuleIdsPlugin { ? () => 0 : compareModulesByPreOrderIndexOrIdentifier( compilation.moduleGraph - ), + ), (module, id) => { const size = usedIds.size; usedIds.add(`${id}`); diff --git a/lib/index.js b/lib/index.js index d9255fce66c..8b9e828ecf2 100644 --- a/lib/index.js +++ b/lib/index.js @@ -37,6 +37,7 @@ const memoize = require("./util/memoize"); /** @typedef {import("./Compilation").EntryOptions} EntryOptions */ /** @typedef {import("./Compilation").PathData} PathData */ /** @typedef {import("./Compiler").AssetEmittedInfo} AssetEmittedInfo */ +/** @typedef {import("./MultiCompiler").MultiCompilerOptions} MultiCompilerOptions */ /** @typedef {import("./MultiStats")} MultiStats */ /** @typedef {import("./NormalModuleFactory").ResolveData} ResolveData */ /** @typedef {import("./Parser").ParserState} ParserState */ @@ -270,6 +271,9 @@ module.exports = mergeExports(fn, { get MultiCompiler() { return require("./MultiCompiler"); }, + get OptimizationStages() { + return require("./OptimizationStages"); + }, get Parser() { return require("./Parser"); }, diff --git a/lib/javascript/JavascriptGenerator.js b/lib/javascript/JavascriptGenerator.js index d13eb8a07f5..8b2242a13c5 100644 --- a/lib/javascript/JavascriptGenerator.js +++ b/lib/javascript/JavascriptGenerator.js @@ -190,6 +190,8 @@ class JavascriptGenerator extends Generator { ); } + let chunkInitFragments; + const templateContext = { runtimeTemplate: generateContext.runtimeTemplate, dependencyTemplates: generateContext.dependencyTemplates, @@ -197,10 +199,23 @@ class JavascriptGenerator extends Generator { chunkGraph: generateContext.chunkGraph, module, runtime: generateContext.runtime, + runtimes: generateContext.runtimes, runtimeRequirements: generateContext.runtimeRequirements, concatenationScope: generateContext.concatenationScope, codeGenerationResults: generateContext.codeGenerationResults, - initFragments + initFragments, + get chunkInitFragments() { + if (!chunkInitFragments) { + const data = generateContext.getData(); + chunkInitFragments = data.get("chunkInitFragments"); + if (!chunkInitFragments) { + chunkInitFragments = []; + data.set("chunkInitFragments", chunkInitFragments); + } + } + + return chunkInitFragments; + } }; template.apply(dependency, source, templateContext); diff --git a/lib/javascript/JavascriptModulesPlugin.js b/lib/javascript/JavascriptModulesPlugin.js index 6eb79e705eb..4249a2f5105 100644 --- a/lib/javascript/JavascriptModulesPlugin.js +++ b/lib/javascript/JavascriptModulesPlugin.js @@ -679,8 +679,8 @@ class JavascriptModulesPlugin { return strictHeader ? new ConcatSource(strictHeader, source, ";") : renderContext.runtimeTemplate.isModule() - ? source - : new ConcatSource(source, ";"); + ? source + : new ConcatSource(source, ";"); } /** @@ -751,7 +751,7 @@ class JavascriptModulesPlugin { inlinedModules ? allModules.filter( m => !(/** @type {Set} */ (inlinedModules).has(m)) - ) + ) : allModules, module => this.renderModule(module, chunkRenderContext, hooks, true), prefix @@ -837,14 +837,14 @@ class JavascriptModulesPlugin { let iife = innerStrict ? "it need to be in strict mode." : inlinedModules.size > 1 - ? // TODO check globals and top-level declarations of other entries and chunk modules - // to make a better decision - "it need to be isolated against other entry modules." - : chunkModules - ? "it need to be isolated against other modules in the chunk." - : exports && !webpackExports - ? `it uses a non-standard name for the exports (${m.exportsArgument}).` - : hooks.embedInRuntimeBailout.call(m, renderContext); + ? // TODO check globals and top-level declarations of other entries and chunk modules + // to make a better decision + "it need to be isolated against other entry modules." + : chunkModules + ? "it need to be isolated against other modules in the chunk." + : exports && !webpackExports + ? `it uses a non-standard name for the exports (${m.exportsArgument}).` + : hooks.embedInRuntimeBailout.call(m, renderContext); let footer; if (iife !== undefined) { startupSource.add( @@ -1310,14 +1310,14 @@ class JavascriptModulesPlugin { `${RuntimeGlobals.interceptModuleExecution}.forEach(function(handler) { handler(execOptions); });`, "module = execOptions.module;", "execOptions.factory.call(module.exports, module, module.exports, execOptions.require);" - ]) + ]) : runtimeRequirements.has(RuntimeGlobals.thisAsExports) - ? Template.asString([ - `__webpack_modules__[moduleId].call(module.exports, module, module.exports, ${RuntimeGlobals.require});` - ]) - : Template.asString([ - `__webpack_modules__[moduleId](module, module.exports, ${RuntimeGlobals.require});` - ]); + ? Template.asString([ + `__webpack_modules__[moduleId].call(module.exports, module, module.exports, ${RuntimeGlobals.require});` + ]) + : Template.asString([ + `__webpack_modules__[moduleId](module, module.exports, ${RuntimeGlobals.require});` + ]); const needModuleId = runtimeRequirements.has(RuntimeGlobals.moduleId); const needModuleLoaded = runtimeRequirements.has( RuntimeGlobals.moduleLoaded @@ -1330,7 +1330,7 @@ class JavascriptModulesPlugin { ? Template.indent([ "if (cachedModule.error !== undefined) throw cachedModule.error;", "return cachedModule.exports;" - ]) + ]) : Template.indent("return cachedModule.exports;"), "}", "// Create a new module (and put it into the cache)", @@ -1353,27 +1353,27 @@ class JavascriptModulesPlugin { "if(threw) delete __webpack_module_cache__[moduleId];" ]), "}" - ]) + ]) : outputOptions.strictModuleErrorHandling - ? Template.asString([ - "// Execute the module function", - "try {", - Template.indent(moduleExecution), - "} catch(e) {", - Template.indent(["module.error = e;", "throw e;"]), - "}" - ]) - : Template.asString([ - "// Execute the module function", - moduleExecution - ]), + ? Template.asString([ + "// Execute the module function", + "try {", + Template.indent(moduleExecution), + "} catch(e) {", + Template.indent(["module.error = e;", "throw e;"]), + "}" + ]) + : Template.asString([ + "// Execute the module function", + moduleExecution + ]), needModuleLoaded ? Template.asString([ "", "// Flag the module as loaded", `${RuntimeGlobals.moduleLoaded} = true;`, "" - ]) + ]) : "", "// Return the exports of the module", "return module.exports;" diff --git a/lib/javascript/JavascriptParser.js b/lib/javascript/JavascriptParser.js index 443547bfac7..5e7326f0828 100644 --- a/lib/javascript/JavascriptParser.js +++ b/lib/javascript/JavascriptParser.js @@ -93,7 +93,9 @@ const BasicEvaluatedExpression = require("./BasicEvaluatedExpression"); /** @typedef {import("../Parser").PreparsedAst} PreparsedAst */ /** @typedef {{declaredScope: ScopeInfo, freeName: string | true, tagInfo: TagInfo | undefined}} VariableInfoInterface */ /** @typedef {{ name: string | VariableInfo, rootInfo: string | VariableInfo, getMembers: () => string[], getMembersOptionals: () => boolean[], getMemberRanges: () => Range[] }} GetInfoResult */ +/** @typedef {Statement | ModuleDeclaration | Expression} StatementPathItem */ +/** @type {string[]} */ const EMPTY_ARRAY = []; const ALLOWED_MEMBER_TYPES_CALL_EXPRESSION = 0b01; const ALLOWED_MEMBER_TYPES_EXPRESSION = 0b10; @@ -363,25 +365,27 @@ class JavascriptParser extends Parser { ]) ), /** Something like "a.b().c.d" */ - /** @type {HookMap>} */ + /** @type {HookMap>} */ memberChainOfCallMemberChain: new HookMap( () => new SyncBailHook([ "expression", "calleeMembers", "callExpression", - "members" + "members", + "memberRanges" ]) ), /** Something like "a.b().c.d()"" */ - /** @type {HookMap>} */ + /** @type {HookMap>} */ callMemberChainOfCallMemberChain: new HookMap( () => new SyncBailHook([ "expression", "calleeMembers", "innerCallExpression", - "members" + "members", + "memberRanges" ]) ), /** @type {SyncBailHook<[ChainExpression], boolean | void>} */ @@ -420,15 +424,21 @@ class JavascriptParser extends Parser { this.scope = undefined; /** @type {ParserState} */ this.state = undefined; + /** @type {Comment[] | undefined} */ this.comments = undefined; + /** @type {Set | undefined} */ this.semicolons = undefined; - /** @type {(Statement | ModuleDeclaration | Expression)[]} */ + /** @type {StatementPathItem[]} */ this.statementPath = undefined; /** @type {Statement | ModuleDeclaration | Expression | undefined} */ this.prevStatement = undefined; - /** @type {WeakMap>} */ + /** @type {WeakMap> | undefined} */ this.destructuringAssignmentProperties = undefined; this.currentTagData = undefined; + this.magicCommentContext = vm.createContext(undefined, { + name: "Webpack Magic Comment Parser", + codeGeneration: { strings: false, wasm: false } + }); this._initializeEvaluating(); } @@ -535,34 +545,39 @@ class JavascriptParser extends Parser { let allowedRight; if (expr.operator === "&&") { const leftAsBool = left.asBool(); - if (leftAsBool === false) return left.setRange(expr.range); + if (leftAsBool === false) + return left.setRange(/** @type {Range} */ (expr.range)); returnRight = leftAsBool === true; allowedRight = false; } else if (expr.operator === "||") { const leftAsBool = left.asBool(); - if (leftAsBool === true) return left.setRange(expr.range); + if (leftAsBool === true) + return left.setRange(/** @type {Range} */ (expr.range)); returnRight = leftAsBool === false; allowedRight = true; } else if (expr.operator === "??") { const leftAsNullish = left.asNullish(); - if (leftAsNullish === false) return left.setRange(expr.range); + if (leftAsNullish === false) + return left.setRange(/** @type {Range} */ (expr.range)); if (leftAsNullish !== true) return; returnRight = true; } else return; const right = this.evaluateExpression(expr.right); if (returnRight) { if (left.couldHaveSideEffects()) right.setSideEffects(); - return right.setRange(expr.range); + return right.setRange(/** @type {Range} */ (expr.range)); } const asBool = right.asBool(); if (allowedRight === true && asBool === true) { return new BasicEvaluatedExpression() - .setRange(expr.range) + .setRange(/** @type {Range} */ (expr.range)) .setTruthy(); } else if (allowedRight === false && asBool === false) { - return new BasicEvaluatedExpression().setRange(expr.range).setFalsy(); + return new BasicEvaluatedExpression() + .setRange(/** @type {Range} */ (expr.range)) + .setFalsy(); } }); @@ -675,7 +690,18 @@ class JavascriptParser extends Parser { const isAlwaysDifferent = (a, b) => (a === true && b === false) || (a === false && b === true); + /** + * @param {BasicEvaluatedExpression} left left + * @param {BasicEvaluatedExpression} right right + * @param {BasicEvaluatedExpression} res res + * @param {boolean} eql true for "===" and false for "!==" + * @returns {BasicEvaluatedExpression | undefined} result + */ const handleTemplateStringCompare = (left, right, res, eql) => { + /** + * @param {BasicEvaluatedExpression[]} parts parts + * @returns {string} value + */ const getPrefix = parts => { let value = ""; for (const p of parts) { @@ -685,6 +711,10 @@ class JavascriptParser extends Parser { } return value; }; + /** + * @param {BasicEvaluatedExpression[]} parts parts + * @returns {string} value + */ const getSuffix = parts => { let value = ""; for (let i = parts.length - 1; i >= 0; i--) { @@ -694,10 +724,18 @@ class JavascriptParser extends Parser { } return value; }; - const leftPrefix = getPrefix(left.parts); - const rightPrefix = getPrefix(right.parts); - const leftSuffix = getSuffix(left.parts); - const rightSuffix = getSuffix(right.parts); + const leftPrefix = getPrefix( + /** @type {BasicEvaluatedExpression[]} */ (left.parts) + ); + const rightPrefix = getPrefix( + /** @type {BasicEvaluatedExpression[]} */ (right.parts) + ); + const leftSuffix = getSuffix( + /** @type {BasicEvaluatedExpression[]} */ (left.parts) + ); + const rightSuffix = getSuffix( + /** @type {BasicEvaluatedExpression[]} */ (right.parts) + ); const lenPrefix = Math.min(leftPrefix.length, rightPrefix.length); const lenSuffix = Math.min(leftSuffix.length, rightSuffix.length); const prefixMismatch = @@ -788,7 +826,7 @@ class JavascriptParser extends Parser { const left = this.evaluateExpression(expr.left); const right = this.evaluateExpression(expr.right); const res = new BasicEvaluatedExpression(); - res.setRange(expr.range); + res.setRange(/** @type {Range} */ (expr.range)); const leftConst = left.isCompileTimeValue(); const rightConst = right.isCompileTimeValue(); @@ -823,9 +861,12 @@ class JavascriptParser extends Parser { const res = new BasicEvaluatedExpression(); if (left.isString()) { if (right.isString()) { - res.setString(left.string + right.string); + res.setString( + /** @type {string} */ (left.string) + + /** @type {string} */ (right.string) + ); } else if (right.isNumber()) { - res.setString(left.string + right.number); + res.setString(/** @type {string} */ (left.string) + right.number); } else if ( right.isWrapped() && right.prefix && @@ -835,7 +876,10 @@ class JavascriptParser extends Parser { // => ("leftPrefix" + inner + "postfix") res.setWrapped( new BasicEvaluatedExpression() - .setString(left.string + right.prefix.string) + .setString( + /** @type {string} */ (left.string) + + /** @type {string} */ (right.prefix.string) + ) .setRange(joinRanges(left.range, right.prefix.range)), right.postfix, right.wrappedInnerExpressions @@ -855,7 +899,7 @@ class JavascriptParser extends Parser { } } else if (left.isNumber()) { if (right.isString()) { - res.setString(left.number + right.string); + res.setString(left.number + /** @type {string} */ (right.string)); } else if (right.isNumber()) { res.setNumber(left.number + right.number); } else { @@ -863,7 +907,10 @@ class JavascriptParser extends Parser { } } else if (left.isBigInt()) { if (right.isBigInt()) { - res.setBigInt(left.bigint + right.bigint); + res.setBigInt( + /** @type {bigint} */ (left.bigint) + + /** @type {bigint} */ (right.bigint) + ); } } else if (left.isWrapped()) { if (left.postfix && left.postfix.isString() && right.isString()) { @@ -872,8 +919,16 @@ class JavascriptParser extends Parser { res.setWrapped( left.prefix, new BasicEvaluatedExpression() - .setString(left.postfix.string + right.string) - .setRange(joinRanges(left.postfix.range, right.range)), + .setString( + /** @type {string} */ (left.postfix.string) + + /** @type {string} */ (right.string) + ) + .setRange( + joinRanges( + /** @type {Range} */ (left.postfix.range), + /** @type {Range} */ (right.range) + ) + ), left.wrappedInnerExpressions ); } else if ( @@ -886,8 +941,16 @@ class JavascriptParser extends Parser { res.setWrapped( left.prefix, new BasicEvaluatedExpression() - .setString(left.postfix.string + right.number) - .setRange(joinRanges(left.postfix.range, right.range)), + .setString( + /** @type {string} */ (left.postfix.string) + + /** @type {number} */ (right.number) + ) + .setRange( + joinRanges( + /** @type {Range} */ (left.postfix.range), + /** @type {Range} */ (right.range) + ) + ), left.wrappedInnerExpressions ); } else if (right.isString()) { @@ -901,7 +964,7 @@ class JavascriptParser extends Parser { left.prefix, new BasicEvaluatedExpression() .setString(right.number + "") - .setRange(right.range), + .setRange(/** @type {Range} */ (right.range)), left.wrappedInnerExpressions ); } else if (right.isWrapped()) { @@ -951,7 +1014,7 @@ class JavascriptParser extends Parser { } if (left.couldHaveSideEffects() || right.couldHaveSideEffects()) res.setSideEffects(); - res.setRange(expr.range); + res.setRange(/** @type {Range} */ (expr.range)); return res; } else if (expr.operator === "-") { return handleConstOperation((l, r) => l - r); @@ -1055,7 +1118,7 @@ class JavascriptParser extends Parser { case "FunctionExpression": { return new BasicEvaluatedExpression() .setString("function") - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } } const arg = this.evaluateExpression(expr.argument); @@ -1063,44 +1126,44 @@ class JavascriptParser extends Parser { if (arg.isString()) { return new BasicEvaluatedExpression() .setString("string") - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } if (arg.isWrapped()) { return new BasicEvaluatedExpression() .setString("string") .setSideEffects() - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } if (arg.isUndefined()) { return new BasicEvaluatedExpression() .setString("undefined") - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } if (arg.isNumber()) { return new BasicEvaluatedExpression() .setString("number") - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } if (arg.isBigInt()) { return new BasicEvaluatedExpression() .setString("bigint") - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } if (arg.isBoolean()) { return new BasicEvaluatedExpression() .setString("boolean") - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } if (arg.isConstArray() || arg.isRegExp() || arg.isNull()) { return new BasicEvaluatedExpression() .setString("object") - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } if (arg.isArray()) { return new BasicEvaluatedExpression() .setString("object") .setSideEffects(arg.couldHaveSideEffects()) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } } else if (expr.operator === "!") { const argument = this.evaluateExpression(expr.argument); @@ -1109,7 +1172,7 @@ class JavascriptParser extends Parser { return new BasicEvaluatedExpression() .setBoolean(!bool) .setSideEffects(argument.couldHaveSideEffects()) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } else if (expr.operator === "~") { return handleConstOperation(v => ~v); } else if (expr.operator === "+") { @@ -1121,13 +1184,13 @@ class JavascriptParser extends Parser { this.hooks.evaluateTypeof.for("undefined").tap("JavascriptParser", expr => { return new BasicEvaluatedExpression() .setString("undefined") - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); }); this.hooks.evaluate.for("Identifier").tap("JavascriptParser", expr => { if (/** @type {Identifier} */ (expr).name === "undefined") { return new BasicEvaluatedExpression() .setUndefined() - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } }); /** @@ -1175,7 +1238,7 @@ class JavascriptParser extends Parser { info.getMembersOptionals, info.getMemberRanges ) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } }); this.hooks.finish.tap("JavascriptParser", () => { @@ -1272,14 +1335,17 @@ class JavascriptParser extends Parser { if (arg2.type === "SpreadElement") return; const arg2Eval = this.evaluateExpression(arg2); if (!arg2Eval.isNumber()) return; - result = param.string.indexOf(arg1Value, arg2Eval.number); + result = /** @type {string} */ (param.string).indexOf( + arg1Value, + arg2Eval.number + ); } else { - result = param.string.indexOf(arg1Value); + result = /** @type {string} */ (param.string).indexOf(arg1Value); } return new BasicEvaluatedExpression() .setNumber(result) .setSideEffects(param.couldHaveSideEffects()) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); }); this.hooks.evaluateCallExpressionMember .for("replace") @@ -1295,9 +1361,11 @@ class JavascriptParser extends Parser { if (!arg2.isString()) return; const arg2Value = arg2.string; return new BasicEvaluatedExpression() - .setString(param.string.replace(arg1Value, arg2Value)) + .setString( + /** @type {string} */ (param.string).replace(arg1Value, arg2Value) + ) .setSideEffects(param.couldHaveSideEffects()) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); }); ["substr", "substring", "slice"].forEach(fn => { this.hooks.evaluateCallExpressionMember @@ -1306,7 +1374,7 @@ class JavascriptParser extends Parser { if (!param.isString()) return; let arg1; let result, - str = param.string; + str = /** @type {string} */ (param.string); switch (expr.arguments.length) { case 1: if (expr.arguments[0].type === "SpreadElement") return; @@ -1330,7 +1398,7 @@ class JavascriptParser extends Parser { return new BasicEvaluatedExpression() .setString(result) .setSideEffects(param.couldHaveSideEffects()) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); }); }); @@ -1363,7 +1431,10 @@ class JavascriptParser extends Parser { // is a const string prevExpr.setString(prevExpr.string + exprAsString + quasi); - prevExpr.setRange([prevExpr.range[0], quasiExpr.range[1]]); + prevExpr.setRange([ + /** @type {Range} */ (prevExpr.range)[0], + /** @type {Range} */ (quasiExpr.range)[1] + ]); // We unset the expression as it doesn't match to a single expression prevExpr.setExpression(undefined); continue; @@ -1435,14 +1506,16 @@ class JavascriptParser extends Parser { continue; } + /** @type {string} */ const value = argExpr.isString() - ? argExpr.string - : "" + argExpr.number; + ? /** @type {string} */ (argExpr.string) + : "" + /** @type {number} */ (argExpr.number); + /** @type {string} */ const newString = value + (stringSuffix ? stringSuffix.string : ""); const newRange = /** @type {Range} */ ([ - argExpr.range[0], - (stringSuffix || argExpr).range[1] + /** @type {Range} */ (argExpr.range)[0], + /** @type {Range} */ ((stringSuffix || argExpr).range)[1] ]); stringSuffix = new BasicEvaluatedExpression() .setString(newString) @@ -1461,7 +1534,7 @@ class JavascriptParser extends Parser { : innerExpressions.reverse(); return new BasicEvaluatedExpression() .setWrapped(prefix, stringSuffix, inner) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } else if (param.isWrapped()) { const postfix = stringSuffix || param.postfix; const inner = param.wrappedInnerExpressions @@ -1469,17 +1542,18 @@ class JavascriptParser extends Parser { : innerExpressions.reverse(); return new BasicEvaluatedExpression() .setWrapped(param.prefix, postfix, inner) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } else { const newString = - param.string + (stringSuffix ? stringSuffix.string : ""); + /** @type {string} */ (param.string) + + (stringSuffix ? stringSuffix.string : ""); return new BasicEvaluatedExpression() .setString(newString) .setSideEffects( (stringSuffix && stringSuffix.couldHaveSideEffects()) || param.couldHaveSideEffects() ) - .setRange(expr.range); + .setRange(/** @type {Range} */ (expr.range)); } }); this.hooks.evaluateCallExpressionMember @@ -1491,9 +1565,11 @@ class JavascriptParser extends Parser { let result; const arg = this.evaluateExpression(expr.arguments[0]); if (arg.isString()) { - result = param.string.split(arg.string); + result = + /** @type {string} */ + (param.string).split(/** @type {string} */ (arg.string)); } else if (arg.isRegExp()) { - result = param.string.split(arg.regExp); + result = /** @type {string} */ (param.string).split(arg.regExp); } else { return; } @@ -2282,6 +2358,10 @@ class JavascriptParser extends Parser { } } + /** + * @param {Declaration} declaration declaration + * @param {TODO} onIdent on ident callback + */ enterDeclaration(declaration, onIdent) { switch (declaration.type) { case "VariableDeclaration": @@ -2538,10 +2618,16 @@ class JavascriptParser extends Parser { declarator.init && this.getRenameIdentifier(declarator.init); if (renameIdentifier && declarator.id.type === "Identifier") { const hook = this.hooks.canRename.get(renameIdentifier); - if (hook !== undefined && hook.call(declarator.init)) { + if ( + hook !== undefined && + hook.call(/** @type {Expression} */ (declarator.init)) + ) { // renaming with "var a = b;" const hook = this.hooks.rename.get(renameIdentifier); - if (hook === undefined || !hook.call(declarator.init)) { + if ( + hook === undefined || + !hook.call(/** @type {Expression} */ (declarator.init)) + ) { this.setVariable(declarator.id.name, renameIdentifier); } break; @@ -2926,7 +3012,7 @@ class JavascriptParser extends Parser { (currentStatement.type === "ExpressionStatement" && currentStatement.expression === expression) ) { - const old = this.statementPath.pop(); + const old = /** @type {StatementPathItem} */ (this.statementPath.pop()); for (const expr of expression.expressions) { this.statementPath.push(expr); this.walkExpression(expr); @@ -3274,7 +3360,8 @@ class JavascriptParser extends Parser { expression, exprInfo.getCalleeMembers(), exprInfo.call, - exprInfo.getMembers() + exprInfo.getMembers(), + exprInfo.getMemberRanges() ); if (result === true) return; } @@ -3365,7 +3452,8 @@ class JavascriptParser extends Parser { expression, exprInfo.getCalleeMembers(), exprInfo.call, - exprInfo.getMembers() + exprInfo.getMembers(), + exprInfo.getMemberRanges() ); if (result === true) return; // Fast skip over the member chain as we already called memberChainOfCallMemberChain @@ -3379,6 +3467,13 @@ class JavascriptParser extends Parser { if (expression.computed === true) this.walkExpression(expression.property); } + /** + * @param {TODO} expression member expression + * @param {string} name name + * @param {string | VariableInfo} rootInfo root info + * @param {string[]} members members + * @param {TODO} onUnhandled on unhandled callback + */ walkMemberExpressionWithExpressionName( expression, name, @@ -3432,7 +3527,14 @@ class JavascriptParser extends Parser { walkMetaProperty(metaProperty) { this.hooks.expression.for(getRootName(metaProperty)).call(metaProperty); } - + /** + * @template T + * @template R + * @param {HookMap>} hookMap hooks the should be called + * @param {TODO} expr expression + * @param {AsArray} args args for the hook + * @returns {R | undefined} result of hook + */ callHooksForExpression(hookMap, expr, ...args) { return this.callHooksForExpressionWithFallback( hookMap, @@ -3721,6 +3823,10 @@ class JavascriptParser extends Parser { } } + /** + * @param {(Pattern | Property)[]} patterns patterns + * @param {TODO} onIdent on ident callback + */ enterPatterns(patterns, onIdent) { for (const pattern of patterns) { if (typeof pattern !== "string") { @@ -3731,6 +3837,10 @@ class JavascriptParser extends Parser { } } + /** + * @param {Pattern | Property} pattern pattern + * @param {TODO} onIdent on ident callback + */ enterPattern(pattern, onIdent) { if (!pattern) return; switch (pattern.type) { @@ -3755,7 +3865,7 @@ class JavascriptParser extends Parser { this.enterIdentifier(pattern.value, onIdent); this.scope.inShorthand = false; } else { - this.enterPattern(pattern.value, onIdent); + this.enterPattern(/** @type {Identifier} */ (pattern.value), onIdent); } break; } @@ -3797,8 +3907,10 @@ class JavascriptParser extends Parser { elementIndex++ ) { const element = pattern.elements[elementIndex]; - // TODO check on `null`? - this.enterPattern(element, onIdent); + + if (element) { + this.enterPattern(element, onIdent); + } } } @@ -4037,7 +4149,10 @@ class JavascriptParser extends Parser { case "ClassDeclaration": case "ClassExpression": { if (expr.body.type !== "ClassBody") return false; - if (expr.superClass && !this.isPure(expr.superClass, expr.range[0])) { + if ( + expr.superClass && + !this.isPure(expr.superClass, /** @type {Range} */ (expr.range)[0]) + ) { return false; } const items = @@ -4067,6 +4182,14 @@ class JavascriptParser extends Parser { return false; } + if ( + expr.superClass && + item.type === "MethodDefinition" && + item.kind === "constructor" + ) { + return false; + } + return true; }); } @@ -4139,15 +4262,26 @@ class JavascriptParser extends Parser { /** * @param {Range} range range - * @returns {TODO[]} comments in the range + * @returns {Comment[]} comments in the range */ getComments(range) { const [rangeStart, rangeEnd] = range; - const compare = (comment, needle) => comment.range[0] - needle; - let idx = binarySearchBounds.ge(this.comments, rangeStart, compare); + /** + * @param {Comment} comment comment + * @param {number} needle needle + * @returns {number} compared + */ + const compare = (comment, needle) => + /** @type {Range} */ (comment.range)[0] - needle; + const comments = /** @type {Comment[]} */ (this.comments); + let idx = binarySearchBounds.ge(comments, rangeStart, compare); + /** @type {Comment[]} */ let commentsInRange = []; - while (this.comments[idx] && this.comments[idx].range[1] <= rangeEnd) { - commentsInRange.push(this.comments[idx]); + while ( + comments[idx] && + /** @type {Range} */ (comments[idx].range)[1] <= rangeEnd + ) { + commentsInRange.push(comments[idx]); idx++; } @@ -4163,14 +4297,17 @@ class JavascriptParser extends Parser { if (currentStatement === undefined) throw new Error("Not in statement"); return ( // Either asking directly for the end position of the current statement - (currentStatement.range[1] === pos && this.semicolons.has(pos)) || + (currentStatement.range[1] === pos && + /** @type {Set} */ (this.semicolons).has(pos)) || // Or asking for the start position of the current statement, // here we have to check multiple things (currentStatement.range[0] === pos && // is there a previous statement which might be relevant? this.prevStatement !== undefined && // is the end position of the previous statement an ASI position? - this.semicolons.has(this.prevStatement.range[1])) + /** @type {Set} */ (this.semicolons).has( + this.prevStatement.range[1] + )) ); } @@ -4179,7 +4316,7 @@ class JavascriptParser extends Parser { * @returns {void} */ unsetAsiPosition(pos) { - this.semicolons.delete(pos); + /** @type {Set} */ (this.semicolons).delete(pos); } /** @@ -4195,6 +4332,11 @@ class JavascriptParser extends Parser { ); } + /** + * @param {string} name name + * @param {TODO} tag tag info + * @returns {TODO} tag data + */ getTagData(name, tag) { const info = this.scope.definitions.get(name); if (info instanceof VariableInfo) { @@ -4206,6 +4348,11 @@ class JavascriptParser extends Parser { } } + /** + * @param {string} name name + * @param {TODO} tag tag info + * @param {TODO=} data data + */ tagVariable(name, tag, data) { const oldInfo = this.scope.definitions.get(name); /** @type {VariableInfo} */ @@ -4322,7 +4469,10 @@ class JavascriptParser extends Parser { // try compile only if webpack options comment is present try { for (let [key, val] of Object.entries( - vm.runInNewContext(`(function(){return {${value}};})()`) + vm.runInContext( + `(function(){return {${value}};})()`, + this.magicCommentContext + ) )) { if (typeof val === "object" && val !== null) { if (val.constructor.name === "RegExp") val = new RegExp(val); @@ -4355,11 +4505,11 @@ class JavascriptParser extends Parser { if (expr.computed) { if (expr.property.type !== "Literal") break; members.push(`${expr.property.value}`); // the literal - memberRanges.push(expr.object.range); // the range of the expression fragment before the literal + memberRanges.push(/** @type {Range} */ (expr.object.range)); // the range of the expression fragment before the literal } else { if (expr.property.type !== "Identifier") break; members.push(expr.property.name); // the identifier - memberRanges.push(expr.object.range); // the range of the expression fragment before the identifier + memberRanges.push(/** @type {Range} */ (expr.object.range)); // the range of the expression fragment before the identifier } membersOptionals.push(expr.optional); expr = expr.object; diff --git a/lib/json/JsonGenerator.js b/lib/json/JsonGenerator.js index d7074fc0ca7..53af8d3a599 100644 --- a/lib/json/JsonGenerator.js +++ b/lib/json/JsonGenerator.js @@ -183,7 +183,7 @@ class JsonGenerator extends Generator { const jsonStr = /** @type {string} */ (stringifySafe(finalJson)); const jsonExpr = jsonStr.length > 20 && typeof finalJson === "object" - ? `JSON.parse('${jsonStr.replace(/[\\']/g, "\\$&")}')` + ? `/*#__PURE__*/JSON.parse('${jsonStr.replace(/[\\']/g, "\\$&")}')` : jsonStr; /** @type {string} */ let content; diff --git a/lib/library/AmdLibraryPlugin.js b/lib/library/AmdLibraryPlugin.js index e73c9bcd449..9cca2c9cb7f 100644 --- a/lib/library/AmdLibraryPlugin.js +++ b/lib/library/AmdLibraryPlugin.js @@ -87,7 +87,11 @@ class AmdLibraryPlugin extends AbstractLibraryPlugin { const modern = runtimeTemplate.supportsArrowFunction(); const modules = chunkGraph .getChunkModules(chunk) - .filter(m => m instanceof ExternalModule); + .filter( + m => + m instanceof ExternalModule && + (m.externalType === "amd" || m.externalType === "amd-require") + ); const externals = /** @type {ExternalModule[]} */ (modules); const externalsDepsArray = JSON.stringify( externals.map(m => diff --git a/lib/library/AssignLibraryPlugin.js b/lib/library/AssignLibraryPlugin.js index e232bd37b1b..b1657686a05 100644 --- a/lib/library/AssignLibraryPlugin.js +++ b/lib/library/AssignLibraryPlugin.js @@ -295,7 +295,7 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin { const exportAccess = options.export ? propertyAccess( Array.isArray(options.export) ? options.export : [options.export] - ) + ) : ""; const result = new ConcatSource(source); if (staticExports) { diff --git a/lib/library/SystemLibraryPlugin.js b/lib/library/SystemLibraryPlugin.js index 3795985b5de..06fdabe34da 100644 --- a/lib/library/SystemLibraryPlugin.js +++ b/lib/library/SystemLibraryPlugin.js @@ -187,7 +187,7 @@ class SystemLibraryPlugin extends AbstractLibraryPlugin { .join(",\n") ), "]," - ]); + ]); return new ConcatSource( Template.asString([ diff --git a/lib/library/UmdLibraryPlugin.js b/lib/library/UmdLibraryPlugin.js index fbcb0717c76..34a2af2855f 100644 --- a/lib/library/UmdLibraryPlugin.js +++ b/lib/library/UmdLibraryPlugin.js @@ -243,8 +243,8 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin { const factoryArguments = requiredExternals.length > 0 ? externalsArguments(requiredExternals) + - ", " + - externalsRootArray(optionalExternals) + ", " + + externalsRootArray(optionalExternals) : externalsRootArray(optionalExternals); amdFactory = `function webpackLoadOptionalExternalModuleAmd(${wrapperArguments}) {\n` + @@ -283,55 +283,55 @@ class UmdLibraryPlugin extends AbstractLibraryPlugin { (requiredExternals.length > 0 ? names.amd && namedDefine === true ? " define(" + - libraryName(names.amd) + - ", " + - externalsDepsArray(requiredExternals) + - ", " + - amdFactory + - ");\n" + libraryName(names.amd) + + ", " + + externalsDepsArray(requiredExternals) + + ", " + + amdFactory + + ");\n" : " define(" + - externalsDepsArray(requiredExternals) + - ", " + - amdFactory + - ");\n" + externalsDepsArray(requiredExternals) + + ", " + + amdFactory + + ");\n" : names.amd && namedDefine === true - ? " define(" + - libraryName(names.amd) + - ", [], " + - amdFactory + - ");\n" - : " define([], " + amdFactory + ");\n") + + ? " define(" + + libraryName(names.amd) + + ", [], " + + amdFactory + + ");\n" + : " define([], " + amdFactory + ");\n") + (names.root || names.commonjs ? getAuxiliaryComment("commonjs") + - " else if(typeof exports === 'object')\n" + - " exports[" + - libraryName(names.commonjs || names.root) + - "] = factory(" + - externalsRequireArray("commonjs") + - ");\n" + - getAuxiliaryComment("root") + - " else\n" + - " " + - replaceKeys( + " else if(typeof exports === 'object')\n" + + " exports[" + + libraryName(names.commonjs || names.root) + + "] = factory(" + + externalsRequireArray("commonjs") + + ");\n" + + getAuxiliaryComment("root") + + " else\n" + + " " + + replaceKeys( accessorAccess( "root", /** @type {string | string[]} */ (names.root) || /** @type {string} */ (names.commonjs) ) - ) + - " = factory(" + - externalsRootArray(externals) + - ");\n" + ) + + " = factory(" + + externalsRootArray(externals) + + ");\n" : " else {\n" + - (externals.length > 0 + (externals.length > 0 ? " var a = typeof exports === 'object' ? factory(" + - externalsRequireArray("commonjs") + - ") : factory(" + - externalsRootArray(externals) + - ");\n" + externalsRequireArray("commonjs") + + ") : factory(" + + externalsRootArray(externals) + + ");\n" : " var a = factory();\n") + - " for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n" + - " }\n") + + " for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n" + + " }\n") + `})(${runtimeTemplate.outputOptions.globalObject}, ${ runtimeTemplate.supportsArrowFunction() ? `(${externalsArguments(externals)}) =>` diff --git a/lib/logging/createConsoleLogger.js b/lib/logging/createConsoleLogger.js index 1ad0aa7144f..e6a65d98f70 100644 --- a/lib/logging/createConsoleLogger.js +++ b/lib/logging/createConsoleLogger.js @@ -45,11 +45,7 @@ const { LogType } = require("./Logger"); const filterToFunction = item => { if (typeof item === "string") { const regExp = new RegExp( - `[\\\\/]${item.replace( - // eslint-disable-next-line no-useless-escape - /[-[\]{}()*+?.\\^$|]/g, - "\\$&" - )}([\\\\/]|$|!|\\?)` + `[\\\\/]${item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&")}([\\\\/]|$|!|\\?)` ); return ident => regExp.test(ident); } @@ -114,9 +110,7 @@ module.exports = ({ level = "info", debug = false, console }) => { switch (type) { case LogType.debug: if (!debug) return; - // eslint-disable-next-line node/no-unsupported-features/node-builtins if (typeof console.debug === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins console.debug(...labeledArgs()); } else { console.log(...labeledArgs()); @@ -145,9 +139,7 @@ module.exports = ({ level = "info", debug = false, console }) => { case LogType.groupCollapsed: if (!debug && loglevel > LogLevel.log) return; if (!debug && loglevel > LogLevel.verbose) { - // eslint-disable-next-line node/no-unsupported-features/node-builtins if (typeof console.groupCollapsed === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins console.groupCollapsed(...labeledArgs()); } else { console.log(...labeledArgs()); @@ -157,9 +149,7 @@ module.exports = ({ level = "info", debug = false, console }) => { // falls through case LogType.group: if (!debug && loglevel > LogLevel.log) return; - // eslint-disable-next-line node/no-unsupported-features/node-builtins if (typeof console.group === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins console.group(...labeledArgs()); } else { console.log(...labeledArgs()); @@ -167,9 +157,7 @@ module.exports = ({ level = "info", debug = false, console }) => { break; case LogType.groupEnd: if (!debug && loglevel > LogLevel.log) return; - // eslint-disable-next-line node/no-unsupported-features/node-builtins if (typeof console.groupEnd === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins console.groupEnd(); } break; @@ -185,24 +173,18 @@ module.exports = ({ level = "info", debug = false, console }) => { break; } case LogType.profile: - // eslint-disable-next-line node/no-unsupported-features/node-builtins if (typeof console.profile === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins console.profile(...labeledArgs()); } break; case LogType.profileEnd: - // eslint-disable-next-line node/no-unsupported-features/node-builtins if (typeof console.profileEnd === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins console.profileEnd(...labeledArgs()); } break; case LogType.clear: if (!debug && loglevel > LogLevel.log) return; - // eslint-disable-next-line node/no-unsupported-features/node-builtins if (typeof console.clear === "function") { - // eslint-disable-next-line node/no-unsupported-features/node-builtins console.clear(); } break; diff --git a/lib/node/ReadFileChunkLoadingRuntimeModule.js b/lib/node/ReadFileChunkLoadingRuntimeModule.js index eac29d9c601..5a715c9b559 100644 --- a/lib/node/ReadFileChunkLoadingRuntimeModule.js +++ b/lib/node/ReadFileChunkLoadingRuntimeModule.js @@ -113,10 +113,10 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { withOnChunkLoad ? `${ RuntimeGlobals.onChunksLoaded - }.readFileVm = ${runtimeTemplate.returningFunction( + }.readFileVm = ${runtimeTemplate.returningFunction( "installedChunks[chunkId] === 0", "chunkId" - )};` + )};` : "// no on chunks loaded", "", withLoading || withExternalInstallChunk @@ -141,7 +141,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { ]), "}", withOnChunkLoad ? `${RuntimeGlobals.onChunksLoaded}();` : "" - ])};` + ])};` : "// no chunk install function needed", "", withLoading @@ -192,17 +192,17 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { "}" ]), "}" - ]) + ]) : Template.indent(["installedChunks[chunkId] = 0;"]), "};" - ]) + ]) : "// no chunk loading", "", withExternalInstallChunk ? Template.asString([ `module.exports = ${RuntimeGlobals.require};`, `${RuntimeGlobals.externalInstallChunk} = installChunk;` - ]) + ]) : "// no external install chunk", "", withHmr @@ -263,7 +263,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { /\$hmrInvalidateModuleHandlers\$/g, RuntimeGlobals.hmrInvalidateModuleHandlers ) - ]) + ]) : "// no HMR", "", withHmrManifest @@ -291,7 +291,7 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { "});" ]), "}" - ]) + ]) : "// no HMR manifest" ]); } diff --git a/lib/node/RequireChunkLoadingRuntimeModule.js b/lib/node/RequireChunkLoadingRuntimeModule.js index f0b37b09939..b03575af447 100644 --- a/lib/node/RequireChunkLoadingRuntimeModule.js +++ b/lib/node/RequireChunkLoadingRuntimeModule.js @@ -113,10 +113,10 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule { withOnChunkLoad ? `${ RuntimeGlobals.onChunksLoaded - }.require = ${runtimeTemplate.returningFunction( + }.require = ${runtimeTemplate.returningFunction( "installedChunks[chunkId]", "chunkId" - )};` + )};` : "// no on chunks loaded", "", withLoading || withExternalInstallChunk @@ -135,7 +135,7 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule { "for(var i = 0; i < chunkIds.length; i++)", Template.indent("installedChunks[chunkIds[i]] = 1;"), withOnChunkLoad ? `${RuntimeGlobals.onChunksLoaded}();` : "" - ])};` + ])};` : "// no chunk install function needed", "", withLoading @@ -162,17 +162,17 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule { "" ]), "}" - ] + ] : "installedChunks[chunkId] = 1;" )};` - ]) + ]) : "// no chunk loading", "", withExternalInstallChunk ? Template.asString([ `module.exports = ${RuntimeGlobals.require};`, `${RuntimeGlobals.externalInstallChunk} = installChunk;` - ]) + ]) : "// no external install chunk", "", withHmr @@ -220,7 +220,7 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule { /\$hmrInvalidateModuleHandlers\$/g, RuntimeGlobals.hmrInvalidateModuleHandlers ) - ]) + ]) : "// no HMR", "", withHmrManifest @@ -236,7 +236,7 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule { "})['catch'](function(err) { if(err.code !== 'MODULE_NOT_FOUND') throw err; });" ]), "}" - ]) + ]) : "// no HMR manifest" ]); } diff --git a/lib/node/nodeConsole.js b/lib/node/nodeConsole.js index 3365f6bda20..24676d1188c 100644 --- a/lib/node/nodeConsole.js +++ b/lib/node/nodeConsole.js @@ -102,17 +102,13 @@ module.exports = ({ colors, appendOnly, stream }) => { else if (currentIndent.length >= 2) currentIndent = currentIndent.slice(0, currentIndent.length - 2); }, - // eslint-disable-next-line node/no-unsupported-features/node-builtins profile: console.profile && (name => console.profile(name)), - // eslint-disable-next-line node/no-unsupported-features/node-builtins profileEnd: console.profileEnd && (name => console.profileEnd(name)), clear: !appendOnly && - // eslint-disable-next-line node/no-unsupported-features/node-builtins console.clear && (() => { clearStatusMessage(); - // eslint-disable-next-line node/no-unsupported-features/node-builtins console.clear(); writeStatusMessage(); }), @@ -136,6 +132,6 @@ module.exports = ({ colors, appendOnly, stream }) => { currentStatusMessage = [name, ...args]; writeStatusMessage(); } - } + } }; }; diff --git a/lib/optimize/ConcatenatedModule.js b/lib/optimize/ConcatenatedModule.js index f889b5e2042..87466ae9085 100644 --- a/lib/optimize/ConcatenatedModule.js +++ b/lib/optimize/ConcatenatedModule.js @@ -335,10 +335,10 @@ const getFinalBinding = ( const defaultExport = asCall ? `${info.interopDefaultAccessName}()` : asiSafe - ? `(${info.interopDefaultAccessName}())` - : asiSafe === false - ? `;(${info.interopDefaultAccessName}())` - : `${info.interopDefaultAccessName}.a`; + ? `(${info.interopDefaultAccessName}())` + : asiSafe === false + ? `;(${info.interopDefaultAccessName}())` + : `${info.interopDefaultAccessName}.a`; return { info, rawName: defaultExport, @@ -568,8 +568,8 @@ const getFinalName = ( return asiSafe ? `(0,${reference})` : asiSafe === false - ? `;(0,${reference})` - : `/*#__PURE__*/Object(${reference})`; + ? `;(0,${reference})` + : `/*#__PURE__*/Object(${reference})`; } return reference; } @@ -1541,7 +1541,7 @@ class ConcatenatedModule extends Module { nsObj.length > 0 ? `${RuntimeGlobals.definePropertyGetters}(${name}, {${nsObj.join( "," - )}\n});\n` + )}\n});\n` : ""; if (nsObj.length > 0) runtimeRequirements.add(RuntimeGlobals.definePropertyGetters); diff --git a/lib/optimize/InnerGraphPlugin.js b/lib/optimize/InnerGraphPlugin.js index f541030afe0..071f31ab9ef 100644 --- a/lib/optimize/InnerGraphPlugin.js +++ b/lib/optimize/InnerGraphPlugin.js @@ -177,7 +177,6 @@ class InnerGraphPlugin { ) { pureDeclarators.add(decl); } - return true; } } }); @@ -336,6 +335,15 @@ class InnerGraphPlugin { parser.walkExpression(decl.init); InnerGraph.setTopLevelSymbol(parser.state, undefined); return true; + } else if ( + decl.id.type === "Identifier" && + decl.init && + decl.init.type === "ClassExpression" && + classWithTopLevelSymbol.has(decl.init) + ) { + parser.walkExpression(decl.init); + InnerGraph.setTopLevelSymbol(parser.state, undefined); + return true; } }); diff --git a/lib/optimize/MangleExportsPlugin.js b/lib/optimize/MangleExportsPlugin.js index 30884448a1c..5e32c258922 100644 --- a/lib/optimize/MangleExportsPlugin.js +++ b/lib/optimize/MangleExportsPlugin.js @@ -88,7 +88,11 @@ const mangleExportsInfo = (deterministic, exportsInfo, isNamespace) => { used === UsageState.OnlyPropertiesUsed || used === UsageState.Unused ) { - mangleExportsInfo(deterministic, exportInfo.exportsInfo, false); + mangleExportsInfo( + deterministic, + /** @type {ExportsInfo} */ (exportInfo.exportsInfo), + false + ); } } } diff --git a/lib/optimize/ModuleConcatenationPlugin.js b/lib/optimize/ModuleConcatenationPlugin.js index 7b0adfa8139..944bfa09dd3 100644 --- a/lib/optimize/ModuleConcatenationPlugin.js +++ b/lib/optimize/ModuleConcatenationPlugin.js @@ -284,8 +284,8 @@ class ModuleConcatenationPlugin { filteredRuntime === true ? chunkRuntime : filteredRuntime === false - ? undefined - : filteredRuntime; + ? undefined + : filteredRuntime; // create a configuration with the root const currentConfiguration = new ConcatConfiguration( diff --git a/lib/optimize/RemoveParentModulesPlugin.js b/lib/optimize/RemoveParentModulesPlugin.js index d609ac004e7..de8f0e0b8ad 100644 --- a/lib/optimize/RemoveParentModulesPlugin.js +++ b/lib/optimize/RemoveParentModulesPlugin.js @@ -6,12 +6,58 @@ "use strict"; const { STAGE_BASIC } = require("../OptimizationStages"); -const Queue = require("../util/Queue"); -const { intersect } = require("../util/SetHelpers"); /** @typedef {import("../Chunk")} Chunk */ /** @typedef {import("../ChunkGroup")} ChunkGroup */ /** @typedef {import("../Compiler")} Compiler */ +/** @typedef {import("../Module")} Module */ + +/** + * Intersects multiple masks represented as bigints + * @param {bigint[]} masks The module masks to intersect + * @returns {bigint} The intersection of all masks + */ +function intersectMasks(masks) { + let result = masks[0]; + for (let i = masks.length - 1; i >= 1; i--) { + result &= masks[i]; + } + return result; +} + +const ZERO_BIGINT = BigInt(0); +const ONE_BIGINT = BigInt(1); +const THIRTY_TWO_BIGINT = BigInt(32); + +/** + * Parses the module mask and returns the modules represented by it + * @param {bigint} mask the module mask + * @param {Module[]} ordinalModules the modules in the order they were added to the mask (LSB is index 0) + * @returns {Generator} the modules represented by the mask + */ +function* getModulesFromMask(mask, ordinalModules) { + let offset = 31; + while (mask !== ZERO_BIGINT) { + // Consider the last 32 bits, since that's what Math.clz32 can handle + let last32 = Number(BigInt.asUintN(32, mask)); + while (last32 > 0) { + let last = Math.clz32(last32); + // The number of trailing zeros is the number trimmed off the input mask + 31 - the number of leading zeros + // The 32 is baked into the initial value of offset + const moduleIndex = offset - last; + // The number of trailing zeros is the index into the array generated by getOrCreateModuleMask + const module = ordinalModules[moduleIndex]; + yield module; + // Remove the matched module from the mask + // Since we can only count leading zeros, not trailing, we can't just downshift the mask + last32 &= ~(1 << (31 - last)); + } + + // Remove the processed chunk from the mask + mask >>= THIRTY_TWO_BIGINT; + offset += 32; + } +} class RemoveParentModulesPlugin { /** @@ -26,92 +72,122 @@ class RemoveParentModulesPlugin { */ const handler = (chunks, chunkGroups) => { const chunkGraph = compilation.chunkGraph; - const queue = new Queue(); + const queue = new Set(); const availableModulesMap = new WeakMap(); + let nextModuleMask = ONE_BIGINT; + const maskByModule = new WeakMap(); + const ordinalModules = []; + + /** + * Gets or creates a unique mask for a module + * @param {Module} mod the module to get the mask for + * @returns {bigint} the module mask to uniquely identify the module + */ + const getOrCreateModuleMask = mod => { + let id = maskByModule.get(mod); + if (id === undefined) { + id = nextModuleMask; + ordinalModules.push(mod); + maskByModule.set(mod, id); + nextModuleMask <<= ONE_BIGINT; + } + return id; + }; + + // Initialize masks by chunk and by chunk group for quicker comparisons + const chunkMasks = new WeakMap(); + for (const chunk of chunks) { + let mask = ZERO_BIGINT; + for (const m of chunkGraph.getChunkModulesIterable(chunk)) { + const id = getOrCreateModuleMask(m); + mask |= id; + } + chunkMasks.set(chunk, mask); + } + + const chunkGroupMasks = new WeakMap(); + for (const chunkGroup of chunkGroups) { + let mask = ZERO_BIGINT; + for (const chunk of chunkGroup.chunks) { + const chunkMask = chunkMasks.get(chunk); + if (chunkMask !== undefined) { + mask |= chunkMask; + } + } + chunkGroupMasks.set(chunkGroup, mask); + } + for (const chunkGroup of compilation.entrypoints.values()) { // initialize available modules for chunks without parents - availableModulesMap.set(chunkGroup, new Set()); + availableModulesMap.set(chunkGroup, ZERO_BIGINT); for (const child of chunkGroup.childrenIterable) { - queue.enqueue(child); + queue.add(child); } } for (const chunkGroup of compilation.asyncEntrypoints) { // initialize available modules for chunks without parents - availableModulesMap.set(chunkGroup, new Set()); + availableModulesMap.set(chunkGroup, ZERO_BIGINT); for (const child of chunkGroup.childrenIterable) { - queue.enqueue(child); + queue.add(child); } } - while (queue.length > 0) { - const chunkGroup = queue.dequeue(); - let availableModules = availableModulesMap.get(chunkGroup); + for (const chunkGroup of queue) { + let availableModulesMask = availableModulesMap.get(chunkGroup); let changed = false; for (const parent of chunkGroup.parentsIterable) { const availableModulesInParent = availableModulesMap.get(parent); if (availableModulesInParent !== undefined) { + const parentMask = + availableModulesInParent | chunkGroupMasks.get(parent); // If we know the available modules in parent: process these - if (availableModules === undefined) { + if (availableModulesMask === undefined) { // if we have not own info yet: create new entry - availableModules = new Set(availableModulesInParent); - for (const chunk of parent.chunks) { - for (const m of chunkGraph.getChunkModulesIterable(chunk)) { - availableModules.add(m); - } - } - availableModulesMap.set(chunkGroup, availableModules); + availableModulesMask = parentMask; changed = true; } else { - for (const m of availableModules) { - if ( - !chunkGraph.isModuleInChunkGroup(m, parent) && - !availableModulesInParent.has(m) - ) { - availableModules.delete(m); - changed = true; - } + let newMask = availableModulesMask & parentMask; + if (newMask !== availableModulesMask) { + changed = true; + availableModulesMask = newMask; } } } } + if (changed) { + availableModulesMap.set(chunkGroup, availableModulesMask); // if something changed: enqueue our children for (const child of chunkGroup.childrenIterable) { - queue.enqueue(child); + // Push the child to the end of the queue + queue.delete(child); + queue.add(child); } } } // now we have available modules for every chunk for (const chunk of chunks) { + const chunkMask = chunkMasks.get(chunk); + if (chunkMask === undefined) continue; // No info about this chunk + const availableModulesSets = Array.from( chunk.groupsIterable, chunkGroup => availableModulesMap.get(chunkGroup) ); if (availableModulesSets.some(s => s === undefined)) continue; // No info about this chunk group - const availableModules = - availableModulesSets.length === 1 - ? availableModulesSets[0] - : intersect(availableModulesSets); - const numberOfModules = chunkGraph.getNumberOfChunkModules(chunk); - const toRemove = new Set(); - if (numberOfModules < availableModules.size) { - for (const m of chunkGraph.getChunkModulesIterable(chunk)) { - if (availableModules.has(m)) { - toRemove.add(m); - } - } - } else { - for (const m of availableModules) { - if (chunkGraph.isModuleInChunk(m, chunk)) { - toRemove.add(m); - } + + const availableModulesMask = intersectMasks(availableModulesSets); + const toRemoveMask = chunkMask & availableModulesMask; + if (toRemoveMask !== ZERO_BIGINT) { + for (const module of getModulesFromMask( + toRemoveMask, + ordinalModules + )) { + chunkGraph.disconnectChunkAndModule(chunk, module); } } - for (const module of toRemove) { - chunkGraph.disconnectChunkAndModule(chunk, module); - } } }; compilation.hooks.optimizeChunks.tap( diff --git a/lib/optimize/SideEffectsFlagPlugin.js b/lib/optimize/SideEffectsFlagPlugin.js index 5628ed382c0..cd1e7fce0b5 100644 --- a/lib/optimize/SideEffectsFlagPlugin.js +++ b/lib/optimize/SideEffectsFlagPlugin.js @@ -159,8 +159,8 @@ class SideEffectsFlagPlugin { statement.test ? statement.test.range[1] : statement.init - ? statement.init.range[1] - : statement.range[0] + ? statement.init.range[1] + : statement.range[0] ) ) { sideEffectsStatement = statement; @@ -243,7 +243,12 @@ class SideEffectsFlagPlugin { ); logger.time("update dependencies"); - for (const module of modules) { + + const optimizedModules = new Set(); + + const optimizeIncomingConnections = module => { + if (optimizedModules.has(module)) return; + optimizedModules.add(module); if (module.getSideEffectsConnectionState(moduleGraph) === false) { const exportsInfo = moduleGraph.getExportsInfo(module); for (const connection of moduleGraph.getIncomingConnections( @@ -258,6 +263,9 @@ class SideEffectsFlagPlugin { (dep instanceof HarmonyImportSpecifierDependency && !dep.namespaceObjectAsContext) ) { + if (connection.originModule !== null) { + optimizeIncomingConnections(connection.originModule); + } // TODO improve for export * if (isReexport && dep.name) { const exportInfo = moduleGraph.getExportInfo( @@ -314,6 +322,10 @@ class SideEffectsFlagPlugin { } } } + }; + + for (const module of modules) { + optimizeIncomingConnections(module); } logger.timeEnd("update dependencies"); } diff --git a/lib/optimize/SplitChunksPlugin.js b/lib/optimize/SplitChunksPlugin.js index 2e79ab6a2a3..d430df4955f 100644 --- a/lib/optimize/SplitChunksPlugin.js +++ b/lib/optimize/SplitChunksPlugin.js @@ -749,20 +749,20 @@ module.exports = class SplitChunksPlugin { cacheGroupSource.minChunks !== undefined ? cacheGroupSource.minChunks : cacheGroupSource.enforce - ? 1 - : this.options.minChunks, + ? 1 + : this.options.minChunks, maxAsyncRequests: cacheGroupSource.maxAsyncRequests !== undefined ? cacheGroupSource.maxAsyncRequests : cacheGroupSource.enforce - ? Infinity - : this.options.maxAsyncRequests, + ? Infinity + : this.options.maxAsyncRequests, maxInitialRequests: cacheGroupSource.maxInitialRequests !== undefined ? cacheGroupSource.maxInitialRequests : cacheGroupSource.enforce - ? Infinity - : this.options.maxInitialRequests, + ? Infinity + : this.options.maxInitialRequests, getName: cacheGroupSource.getName !== undefined ? cacheGroupSource.getName @@ -1428,13 +1428,13 @@ module.exports = class SplitChunksPlugin { chunk.isOnlyInitial() ? item.cacheGroup.maxInitialRequests : chunk.canBeInitial() - ? Math.min( - /** @type {number} */ - (item.cacheGroup.maxInitialRequests), - /** @type {number} */ - (item.cacheGroup.maxAsyncRequests) - ) - : item.cacheGroup.maxAsyncRequests + ? Math.min( + /** @type {number} */ + (item.cacheGroup.maxInitialRequests), + /** @type {number} */ + (item.cacheGroup.maxAsyncRequests) + ) + : item.cacheGroup.maxAsyncRequests ); if ( isFinite(maxRequests) && @@ -1569,21 +1569,21 @@ module.exports = class SplitChunksPlugin { oldMaxSizeSettings.minSize, item.cacheGroup._minSizeForMaxSize, Math.max - ) + ) : item.cacheGroup.minSize, maxAsyncSize: oldMaxSizeSettings ? combineSizes( oldMaxSizeSettings.maxAsyncSize, item.cacheGroup.maxAsyncSize, Math.min - ) + ) : item.cacheGroup.maxAsyncSize, maxInitialSize: oldMaxSizeSettings ? combineSizes( oldMaxSizeSettings.maxInitialSize, item.cacheGroup.maxInitialSize, Math.min - ) + ) : item.cacheGroup.maxInitialSize, automaticNameDelimiter: item.cacheGroup.automaticNameDelimiter, keys: oldMaxSizeSettings diff --git a/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js b/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js index 95f097113e2..740bbe8c3c1 100644 --- a/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +++ b/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js @@ -42,10 +42,10 @@ class ChunkPrefetchStartupRuntimeModule extends RuntimeModule { chunks, c => `${RuntimeGlobals.prefetchChunk}(${JSON.stringify(c.id)});` - ) + ) : `${JSON.stringify(Array.from(chunks, c => c.id))}.map(${ RuntimeGlobals.prefetchChunk - });` + });` )}, 5);` ) ); diff --git a/lib/rules/RuleSetCompiler.js b/lib/rules/RuleSetCompiler.js index 7f602764caa..3b07b3ad775 100644 --- a/lib/rules/RuleSetCompiler.js +++ b/lib/rules/RuleSetCompiler.js @@ -272,7 +272,7 @@ class RuleSetCompiler { if (!Array.isArray(value)) { throw this.error( `${path}.or`, - condition.and, + condition.or, "Expected array of conditions" ); } diff --git a/lib/runtime/AutoPublicPathRuntimeModule.js b/lib/runtime/AutoPublicPathRuntimeModule.js index 60cf1b29558..cc62fc8117c 100644 --- a/lib/runtime/AutoPublicPathRuntimeModule.js +++ b/lib/runtime/AutoPublicPathRuntimeModule.js @@ -63,7 +63,7 @@ class AutoPublicPathRuntimeModule extends RuntimeModule { "}" ]), "}" - ]), + ]), "// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration", '// or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.', 'if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");', @@ -72,7 +72,7 @@ class AutoPublicPathRuntimeModule extends RuntimeModule { ? `${RuntimeGlobals.publicPath} = scriptUrl;` : `${RuntimeGlobals.publicPath} = scriptUrl + ${JSON.stringify( undoPath - )};` + )};` ]); } } diff --git a/lib/runtime/GetChunkFilenameRuntimeModule.js b/lib/runtime/GetChunkFilenameRuntimeModule.js index 1ca4cd8a3fc..6dab9cdfd35 100644 --- a/lib/runtime/GetChunkFilenameRuntimeModule.js +++ b/lib/runtime/GetChunkFilenameRuntimeModule.js @@ -152,7 +152,7 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule { chunk: c, contentHashType: contentType }) - ) + ) : JSON.stringify(chunkFilename); const staticChunkFilename = compilation.getPath(chunkFilenameValue, { hash: `" + ${RuntimeGlobals.getFullHash}() + "`, @@ -219,7 +219,7 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule { return useId ? `(chunkId === ${JSON.stringify(lastKey)} ? ${JSON.stringify( obj[/** @type {number | string} */ (lastKey)] - )} : chunkId)` + )} : chunkId)` : JSON.stringify(obj[/** @type {number | string} */ (lastKey)]); } return useId @@ -285,13 +285,13 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule { : `{${Array.from( ids, id => `${JSON.stringify(id)}:1` - ).join(",")}}[chunkId]`; + ).join(",")}}[chunkId]`; return `if (${condition}) return ${url};`; }) ), "// return url for filenames based on template", `return ${url};` - ] + ] : ["// return url for filenames based on template", `return ${url};`] )};` ]); diff --git a/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js b/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js index 9710561fa15..a61e1114be7 100644 --- a/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +++ b/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js @@ -46,7 +46,7 @@ class GetTrustedTypesPolicyRuntimeModule extends HelperRuntimeModule { "script", "script" )}` - ] + ] : []), ...(this.runtimeRequirements.has(RuntimeGlobals.createScriptUrl) ? [ @@ -54,7 +54,7 @@ class GetTrustedTypesPolicyRuntimeModule extends HelperRuntimeModule { "url", "url" )}` - ] + ] : []) ].join(",\n") ), @@ -80,11 +80,11 @@ class GetTrustedTypesPolicyRuntimeModule extends HelperRuntimeModule { )}');` ]), "}" - ] + ] : []) ]), "}" - ] + ] : []) ]), "}", diff --git a/lib/runtime/LoadScriptRuntimeModule.js b/lib/runtime/LoadScriptRuntimeModule.js index 2b0bb7bb537..9ed64dbd880 100644 --- a/lib/runtime/LoadScriptRuntimeModule.js +++ b/lib/runtime/LoadScriptRuntimeModule.js @@ -90,7 +90,7 @@ class LoadScriptRuntimeModule extends HelperRuntimeModule { 'script.setAttribute("fetchpriority", fetchPriority);' ), "}" - ]) + ]) : "", `script.src = ${ this._withCreateScriptUrl @@ -106,7 +106,7 @@ class LoadScriptRuntimeModule extends HelperRuntimeModule { `script.crossOrigin = ${JSON.stringify(crossOriginLoading)};` ), "}" - ]) + ]) : "" ]); diff --git a/lib/runtime/StartupChunkDependenciesRuntimeModule.js b/lib/runtime/StartupChunkDependenciesRuntimeModule.js index 0a4aae68ee8..90f3d92f2de 100644 --- a/lib/runtime/StartupChunkDependenciesRuntimeModule.js +++ b/lib/runtime/StartupChunkDependenciesRuntimeModule.js @@ -46,28 +46,29 @@ class StartupChunkDependenciesRuntimeModule extends RuntimeModule { ) .concat("return next();") : chunkIds.length === 1 - ? `return ${RuntimeGlobals.ensureChunk}(${JSON.stringify( - chunkIds[0] - )}).then(next);` - : chunkIds.length > 2 - ? [ - // using map is shorter for 3 or more chunks - `return Promise.all(${JSON.stringify(chunkIds)}.map(${ - RuntimeGlobals.ensureChunk - }, ${RuntimeGlobals.require})).then(next);` - ] - : [ - // calling ensureChunk directly is shorter for 0 - 2 chunks - "return Promise.all([", - Template.indent( - chunkIds - .map( - id => `${RuntimeGlobals.ensureChunk}(${JSON.stringify(id)})` - ) - .join(",\n") - ), - "]).then(next);" - ] + ? `return ${RuntimeGlobals.ensureChunk}(${JSON.stringify( + chunkIds[0] + )}).then(next);` + : chunkIds.length > 2 + ? [ + // using map is shorter for 3 or more chunks + `return Promise.all(${JSON.stringify(chunkIds)}.map(${ + RuntimeGlobals.ensureChunk + }, ${RuntimeGlobals.require})).then(next);` + ] + : [ + // calling ensureChunk directly is shorter for 0 - 2 chunks + "return Promise.all([", + Template.indent( + chunkIds + .map( + id => + `${RuntimeGlobals.ensureChunk}(${JSON.stringify(id)})` + ) + .join(",\n") + ), + "]).then(next);" + ] )};` ]); } diff --git a/lib/runtime/StartupEntrypointRuntimeModule.js b/lib/runtime/StartupEntrypointRuntimeModule.js index 6d8dc0e97c0..5133767dab3 100644 --- a/lib/runtime/StartupEntrypointRuntimeModule.js +++ b/lib/runtime/StartupEntrypointRuntimeModule.js @@ -41,12 +41,12 @@ class StartupEntrypointRuntimeModule extends RuntimeModule { "var r = fn();", "return r === undefined ? result : r;" ])})` - ] + ] : [ `chunkIds.map(${RuntimeGlobals.ensureChunk}, ${RuntimeGlobals.require})`, "var r = fn();", "return r === undefined ? result : r;" - ]) + ]) ])}`; } } diff --git a/lib/schemes/HttpUriPlugin.js b/lib/schemes/HttpUriPlugin.js index afc15f97da7..a7c7dae0958 100644 --- a/lib/schemes/HttpUriPlugin.js +++ b/lib/schemes/HttpUriPlugin.js @@ -200,7 +200,7 @@ class Lockfile { : { resolved: key, ...entry - } + } ); } return lockfile; diff --git a/lib/serialization/FileMiddleware.js b/lib/serialization/FileMiddleware.js index be4b36502db..f93543defe9 100644 --- a/lib/serialization/FileMiddleware.js +++ b/lib/serialization/FileMiddleware.js @@ -60,23 +60,23 @@ const DECOMPRESSION_CHUNK_SIZE = 100 * 1024 * 1024; const writeUInt64LE = Buffer.prototype.writeBigUInt64LE ? (buf, value, offset) => { buf.writeBigUInt64LE(BigInt(value), offset); - } + } : (buf, value, offset) => { const low = value % 0x100000000; const high = (value - low) / 0x100000000; buf.writeUInt32LE(low, offset); buf.writeUInt32LE(high, offset + 4); - }; + }; const readUInt64LE = Buffer.prototype.readBigUInt64LE ? (buf, offset) => { return Number(buf.readBigUInt64LE(offset)); - } + } : (buf, offset) => { const low = buf.readUInt32LE(offset); const high = buf.readUInt32LE(offset + 4); return high * 0x100000000 + low; - }; + }; /** * @typedef {Object} SerializeResult diff --git a/lib/serialization/ObjectMiddleware.js b/lib/serialization/ObjectMiddleware.js index 31890dfe819..7c7f59c33b8 100644 --- a/lib/serialization/ObjectMiddleware.js +++ b/lib/serialization/ObjectMiddleware.js @@ -718,10 +718,10 @@ class ObjectMiddleware extends SerializerMiddleware { const name = !serializerEntry ? "unknown" : !serializerEntry[1].request - ? serializerEntry[0].name - : serializerEntry[1].name - ? `${serializerEntry[1].request} ${serializerEntry[1].name}` - : serializerEntry[1].request; + ? serializerEntry[0].name + : serializerEntry[1].name + ? `${serializerEntry[1].request} ${serializerEntry[1].name}` + : serializerEntry[1].request; err.message += `\n(during deserialization of ${name})`; throw err; } diff --git a/lib/sharing/ConsumeSharedPlugin.js b/lib/sharing/ConsumeSharedPlugin.js index 1d8eb3ebd55..3c892318545 100644 --- a/lib/sharing/ConsumeSharedPlugin.js +++ b/lib/sharing/ConsumeSharedPlugin.js @@ -60,7 +60,7 @@ class ConsumeSharedPlugin { let result = item === key || !isRequiredVersion(item) ? // item is a request/key - { + { import: key, shareScope: options.shareScope || "default", shareKey: key, @@ -69,10 +69,10 @@ class ConsumeSharedPlugin { strictVersion: false, singleton: false, eager: false - } + } : // key is a request/key - // item is a version - { + // item is a version + { import: key, shareScope: options.shareScope || "default", shareKey: key, @@ -81,7 +81,7 @@ class ConsumeSharedPlugin { packageName: undefined, singleton: false, eager: false - }; + }; return result; }, (item, key) => ({ diff --git a/lib/sharing/ConsumeSharedRuntimeModule.js b/lib/sharing/ConsumeSharedRuntimeModule.js index 355adcd701c..223facceead 100644 --- a/lib/sharing/ConsumeSharedRuntimeModule.js +++ b/lib/sharing/ConsumeSharedRuntimeModule.js @@ -179,7 +179,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule { ? runtimeTemplate.basicFunction("", "") : runtimeTemplate.basicFunction("msg", [ 'if (typeof console !== "undefined" && console.warn) console.warn(msg);' - ]) + ]) };`, `var warnInvalidVersion = ${runtimeTemplate.basicFunction( "scope, scopeName, key, requiredVersion", @@ -312,7 +312,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule { `module.exports = factory();` ])}` ])});` - ]) + ]) : "// no consumes in initial chunks", this._runtimeRequirements.has(RuntimeGlobals.ensureChunkHandlers) ? Template.asString([ @@ -321,6 +321,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule { null, "\t" )};`, + "var startedInstallModules = {};", `${ RuntimeGlobals.ensureChunkHandlers }.consumes = ${runtimeTemplate.basicFunction("chunkId, promises", [ @@ -330,6 +331,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule { "id", [ `if(${RuntimeGlobals.hasOwnProperty}(installedModules, id)) return promises.push(installedModules[id]);`, + "if(!startedInstallModules[id]) {", `var onFactory = ${runtimeTemplate.basicFunction( "factory", [ @@ -342,6 +344,7 @@ class ConsumeSharedRuntimeModule extends RuntimeModule { ])}` ] )};`, + "startedInstallModules[id] = true;", `var onError = ${runtimeTemplate.basicFunction("error", [ "delete installedModules[id];", `${ @@ -360,13 +363,14 @@ class ConsumeSharedRuntimeModule extends RuntimeModule { ), "} else onFactory(promise);" ]), - "} catch(e) { onError(e); }" + "} catch(e) { onError(e); }", + "}" ] )});` ]), "}" ])}` - ]) + ]) : "// no chunk loading of consumes" ]); } diff --git a/lib/sharing/ProvideSharedModule.js b/lib/sharing/ProvideSharedModule.js index ae8e38dcefe..40796dd7bf7 100644 --- a/lib/sharing/ProvideSharedModule.js +++ b/lib/sharing/ProvideSharedModule.js @@ -141,13 +141,13 @@ class ProvideSharedModule extends Module { chunkGraph, request: this._request, runtimeRequirements - }) + }) : runtimeTemplate.asyncModuleFactory({ block: this.blocks[0], chunkGraph, request: this._request, runtimeRequirements - }) + }) }${this._eager ? ", 1" : ""});`; const sources = new Map(); const data = new Map(); diff --git a/lib/sharing/SharePlugin.js b/lib/sharing/SharePlugin.js index ccbd9bbdde5..65935b30b99 100644 --- a/lib/sharing/SharePlugin.js +++ b/lib/sharing/SharePlugin.js @@ -34,11 +34,11 @@ class SharePlugin { item === key || !isRequiredVersion(item) ? { import: item - } + } : { import: key, requiredVersion: item - }; + }; return config; }, item => item diff --git a/lib/sharing/ShareRuntimeModule.js b/lib/sharing/ShareRuntimeModule.js index a9c666850f9..0f63ef68d7d 100644 --- a/lib/sharing/ShareRuntimeModule.js +++ b/lib/sharing/ShareRuntimeModule.js @@ -89,7 +89,7 @@ class ShareRuntimeModule extends RuntimeModule { ? runtimeTemplate.basicFunction("", "") : runtimeTemplate.basicFunction("msg", [ 'if (typeof console !== "undefined" && console.warn) console.warn(msg);' - ]) + ]) };`, `var uniqueName = ${JSON.stringify(uniqueName || undefined)};`, `var register = ${runtimeTemplate.basicFunction( diff --git a/lib/sharing/utils.js b/lib/sharing/utils.js index b415df313d5..87ec3a0ffca 100644 --- a/lib/sharing/utils.js +++ b/lib/sharing/utils.js @@ -371,33 +371,29 @@ const getDescriptionFile = (fs, directory, descriptionFiles, callback) => { }; exports.getDescriptionFile = getDescriptionFile; -exports.getRequiredVersionFromDescriptionFile = (data, packageName) => { - if ( - data.optionalDependencies && - typeof data.optionalDependencies === "object" && - packageName in data.optionalDependencies - ) { - return normalizeVersion(data.optionalDependencies[packageName]); - } - if ( - data.dependencies && - typeof data.dependencies === "object" && - packageName in data.dependencies - ) { - return normalizeVersion(data.dependencies[packageName]); - } - if ( - data.peerDependencies && - typeof data.peerDependencies === "object" && - packageName in data.peerDependencies - ) { - return normalizeVersion(data.peerDependencies[packageName]); - } - if ( - data.devDependencies && - typeof data.devDependencies === "object" && - packageName in data.devDependencies - ) { - return normalizeVersion(data.devDependencies[packageName]); +/** + * + * @param {object} data description file data i.e.: package.json + * @param {string} packageName name of the dependency + * @returns {string} normalized version + */ +const getRequiredVersionFromDescriptionFile = (data, packageName) => { + const dependencyTypes = [ + "optionalDependencies", + "dependencies", + "peerDependencies", + "devDependencies" + ]; + + for (const dependencyType of dependencyTypes) { + if ( + data[dependencyType] && + typeof data[dependencyType] === "object" && + packageName in data[dependencyType] + ) { + return normalizeVersion(data[dependencyType][packageName]); + } } }; +exports.getRequiredVersionFromDescriptionFile = + getRequiredVersionFromDescriptionFile; diff --git a/lib/stats/DefaultStatsFactoryPlugin.js b/lib/stats/DefaultStatsFactoryPlugin.js index a18aa475c9d..70f0998be86 100644 --- a/lib/stats/DefaultStatsFactoryPlugin.js +++ b/lib/stats/DefaultStatsFactoryPlugin.js @@ -1068,7 +1068,7 @@ const SIMPLE_EXTRACTORS = { return childStatsChunkGroup; }) - ) + ) : undefined, childAssets: children ? mapObject(children, groups => { @@ -1082,7 +1082,7 @@ const SIMPLE_EXTRACTORS = { } } return Array.from(set); - }) + }) : undefined }; Object.assign(object, statsChunkGroup); @@ -1379,8 +1379,8 @@ const SIMPLE_EXTRACTORS = { chunk.runtime === undefined ? undefined : typeof chunk.runtime === "string" - ? [makePathsRelative(chunk.runtime)] - : Array.from(chunk.runtime.sort(), makePathsRelative), + ? [makePathsRelative(chunk.runtime)] + : Array.from(chunk.runtime.sort(), makePathsRelative), files: Array.from(chunk.files), auxiliaryFiles: Array.from(chunk.auxiliaryFiles).sort(compareIds), hash: chunk.renderedHash, @@ -1633,8 +1633,8 @@ const getItemSize = item => { return !item.children ? 1 : item.filteredChildren - ? 2 + getTotalSize(item.children) - : 1 + getTotalSize(item.children); + ? 2 + getTotalSize(item.children) + : 1 + getTotalSize(item.children); }; const getTotalSize = children => { @@ -1912,13 +1912,13 @@ const ASSETS_GROUPERS = { [name]: !!key, filteredChildren: assets.length, ...assetGroup(children, assets) - } + } : { type: "assets by status", [name]: !!key, children, ...assetGroup(children, assets) - }; + }; } }); }; @@ -2169,8 +2169,8 @@ const MODULES_GROUPERS = type => ({ type: isDataUrl ? "modules by mime type" : groupModulesByPath - ? "modules by path" - : "modules by extension", + ? "modules by path" + : "modules by extension", name: isDataUrl ? key.slice(/* 'data:'.length */ 5) : key, children, ...moduleGroup(children, modules) diff --git a/lib/stats/DefaultStatsPresetPlugin.js b/lib/stats/DefaultStatsPresetPlugin.js index 77795dcb905..983755904e2 100644 --- a/lib/stats/DefaultStatsPresetPlugin.js +++ b/lib/stats/DefaultStatsPresetPlugin.js @@ -197,8 +197,8 @@ const DEFAULTS = { runtime !== undefined ? runtime : forToString - ? all === true - : all !== false, + ? all === true + : all !== false, cachedModules: ({ all, cached }, { forToString }) => cached !== undefined ? cached : forToString ? all === true : all !== false, moduleAssets: OFF_FOR_TO_STRING, @@ -238,11 +238,7 @@ const DEFAULTS = { const normalizeFilter = item => { if (typeof item === "string") { const regExp = new RegExp( - `[\\\\/]${item.replace( - // eslint-disable-next-line no-useless-escape - /[-[\]{}()*+?.\\^$|]/g, - "\\$&" - )}([\\\\/]|$|!|\\?)` + `[\\\\/]${item.replace(/[-[\]{}()*+?.\\^$|]/g, "\\$&")}([\\\\/]|$|!|\\?)` ); return ident => regExp.test(ident); } diff --git a/lib/stats/DefaultStatsPrinterPlugin.js b/lib/stats/DefaultStatsPrinterPlugin.js index 20b19adc8a3..7821075ae6f 100644 --- a/lib/stats/DefaultStatsPrinterPlugin.js +++ b/lib/stats/DefaultStatsPrinterPlugin.js @@ -128,7 +128,7 @@ const SIMPLE_PRINTERS = { warningsCount > 0 ? yellow( `${warningsCount} ${plural(warningsCount, "warning", "warnings")}` - ) + ) : ""; const errorsMessage = errorsCount > 0 @@ -143,10 +143,10 @@ const SIMPLE_PRINTERS = { root && name ? bold(name) : name - ? `Child ${bold(name)}` - : root - ? "" - : "Child"; + ? `Child ${bold(name)}` + : root + ? "" + : "Child"; const subjectMessage = nameMessage && versionMessage ? `${nameMessage} (${versionMessage})` @@ -180,7 +180,7 @@ const SIMPLE_PRINTERS = { count, "warning has", "warnings have" - )} detailed information that is not shown.\nUse 'stats.errorDetails: true' resp. '--stats-error-details' to show it.` + )} detailed information that is not shown.\nUse 'stats.errorDetails: true' resp. '--stats-error-details' to show it.` : undefined, "compilation.filteredErrorDetailsCount": (count, { yellow }) => count @@ -190,7 +190,7 @@ const SIMPLE_PRINTERS = { "error has", "errors have" )} detailed information that is not shown.\nUse 'stats.errorDetails: true' resp. '--stats-error-details' to show it.` - ) + ) : undefined, "compilation.env": (env, { bold }) => env @@ -204,7 +204,7 @@ const SIMPLE_PRINTERS = { : printer.print(context.type, Object.values(entrypoints), { ...context, chunkGroupKind: "Entrypoint" - }), + }), "compilation.namedChunkGroups": (namedChunkGroups, context, printer) => { if (!Array.isArray(namedChunkGroups)) { const { @@ -234,15 +234,18 @@ const SIMPLE_PRINTERS = { filteredModules, "module", "modules" - )}` + )}` : undefined, - "compilation.filteredAssets": (filteredAssets, { compilation: { assets } }) => + "compilation.filteredAssets": ( + filteredAssets, + { compilation: { assets } } + ) => filteredAssets > 0 ? `${moreCount(assets, filteredAssets)} ${plural( filteredAssets, "asset", "assets" - )}` + )}` : undefined, "compilation.logging": (logging, context, printer) => Array.isArray(logging) @@ -251,7 +254,7 @@ const SIMPLE_PRINTERS = { context.type, Object.entries(logging).map(([name, value]) => ({ ...value, name })), context - ), + ), "compilation.warningsInChildren!": (_, { yellow, compilation }) => { if ( !compilation.children && @@ -324,7 +327,7 @@ const SIMPLE_PRINTERS = { sourceFilename === true ? "from source file" : `from: ${sourceFilename}` - ) + ) : undefined, "asset.info.development": (development, { green, formatFlag }) => development ? green(formatFlag("dev")) : undefined, @@ -339,7 +342,7 @@ const SIMPLE_PRINTERS = { filteredRelated, "asset", "assets" - )}` + )}` : undefined, "asset.filteredChildren": (filteredChildren, { asset: { children } }) => filteredChildren > 0 @@ -347,7 +350,7 @@ const SIMPLE_PRINTERS = { filteredChildren, "asset", "assets" - )}` + )}` : undefined, assetChunk: (id, { formatChunkId }) => formatChunkId(id), @@ -393,22 +396,22 @@ const SIMPLE_PRINTERS = { formatFlag( `${assets.length} ${plural(assets.length, "asset", "assets")}` ) - ) + ) : undefined, "module.warnings": (warnings, { formatFlag, yellow }) => warnings === true ? yellow(formatFlag("warnings")) : warnings - ? yellow( - formatFlag(`${warnings} ${plural(warnings, "warning", "warnings")}`) - ) - : undefined, + ? yellow( + formatFlag(`${warnings} ${plural(warnings, "warning", "warnings")}`) + ) + : undefined, "module.errors": (errors, { formatFlag, red }) => errors === true ? red(formatFlag("errors")) : errors - ? red(formatFlag(`${errors} ${plural(errors, "error", "errors")}`)) - : undefined, + ? red(formatFlag(`${errors} ${plural(errors, "error", "errors")}`)) + : undefined, "module.providedExports": (providedExports, { formatFlag, cyan }) => { if (Array.isArray(providedExports)) { if (providedExports.length === 0) return cyan(formatFlag("no exports")); @@ -449,7 +452,7 @@ const SIMPLE_PRINTERS = { filteredModules, "module", "modules" - )}` + )}` : undefined, "module.filteredReasons": (filteredReasons, { module: { reasons } }) => filteredReasons > 0 @@ -457,7 +460,7 @@ const SIMPLE_PRINTERS = { filteredReasons, "reason", "reasons" - )}` + )}` : undefined, "module.filteredChildren": (filteredChildren, { module: { children } }) => filteredChildren > 0 @@ -465,7 +468,7 @@ const SIMPLE_PRINTERS = { filteredChildren, "module", "modules" - )}` + )}` : undefined, "module.separator!": () => "\n", @@ -492,7 +495,7 @@ const SIMPLE_PRINTERS = { filteredChildren, "reason", "reasons" - )}` + )}` : undefined, "module.profile.total": (value, { formatTime }) => formatTime(value), @@ -533,7 +536,7 @@ const SIMPLE_PRINTERS = { n, "asset", "assets" - )}` + )}` : undefined, "chunkGroup.is!": () => "=", "chunkGroupAsset.name": (asset, { green }) => green(asset), @@ -552,7 +555,7 @@ const SIMPLE_PRINTERS = { children: children[key] })), context - ), + ), "chunkGroupChildGroup.type": type => `${type}:`, "chunkGroupChild.assets[]": (file, { formatFilename }) => formatFilename(file), @@ -581,7 +584,7 @@ const SIMPLE_PRINTERS = { children: childrenByOrder[key] })), context - ), + ), "chunk.childrenByOrder[].type": type => `${type}:`, "chunk.childrenByOrder[].children[]": (id, { formatChunkId }) => isValidId(id) ? formatChunkId(id) : undefined, @@ -600,7 +603,7 @@ const SIMPLE_PRINTERS = { filteredModules, "module", "modules" - )}` + )}` : undefined, "chunk.separator!": () => "\n", @@ -1354,7 +1357,7 @@ class DefaultStatsPrinterPlugin { ? str.replace( /((\u001b\[39m|\u001b\[22m|\u001b\[0m)+)/g, `$1${start}` - ) + ) : str }\u001b[39m\u001b[22m`; } else { diff --git a/lib/util/chainedImports.js b/lib/util/chainedImports.js new file mode 100644 index 00000000000..686e5d9e5c1 --- /dev/null +++ b/lib/util/chainedImports.js @@ -0,0 +1,97 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +"use strict"; + +/** @typedef {import("../Dependency")} Dependency */ +/** @typedef {import("../Module")} Module */ +/** @typedef {import("../ModuleGraph")} ModuleGraph */ +/** @typedef {import("../javascript/JavascriptParser").Range} Range */ + +/** + * @summary Get the subset of ids and their corresponding range in an id chain that should be re-rendered by webpack. + * Only those in the chain that are actually referring to namespaces or imports should be re-rendered. + * Deeper member accessors on the imported object should not be re-rendered. If deeper member accessors are re-rendered, + * there is a potential loss of meaning with rendering a quoted accessor as an unquoted accessor, or vice versa, + * because minifiers treat quoted accessors differently. e.g. import { a } from "./module"; a["b"] vs a.b + * @param {string[]} untrimmedIds chained ids + * @param {Range} untrimmedRange range encompassing allIds + * @param {Range[] | undefined} ranges cumulative range of ids for each of allIds + * @param {ModuleGraph} moduleGraph moduleGraph + * @param {Dependency} dependency dependency + * @returns {{trimmedIds: string[], trimmedRange: Range}} computed trimmed ids and cumulative range of those ids + */ +exports.getTrimmedIdsAndRange = ( + untrimmedIds, + untrimmedRange, + ranges, + moduleGraph, + dependency +) => { + let trimmedIds = trimIdsToThoseImported( + untrimmedIds, + moduleGraph, + dependency + ); + let trimmedRange = untrimmedRange; + if (trimmedIds.length !== untrimmedIds.length) { + // The array returned from dep.idRanges is right-aligned with the array returned from dep.names. + // Meaning, the two arrays may not always have the same number of elements, but the last element of + // dep.idRanges corresponds to [the expression fragment to the left of] the last element of dep.names. + // Use this to find the correct replacement range based on the number of ids that were trimmed. + const idx = + ranges === undefined + ? -1 /* trigger failure case below */ + : ranges.length + (trimmedIds.length - untrimmedIds.length); + if (idx < 0 || idx >= /** @type {Range[]} */ (ranges).length) { + // cspell:ignore minifiers + // Should not happen but we can't throw an error here because of backward compatibility with + // external plugins in wp5. Instead, we just disable trimming for now. This may break some minifiers. + trimmedIds = untrimmedIds; + // TODO webpack 6 remove the "trimmedIds = ids" above and uncomment the following line instead. + // throw new Error("Missing range starts data for id replacement trimming."); + } else { + trimmedRange = /** @type {Range[]} */ (ranges)[idx]; + } + } + + return { trimmedIds, trimmedRange }; +}; + +/** + * @summary Determine which IDs in the id chain are actually referring to namespaces or imports, + * and which are deeper member accessors on the imported object. + * @param {string[]} ids untrimmed ids + * @param {ModuleGraph} moduleGraph moduleGraph + * @param {Dependency} dependency dependency + * @returns {string[]} trimmed ids + */ +function trimIdsToThoseImported(ids, moduleGraph, dependency) { + /** @type {string[]} */ + let trimmedIds = []; + let currentExportsInfo = moduleGraph.getExportsInfo( + /** @type {Module} */ (moduleGraph.getModule(dependency)) + ); + for (let i = 0; i < ids.length; i++) { + if (i === 0 && ids[i] === "default") { + continue; // ExportInfo for the next level under default is still at the root ExportsInfo, so don't advance currentExportsInfo + } + const exportInfo = currentExportsInfo.getExportInfo(ids[i]); + if (exportInfo.provided === false) { + // json imports have nested ExportInfo for elements that things that are not actually exported, so check .provided + trimmedIds = ids.slice(0, i); + break; + } + const nestedInfo = exportInfo.getNestedExportsInfo(); + if (!nestedInfo) { + // once all nested exports are traversed, the next item is the actual import so stop there + trimmedIds = ids.slice(0, i + 1); + break; + } + currentExportsInfo = nestedInfo; + } + // Never trim to nothing. This can happen for invalid imports (e.g. import { notThere } from "./module", or import { anything } from "./missingModule") + return trimmedIds.length ? trimmedIds : ids; +} diff --git a/lib/util/cleverMerge.js b/lib/util/cleverMerge.js index f86934cc502..1621cc799c8 100644 --- a/lib/util/cleverMerge.js +++ b/lib/util/cleverMerge.js @@ -457,8 +457,8 @@ const mergeSingleValue = (a, b, internalCaching) => { return aType !== VALUE_TYPE_OBJECT ? b : internalCaching - ? cachedCleverMerge(a, b) - : cleverMerge(a, b); + ? cachedCleverMerge(a, b) + : cleverMerge(a, b); } case VALUE_TYPE_UNDEFINED: return a; @@ -467,8 +467,8 @@ const mergeSingleValue = (a, b, internalCaching) => { aType !== VALUE_TYPE_ATOM ? aType : Array.isArray(a) - ? VALUE_TYPE_ARRAY_EXTEND - : VALUE_TYPE_OBJECT + ? VALUE_TYPE_ARRAY_EXTEND + : VALUE_TYPE_OBJECT ) { case VALUE_TYPE_UNDEFINED: return b; diff --git a/lib/util/comparators.js b/lib/util/comparators.js index 790c147ad8b..86b11ad9189 100644 --- a/lib/util/comparators.js +++ b/lib/util/comparators.js @@ -92,32 +92,68 @@ exports.compareNumbers = compareNumbers; * @returns {-1|0|1} compare result */ const compareStringsNumeric = (a, b) => { - const partsA = a.split(/(\d+)/); - const partsB = b.split(/(\d+)/); - const len = Math.min(partsA.length, partsB.length); - for (let i = 0; i < len; i++) { - const pA = partsA[i]; - const pB = partsB[i]; - if (i % 2 === 0) { - if (pA.length > pB.length) { - if (pA.slice(0, pB.length) > pB) return 1; - return -1; - } else if (pB.length > pA.length) { - if (pB.slice(0, pA.length) > pA) return -1; - return 1; - } else { - if (pA < pB) return -1; - if (pA > pB) return 1; - } + const aLength = a.length; + const bLength = b.length; + + let aChar = 0; + let bChar = 0; + + let aIsDigit = false; + let bIsDigit = false; + let i = 0; + let j = 0; + while (i < aLength && j < bLength) { + aChar = a.charCodeAt(i); + bChar = b.charCodeAt(j); + + aIsDigit = aChar >= 48 && aChar <= 57; + bIsDigit = bChar >= 48 && bChar <= 57; + + if (!aIsDigit && !bIsDigit) { + if (aChar < bChar) return -1; + if (aChar > bChar) return 1; + i++; + j++; + } else if (aIsDigit && !bIsDigit) { + // This segment of a is shorter than in b + return 1; + } else if (!aIsDigit && bIsDigit) { + // This segment of b is shorter than in a + return -1; } else { - const nA = +pA; - const nB = +pB; - if (nA < nB) return -1; - if (nA > nB) return 1; + let aNumber = aChar - 48; + let bNumber = bChar - 48; + + while (++i < aLength) { + aChar = a.charCodeAt(i); + if (aChar < 48 || aChar > 57) break; + aNumber = aNumber * 10 + aChar - 48; + } + + while (++j < bLength) { + bChar = b.charCodeAt(j); + if (bChar < 48 || bChar > 57) break; + bNumber = bNumber * 10 + bChar - 48; + } + + if (aNumber < bNumber) return -1; + if (aNumber > bNumber) return 1; } } - if (partsB.length < partsA.length) return 1; - if (partsB.length > partsA.length) return -1; + + if (j < bLength) { + // a is shorter than b + bChar = b.charCodeAt(j); + bIsDigit = bChar >= 48 && bChar <= 57; + return bIsDigit ? -1 : 1; + } + if (i < aLength) { + // b is shorter than a + aChar = a.charCodeAt(i); + aIsDigit = aChar >= 48 && aChar <= 57; + return aIsDigit ? 1 : -1; + } + return 0; }; exports.compareStringsNumeric = compareStringsNumeric; diff --git a/lib/util/hash/xxhash64.js b/lib/util/hash/xxhash64.js index 98e9bd6be6a..0cc3fd48b7d 100644 --- a/lib/util/hash/xxhash64.js +++ b/lib/util/hash/xxhash64.js @@ -10,8 +10,8 @@ const create = require("./wasm-hash"); //#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1 const xxhash64 = new WebAssembly.Module( Buffer.from( - // 1170 bytes - "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrIIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAFBIGoiASAASQ0ACyACJAAgAyQBIAQkAiAFJAMLqAYCAX8EfiMEQgBSBH4jACICQgGJIwEiA0IHiXwjAiIEQgyJfCMDIgVCEol8IAJCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gA0LP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAEQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAVCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQIDQCABQQhqIABNBEAgAiABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQIgAUEIaiEBDAELCyABQQRqIABNBEAgAiABNQIAQoeVr6+Ytt6bnn9+hUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAiABQQRqIQELA0AgACABRwRAIAIgATEAAELFz9my8eW66id+hUILiUKHla+vmLbem55/fiECIAFBAWohAQwBCwtBACACIAJCIYiFQs/W077Sx6vZQn4iAkIdiCAChUL5893xmfaZqxZ+IgJCIIggAoUiAkIgiCIDQv//A4NCIIYgA0KAgPz/D4NCEIiEIgNC/4GAgPAfg0IQhiADQoD+g4CA4D+DQgiIhCIDQo+AvIDwgcAHg0IIhiADQvCBwIeAnoD4AINCBIiEIgNChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IANCsODAgYOGjJgwhHw3AwBBCCACQv////8PgyICQv//A4NCIIYgAkKAgPz/D4NCEIiEIgJC/4GAgPAfg0IQhiACQoD+g4CA4D+DQgiIhCICQo+AvIDwgcAHg0IIhiACQvCBwIeAnoD4AINCBIiEIgJChoyYsODAgYMGfEIEiEKBgoSIkKDAgAGDQid+IAJCsODAgYOGjJgwhHw3AwAL", + // 1168 bytes + "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrAIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAFBIGoiASAASQ0ACyACJAAgAyQBIAQkAiAFJAMLpgYCAn8EfiMEQgBSBH4jACIDQgGJIwEiBEIHiXwjAiIFQgyJfCMDIgZCEol8IANCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gBELP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAFQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAZCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQMDQCABQQhqIgIgAE0EQCADIAEpAwBCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCG4lCh5Wvr5i23puef35CnaO16oOxjYr6AH0hAyACIQEMAQsLIAFBBGoiAiAATQRAIAMgATUCAEKHla+vmLbem55/foVCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMgAiEBCwNAIAAgAUcEQCADIAExAABCxc/ZsvHluuonfoVCC4lCh5Wvr5i23puef34hAyABQQFqIQEMAQsLQQAgAyADQiGIhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFIgNCIIgiBEL//wODQiCGIARCgID8/w+DQhCIhCIEQv+BgIDwH4NCEIYgBEKA/oOAgOA/g0IIiIQiBEKPgLyA8IHAB4NCCIYgBELwgcCHgJ6A+ACDQgSIhCIEQoaMmLDgwIGDBnxCBIhCgYKEiJCgwIABg0InfiAEQrDgwIGDhoyYMIR8NwMAQQggA0L/////D4MiA0L//wODQiCGIANCgID8/w+DQhCIhCIDQv+BgIDwH4NCEIYgA0KA/oOAgOA/g0IIiIQiA0KPgLyA8IHAB4NCCIYgA0LwgcCHgJ6A+ACDQgSIhCIDQoaMmLDgwIGDBnxCBIhCgYKEiJCgwIABg0InfiADQrDgwIGDhoyYMIR8NwMACw==", "base64" ) ); diff --git a/lib/util/identifier.js b/lib/util/identifier.js index ea5ec2eaa39..659988163be 100644 --- a/lib/util/identifier.js +++ b/lib/util/identifier.js @@ -376,6 +376,6 @@ exports.getUndoPath = (filename, outputPath, enforceRelative) => { return depth > 0 ? `${"../".repeat(depth)}${append}` : enforceRelative - ? `./${append}` - : append; + ? `./${append}` + : append; }; diff --git a/lib/util/internalSerializables.js b/lib/util/internalSerializables.js index 9c4d80f0237..1cd63dbd5d5 100644 --- a/lib/util/internalSerializables.js +++ b/lib/util/internalSerializables.js @@ -45,6 +45,10 @@ module.exports = { require("../dependencies/AMDRequireItemDependency"), "dependencies/CachedConstDependency": () => require("../dependencies/CachedConstDependency"), + "dependencies/ExternalModuleDependency": () => + require("../dependencies/ExternalModuleDependency"), + "dependencies/ExternalModuleInitFragment": () => + require("../dependencies/ExternalModuleInitFragment"), "dependencies/CreateScriptUrlDependency": () => require("../dependencies/CreateScriptUrlDependency"), "dependencies/CommonJsRequireContextDependency": () => @@ -206,6 +210,8 @@ module.exports = { "util/LazySet": () => require("../util/LazySet"), UnhandledSchemeError: () => require("../UnhandledSchemeError"), NodeStuffInWebError: () => require("../NodeStuffInWebError"), + EnvironmentNotSupportAsyncWarning: () => + require("../EnvironmentNotSupportAsyncWarning"), WebpackError: () => require("../WebpackError"), "util/registerExternalSerializer": () => { diff --git a/lib/util/numberHash.js b/lib/util/numberHash.js index f7150d135b9..95d79ec1d3c 100644 --- a/lib/util/numberHash.js +++ b/lib/util/numberHash.js @@ -6,36 +6,80 @@ "use strict"; /** - * The maximum safe integer value for 32-bit integers. + * Threshold for switching from 32-bit to 64-bit hashing. This is selected to ensure that the bias towards lower modulo results when using 32-bit hashing is <0.5%. * @type {number} */ -const SAFE_LIMIT = 0x80000000; +const FNV_64_THRESHOLD = 1 << 24; /** - * The maximum safe integer value for 32-bit integers minus one. This is used - * in the algorithm to ensure that intermediate hash values do not exceed the - * 32-bit integer limit. + * The FNV-1a offset basis for 32-bit hash values. * @type {number} */ -const SAFE_PART = SAFE_LIMIT - 1; - +const FNV_OFFSET_32 = 2166136261; /** - * The number of 32-bit integers used to store intermediate hash values. + * The FNV-1a prime for 32-bit hash values. * @type {number} */ -const COUNT = 4; +const FNV_PRIME_32 = 16777619; +/** + * The mask for a positive 32-bit signed integer. + * @type {number} + */ +const MASK_31 = 0x7fffffff; + +/** + * The FNV-1a offset basis for 64-bit hash values. + * @type {bigint} + */ +const FNV_OFFSET_64 = BigInt("0xCBF29CE484222325"); +/** + * The FNV-1a prime for 64-bit hash values. + * @type {bigint} + */ +const FNV_PRIME_64 = BigInt("0x100000001B3"); /** - * An array used to store intermediate hash values during the calculation. - * @type {number[]} + * Computes a 32-bit FNV-1a hash value for the given string. + * See https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function + * @param {string} str The input string to hash + * @returns {number} - The computed hash value. */ -const arr = [0, 0, 0, 0, 0]; +function fnv1a32(str) { + let hash = FNV_OFFSET_32; + for (let i = 0, len = str.length; i < len; i++) { + let code = str.charCodeAt(i); + if (code > 0xff) { + hash ^= code & 0xff; + hash = (hash * FNV_PRIME_32) | 0; + code >>= 8; + } + hash ^= code; + hash = (hash * FNV_PRIME_32) | 0; + } + // Force the result to be positive + return hash & MASK_31; +} /** - * An array of prime numbers used in the hash calculation. - * @type {number[]} + * Computes a 64-bit FNV-1a hash value for the given string. + * See https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function + * @param {string} str The input string to hash + * @returns {bigint} - The computed hash value. */ -const primes = [3, 7, 17, 19]; +function fnv1a64(str) { + let hash = FNV_OFFSET_64; + for (let i = 0, len = str.length; i < len; i++) { + let code = str.charCodeAt(i); + if (code > 0xff) { + hash ^= BigInt(code & 0xff); + hash = BigInt.asUintN(64, hash * FNV_PRIME_64); + code >>= 8; + } + hash ^= BigInt(code); + hash = BigInt.asUintN(64, hash * FNV_PRIME_64); + } + return hash; +} /** * Computes a hash value for the given string and range. This hashing algorithm is a modified @@ -53,47 +97,15 @@ const primes = [3, 7, 17, 19]; * * ```js * const numberHash = require("webpack/lib/util/numberHash"); - * numberHash("hello", 1000); // 57 - * numberHash("hello world"); // 990 + * numberHash("hello", 1000); // 73 + * numberHash("hello world"); // 72 * ``` * */ module.exports = (str, range) => { - /** - * Initialize the array with zeros before it is used - * to store intermediate hash values. - */ - arr.fill(0); - // For each character in the string - for (let i = 0; i < str.length; i++) { - // Get the character code. - const c = str.charCodeAt(i); - - // For each 32-bit integer used to store the hash value - // add the character code to the current hash value and multiply by the prime number and - // add the previous 32-bit integer. - arr[0] = (arr[0] + c * primes[0] + arr[3]) & SAFE_PART; - arr[1] = (arr[1] + c * primes[1] + arr[0]) & SAFE_PART; - arr[2] = (arr[2] + c * primes[2] + arr[1]) & SAFE_PART; - arr[3] = (arr[3] + c * primes[3] + arr[2]) & SAFE_PART; - - // For each 32-bit integer used to store the hash value - // XOR the current hash value with the value of the next 32-bit integer. - arr[0] = arr[0] ^ (arr[arr[0] % COUNT] >> 1); - arr[1] = arr[1] ^ (arr[arr[1] % COUNT] >> 1); - arr[2] = arr[2] ^ (arr[arr[2] % COUNT] >> 1); - arr[3] = arr[3] ^ (arr[arr[3] % COUNT] >> 1); - } - - if (range <= SAFE_PART) { - return (arr[0] + arr[1] + arr[2] + arr[3]) % range; + if (range < FNV_64_THRESHOLD) { + return fnv1a32(str) % range; } else { - // Calculate the range extension. - const rangeExt = Math.floor(range / SAFE_LIMIT); - - const sum1 = (arr[0] + arr[2]) & SAFE_PART; - const sum2 = (arr[0] + arr[2]) % rangeExt; - - return (sum2 * SAFE_LIMIT + sum1) % range; + return Number(fnv1a64(str) % BigInt(range)); } }; diff --git a/lib/util/runtime.js b/lib/util/runtime.js index 59da3bfefb6..2903ec2a8d6 100644 --- a/lib/util/runtime.js +++ b/lib/util/runtime.js @@ -57,7 +57,7 @@ exports.getEntryRuntime = (compilation, name, options) => { * @param {boolean} deterministicOrder enforce a deterministic order * @returns {void} */ -exports.forEachRuntime = (runtime, fn, deterministicOrder = false) => { +const forEachRuntime = (runtime, fn, deterministicOrder = false) => { if (runtime === undefined) { fn(undefined); } else if (typeof runtime === "string") { @@ -69,6 +69,7 @@ exports.forEachRuntime = (runtime, fn, deterministicOrder = false) => { } } }; +exports.forEachRuntime = forEachRuntime; /** * @template T @@ -228,6 +229,22 @@ const mergeRuntime = (a, b) => { }; exports.mergeRuntime = mergeRuntime; +/** + * @param {RuntimeSpec[]} runtimes first + * @param {RuntimeSpec} runtime second + * @returns {RuntimeSpec} merged + */ +exports.deepMergeRuntime = (runtimes, runtime) => { + if (!Array.isArray(runtimes)) { + return runtime; + } + let merged = runtime; + for (const r of runtimes) { + merged = mergeRuntime(runtime, r); + } + return merged; +}; + /** * @param {RuntimeCondition} a first * @param {RuntimeCondition} b second diff --git a/lib/util/semver.js b/lib/util/semver.js index ba917dd4f89..b748007970c 100644 --- a/lib/util/semver.js +++ b/lib/util/semver.js @@ -232,16 +232,15 @@ const rangeToString = range => { fixCount == 0 ? ">=" : fixCount == -1 - ? "<" - : fixCount == 1 - ? "^" - : fixCount == 2 - ? "~" - : fixCount > 0 - ? "=" - : "!="; + ? "<" + : fixCount == 1 + ? "^" + : fixCount == 2 + ? "~" + : fixCount > 0 + ? "=" + : "!="; var needDot = 1; - // eslint-disable-next-line no-redeclare for (var i = 1; i < range.length; i++) { var item = range[i]; var t = (typeof item)[0]; @@ -249,9 +248,9 @@ const rangeToString = range => { str += t == "u" ? // undefined: prerelease marker, add an "-" - "-" + "-" : // number or string: add the item, set flag to add an "." between two of them - (needDot > 0 ? "." : "") + ((needDot = 2), item); + (needDot > 0 ? "." : "") + ((needDot = 2), item); } return str; } else { @@ -264,10 +263,10 @@ const rangeToString = range => { item === 0 ? "not(" + pop() + ")" : item === 1 - ? "(" + pop() + " || " + pop() + ")" - : item === 2 - ? stack.pop() + " " + stack.pop() - : rangeToString(item) + ? "(" + pop() + " || " + pop() + ")" + : item === 2 + ? stack.pop() + " " + stack.pop() + : rangeToString(item) ); } return pop(); @@ -416,10 +415,10 @@ const satisfy = (range, version) => { item == 1 ? p() | p() : item == 2 - ? p() & p() - : item - ? satisfy(item, version) - : !p() + ? p() & p() + : item + ? satisfy(item, version) + : !p() ); } return !!p(); @@ -452,11 +451,7 @@ exports.stringifyHoley = json => { exports.parseVersionRuntimeCode = runtimeTemplate => `var parseVersion = ${runtimeTemplate.basicFunction("str", [ "// see webpack/lib/util/semver.js for original code", - `var p=${ - runtimeTemplate.supportsArrowFunction() ? "p=>" : "function(p)" - }{return p.split(".").map((${ - runtimeTemplate.supportsArrowFunction() ? "p=>" : "function(p)" - }{return+p==p?+p:p}))},n=/^([^-+]+)?(?:-([^+]+))?(?:\\+(.+))?$/.exec(str),r=n[1]?p(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,p(n[2]))),n[3]&&(r.push([]),r.push.apply(r,p(n[3]))),r;` + `var p=${runtimeTemplate.supportsArrowFunction() ? "p=>" : "function(p)"}{return p.split(".").map((${runtimeTemplate.supportsArrowFunction() ? "p=>" : "function(p)"}{return+p==p?+p:p}))},n=/^([^-+]+)?(?:-([^+]+))?(?:\\+(.+))?$/.exec(str),r=n[1]?p(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,p(n[2]))),n[3]&&(r.push([]),r.push.apply(r,p(n[3]))),r;` ])}`; //#endregion diff --git a/lib/util/smartGrouping.js b/lib/util/smartGrouping.js index ae4132a60f1..01d1d4bec8e 100644 --- a/lib/util/smartGrouping.js +++ b/lib/util/smartGrouping.js @@ -145,7 +145,7 @@ const smartGrouping = (items, groupConfigs) => { (totalSize * 2) / targetGroupCount + itemsWithGroups.size - items.size - ); + ); if ( sizeValue > bestGroupSize || (force && (!bestGroupOptions || !bestGroupOptions.force)) diff --git a/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js b/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js index 651758727b0..4f8c673e1b0 100644 --- a/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +++ b/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js @@ -52,38 +52,63 @@ class AsyncWasmLoadingRuntimeModule extends RuntimeModule { runtime: chunk.runtime } ); - return `${fn} = ${runtimeTemplate.basicFunction( - "exports, wasmModuleId, wasmModuleHash, importsObj", - [ - `var req = ${this.generateLoadBinaryCode(wasmModuleSrcPath)};`, - this.supportsStreaming - ? Template.asString([ - "if (typeof WebAssembly.instantiateStreaming === 'function') {", + + const loader = this.generateLoadBinaryCode(wasmModuleSrcPath); + const fallback = [ + `.then(${runtimeTemplate.returningFunction("x.arrayBuffer()", "x")})`, + `.then(${runtimeTemplate.returningFunction( + "WebAssembly.instantiate(bytes, importsObj)", + "bytes" + )})`, + `.then(${runtimeTemplate.returningFunction( + "Object.assign(exports, res.instance.exports)", + "res" + )})` + ]; + const getStreaming = () => { + const concat = (/** @type {string[]} */ ...text) => text.join(""); + return [ + `var req = ${loader};`, + `var fallback = ${runtimeTemplate.returningFunction(Template.asString(["req", Template.indent(fallback)]))};`, + concat( + "return req.then(", + runtimeTemplate.basicFunction("res", [ + `if (typeof WebAssembly.instantiateStreaming === "function") {`, + Template.indent([ + "return WebAssembly.instantiateStreaming(res, importsObj)", Template.indent([ - "return WebAssembly.instantiateStreaming(req, importsObj)", + ".then(", Template.indent([ - `.then(${runtimeTemplate.returningFunction( + runtimeTemplate.returningFunction( "Object.assign(exports, res.instance.exports)", "res" - )});` - ]) - ]), - "}" - ]) - : "// no support for streaming compilation", - "return req", - Template.indent([ - `.then(${runtimeTemplate.returningFunction("x.arrayBuffer()", "x")})`, - `.then(${runtimeTemplate.returningFunction( - "WebAssembly.instantiate(bytes, importsObj)", - "bytes" - )})`, - `.then(${runtimeTemplate.returningFunction( - "Object.assign(exports, res.instance.exports)", - "res" - )});` - ]) - ] + ) + ",", + runtimeTemplate.basicFunction("e", [ + `if(res.headers.get("Content-Type") !== "application/wasm") {`, + Template.indent([ + 'console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n", e);', + "return fallback();" + ]), + "}", + "throw e;" + ]) + ]), + ");" + ]) + ]), + "}", + "return fallback();" + ]), + ");" + ) + ]; + }; + + return `${fn} = ${runtimeTemplate.basicFunction( + "exports, wasmModuleId, wasmModuleHash, importsObj", + this.supportsStreaming + ? getStreaming() + : [`return ${loader}`, Template.indent(fallback) + ";"] )};`; } } diff --git a/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js b/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js index baa713330b1..663504dd182 100644 --- a/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +++ b/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js @@ -156,7 +156,7 @@ class AsyncWebAssemblyJavascriptGenerator extends Generator { "{", Template.indent(importObjRequestItems.join(",\n")), "}" - ]) + ]) : undefined; const instantiateCall = @@ -194,7 +194,7 @@ class AsyncWebAssemblyJavascriptGenerator extends Generator { "} catch(e) { __webpack_async_result__(e); }" ] )}, 1);` - ]) + ]) : `${importsCode}${importsCompatCode}module.exports = ${instantiateCall};` ); diff --git a/lib/wasm-async/AsyncWebAssemblyParser.js b/lib/wasm-async/AsyncWebAssemblyParser.js index 4a9632cbd56..40f1c79eacc 100644 --- a/lib/wasm-async/AsyncWebAssemblyParser.js +++ b/lib/wasm-async/AsyncWebAssemblyParser.js @@ -7,6 +7,7 @@ const t = require("@webassemblyjs/ast"); const { decode } = require("@webassemblyjs/wasm-parser"); +const EnvironmentNotSupportAsyncWarning = require("../EnvironmentNotSupportAsyncWarning"); const Parser = require("../Parser"); const StaticExportsDependency = require("../dependencies/StaticExportsDependency"); const WebAssemblyImportDependency = require("../dependencies/WebAssemblyImportDependency"); @@ -50,6 +51,11 @@ class WebAssemblyParser extends Parser { const BuildMeta = /** @type {BuildMeta} */ (state.module.buildMeta); BuildMeta.exportsType = "namespace"; BuildMeta.async = true; + EnvironmentNotSupportAsyncWarning.check( + state.module, + state.compilation.runtimeTemplate, + "asyncWebAssembly" + ); // parse it const program = decode(source, decoderOpts); diff --git a/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js b/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js index d5265c9655b..ed01c4f1396 100644 --- a/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +++ b/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js @@ -354,7 +354,7 @@ class WasmChunkLoadingRuntimeModule extends RuntimeModule { "importObject" )});` ]) - ]) + ]) : Template.asString([ "if(importObject && typeof importObject.then === 'function') {", Template.indent([ @@ -372,7 +372,7 @@ class WasmChunkLoadingRuntimeModule extends RuntimeModule { ]), "});" ]) - ]), + ]), "} else {", Template.indent([ "var bytesPromise = req.then(function(x) { return x.arrayBuffer(); });", diff --git a/lib/wasm-sync/WebAssemblyJavascriptGenerator.js b/lib/wasm-sync/WebAssemblyJavascriptGenerator.js index 448ae7b7a58..1b5ca88dfb4 100644 --- a/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +++ b/lib/wasm-sync/WebAssemblyJavascriptGenerator.js @@ -200,8 +200,8 @@ class WebAssemblyJavascriptGenerator extends Generator { copyAllExports ? `${module.moduleArgument}.exports = wasmExports;` : "for(var name in wasmExports) " + - `if(name) ` + - `${module.exportsArgument}[name] = wasmExports[name];`, + `if(name) ` + + `${module.exportsArgument}[name] = wasmExports[name];`, "// exec imports from WebAssembly module (for esm order)", importsCode, "", diff --git a/lib/web/JsonpChunkLoadingRuntimeModule.js b/lib/web/JsonpChunkLoadingRuntimeModule.js index 32e12f5e580..32d37577f5a 100644 --- a/lib/web/JsonpChunkLoadingRuntimeModule.js +++ b/lib/web/JsonpChunkLoadingRuntimeModule.js @@ -209,16 +209,16 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { "}" ]), "}" - ]) + ]) : Template.indent(["installedChunks[chunkId] = 0;"]) )};` - ]) + ]) : "// no chunk on demand loading", "", withPrefetch && hasJsMatcher !== false ? `${ RuntimeGlobals.prefetchChunkHandlers - }.j = ${runtimeTemplate.basicFunction("chunkId", [ + }.j = ${runtimeTemplate.basicFunction("chunkId", [ `if((!${ RuntimeGlobals.hasOwnProperty }(installedChunks, chunkId) || installedChunks[chunkId] === undefined) && ${ @@ -232,7 +232,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { crossOriginLoading ? `link.crossOrigin = ${JSON.stringify( crossOriginLoading - )};` + )};` : "", `if (${RuntimeGlobals.scriptNonce}) {`, Template.indent( @@ -248,13 +248,13 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { "document.head.appendChild(link);" ]), "}" - ])};` + ])};` : "// no prefetching", "", withPreload && hasJsMatcher !== false ? `${ RuntimeGlobals.preloadChunkHandlers - }.j = ${runtimeTemplate.basicFunction("chunkId", [ + }.j = ${runtimeTemplate.basicFunction("chunkId", [ `if((!${ RuntimeGlobals.hasOwnProperty }(installedChunks, chunkId) || installedChunks[chunkId] === undefined) && ${ @@ -290,7 +290,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { )};` ), "}" - ]) + ]) : "" ]), chunk @@ -298,7 +298,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { "document.head.appendChild(link);" ]), "}" - ])};` + ])};` : "// no preloaded", "", withHmr @@ -383,7 +383,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { /\$hmrInvalidateModuleHandlers\$/g, RuntimeGlobals.hmrInvalidateModuleHandlers ) - ]) + ]) : "// no HMR", "", withHmrManifest @@ -400,16 +400,16 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { "return response.json();" ])});` ])};` - ]) + ]) : "// no HMR manifest", "", withOnChunkLoad ? `${ RuntimeGlobals.onChunksLoaded - }.j = ${runtimeTemplate.returningFunction( + }.j = ${runtimeTemplate.returningFunction( "installedChunks[chunkId] === 0", "chunkId" - )};` + )};` : "// no on chunks loaded", "", withCallback || withLoading @@ -461,7 +461,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { `var chunkLoadingGlobal = ${chunkLoadingGlobalExpr} = ${chunkLoadingGlobalExpr} || [];`, "chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));", "chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));" - ]) + ]) : "// no jsonp function" ]); } diff --git a/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js b/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js index 12219e1885d..a17b92bef22 100644 --- a/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +++ b/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js @@ -128,7 +128,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { Template.indent("installedChunks[chunkIds.pop()] = 1;"), "parentChunkLoadingFunction(data);" ])};` - ]) + ]) : "// no chunk install function needed", withLoading ? Template.asString([ @@ -152,14 +152,14 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { "}" ]), "}" - ] + ] : "installedChunks[chunkId] = 1;" )};`, "", `var chunkLoadingGlobal = ${chunkLoadingGlobalExpr} = ${chunkLoadingGlobalExpr} || [];`, "var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);", "chunkLoadingGlobal.push = installChunk;" - ]) + ]) : "// no chunk loading", "", withHmr @@ -196,7 +196,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { Template.getFunctionContent( require("../hmr/JavascriptHotModuleReplacement.runtime.js") ) - .replace(/\$key\$/g, "importScrips") + .replace(/\$key\$/g, "importScripts") .replace(/\$installedChunks\$/g, "installedChunks") .replace(/\$loadUpdateChunk\$/g, "loadUpdateChunk") .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) @@ -215,7 +215,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { /\$hmrInvalidateModuleHandlers\$/g, RuntimeGlobals.hmrInvalidateModuleHandlers ) - ]) + ]) : "// no HMR", "", withHmrManifest @@ -232,7 +232,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { "return response.json();" ])});` ])};` - ]) + ]) : "// no HMR manifest" ]); } diff --git a/package.json b/package.json index 10b9bc53257..b69661c24e0 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,18 @@ { "name": "webpack", - "version": "5.88.2", + "version": "5.90.1", "author": "Tobias Koppers @sokra", "description": "Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.", "license": "MIT", "dependencies": { "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", + "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.11.5", "@webassemblyjs/wasm-edit": "^1.11.5", "@webassemblyjs/wasm-parser": "^1.11.5", "acorn": "^8.7.1", "acorn-import-assertions": "^1.9.0", - "browserslist": "^4.14.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.15.0", "es-module-lexer": "^1.2.1", @@ -26,7 +26,7 @@ "neo-async": "^2.6.2", "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", + "terser-webpack-plugin": "^5.3.10", "watchpack": "^2.4.0", "webpack-sources": "^3.2.3" }, @@ -36,12 +36,12 @@ } }, "devDependencies": { - "@babel/core": "^7.21.4", - "@babel/preset-react": "^7.18.6", - "@types/jest": "^29.5.0", - "@types/mime-types": "^2.1.1", + "@babel/core": "^7.23.7", + "@babel/preset-react": "^7.23.3", + "@types/jest": "^29.5.11", + "@types/mime-types": "^2.1.4", "@types/node": "^20.1.7", - "assemblyscript": "^0.27.2", + "assemblyscript": "^0.27.22", "babel-loader": "^8.1.0", "benchmark": "^2.1.4", "bundle-loader": "^0.5.6", @@ -51,26 +51,26 @@ "coveralls": "^3.1.0", "cspell": "^6.31.1", "css-loader": "^5.0.1", - "date-fns": "^2.15.0", + "date-fns": "^3.2.0", "es5-ext": "^0.10.53", "es6-promise-polyfill": "^1.2.0", - "eslint": "^8.38.0", - "eslint-config-prettier": "^8.1.0", - "eslint-plugin-jest": "^27.2.1", + "eslint": "^8.48.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-jest": "^27.6.3", "eslint-plugin-jsdoc": "^43.0.5", - "eslint-plugin-node": "^11.0.0", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-n": "^16.6.2", + "eslint-plugin-prettier": "^5.1.3", "file-loader": "^6.0.0", "fork-ts-checker-webpack-plugin": "^8.0.0", "hash-wasm": "^4.9.0", "husky": "^8.0.3", "is-ci": "^3.0.0", "istanbul": "^0.4.5", - "jest": "^29.5.0", - "jest-circus": "^29.5.0", - "jest-cli": "^29.5.0", - "jest-diff": "^29.5.0", - "jest-environment-node": "^29.5.0", + "jest": "^29.7.0", + "jest-circus": "^29.7.0", + "jest-cli": "^29.7.0", + "jest-diff": "^29.7.0", + "jest-environment-node": "^29.7.0", "jest-junit": "^16.0.0", "json-loader": "^0.5.7", "json5": "^2.1.3", @@ -84,7 +84,8 @@ "mini-svg-data-uri": "^1.2.3", "nyc": "^15.1.0", "open-cli": "^7.2.0", - "prettier": "^2.7.1", + "prettier-2": "npm:prettier@^2", + "prettier": "^3.2.1", "pretty-format": "^29.5.0", "pug": "^3.0.0", "pug-loader": "^2.4.0", @@ -96,9 +97,9 @@ "simple-git": "^3.17.0", "strip-ansi": "^6.0.0", "style-loader": "^2.0.0", - "terser": "^5.17.0", + "terser": "^5.26.0", "toml": "^3.0.0", - "tooling": "webpack/tooling#v1.23.0", + "tooling": "webpack/tooling#v1.23.1", "ts-loader": "^9.4.2", "typescript": "^5.0.4", "url-loader": "^4.1.0", @@ -158,7 +159,7 @@ "special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node tooling/generate-wasm-code.js --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/precompile-schemas --write && node node_modules/tooling/generate-types --no-template-literals --write", "fix": "yarn code-lint --fix && yarn special-lint-fix && yarn pretty-lint-fix", "prepare": "husky install", - "pretty-lint-base": "prettier --cache .", + "pretty-lint-base": "node node_modules/prettier/bin/prettier.cjs --cache .", "pretty-lint-fix": "yarn pretty-lint-base --loglevel warn --write", "pretty-lint": "yarn pretty-lint-base --check", "yarn-lint": "yarn-deduplicate --fail --list -s highest yarn.lock", @@ -186,61 +187,5 @@ "*.md|{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}": [ "cspell" ] - }, - "jest": { - "forceExit": true, - "setupFilesAfterEnv": [ - "/test/setupTestFramework.js" - ], - "testMatch": [ - "/test/*.test.js", - "/test/*.basictest.js", - "/test/*.longtest.js", - "/test/*.unittest.js" - ], - "watchPathIgnorePatterns": [ - "/.git", - "/node_modules", - "/test/js", - "/test/browsertest/js", - "/test/fixtures/temp-cache-fixture", - "/test/fixtures/temp-", - "/benchmark", - "/assembly", - "/tooling", - "/examples/*/dist", - "/coverage", - "/.eslintcache" - ], - "modulePathIgnorePatterns": [ - "/.git", - "/node_modules/webpack/node_modules", - "/test/js", - "/test/browsertest/js", - "/test/fixtures/temp-cache-fixture", - "/test/fixtures/temp-", - "/benchmark", - "/examples/*/dist", - "/coverage", - "/.eslintcache" - ], - "transformIgnorePatterns": [ - "" - ], - "coverageDirectory": "/coverage", - "coveragePathIgnorePatterns": [ - "\\.runtime\\.js$", - "/test", - "/schemas", - "/node_modules" - ], - "testEnvironment": "./test/patch-node-env.js", - "coverageReporters": [ - "json" - ], - "snapshotFormat": { - "escapeString": true, - "printBasicPrototype": true - } } } diff --git a/schemas/WebpackOptions.check.js b/schemas/WebpackOptions.check.js index 081c5412e79..3ae89daa216 100644 --- a/schemas/WebpackOptions.check.js +++ b/schemas/WebpackOptions.check.js @@ -3,4 +3,4 @@ * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ -const e=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;module.exports=we,module.exports.default=we;const t={definitions:{Amd:{anyOf:[{enum:[!1]},{type:"object"}]},AmdContainer:{type:"string",minLength:1},AssetFilterItemTypes:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!1},{instanceof:"Function"}]},AssetFilterTypes:{anyOf:[{type:"array",items:{oneOf:[{$ref:"#/definitions/AssetFilterItemTypes"}]}},{$ref:"#/definitions/AssetFilterItemTypes"}]},AssetGeneratorDataUrl:{anyOf:[{$ref:"#/definitions/AssetGeneratorDataUrlOptions"},{$ref:"#/definitions/AssetGeneratorDataUrlFunction"}]},AssetGeneratorDataUrlFunction:{instanceof:"Function"},AssetGeneratorDataUrlOptions:{type:"object",additionalProperties:!1,properties:{encoding:{enum:[!1,"base64"]},mimetype:{type:"string"}}},AssetGeneratorOptions:{type:"object",additionalProperties:!1,properties:{dataUrl:{$ref:"#/definitions/AssetGeneratorDataUrl"},emit:{type:"boolean"},filename:{$ref:"#/definitions/FilenameTemplate"},outputPath:{$ref:"#/definitions/AssetModuleOutputPath"},publicPath:{$ref:"#/definitions/RawPublicPath"}}},AssetInlineGeneratorOptions:{type:"object",additionalProperties:!1,properties:{dataUrl:{$ref:"#/definitions/AssetGeneratorDataUrl"}}},AssetModuleFilename:{anyOf:[{type:"string",absolutePath:!1},{instanceof:"Function"}]},AssetModuleOutputPath:{anyOf:[{type:"string",absolutePath:!1},{instanceof:"Function"}]},AssetParserDataUrlFunction:{instanceof:"Function"},AssetParserDataUrlOptions:{type:"object",additionalProperties:!1,properties:{maxSize:{type:"number"}}},AssetParserOptions:{type:"object",additionalProperties:!1,properties:{dataUrlCondition:{anyOf:[{$ref:"#/definitions/AssetParserDataUrlOptions"},{$ref:"#/definitions/AssetParserDataUrlFunction"}]}}},AssetResourceGeneratorOptions:{type:"object",additionalProperties:!1,properties:{emit:{type:"boolean"},filename:{$ref:"#/definitions/FilenameTemplate"},outputPath:{$ref:"#/definitions/AssetModuleOutputPath"},publicPath:{$ref:"#/definitions/RawPublicPath"}}},AuxiliaryComment:{anyOf:[{type:"string"},{$ref:"#/definitions/LibraryCustomUmdCommentObject"}]},Bail:{type:"boolean"},CacheOptions:{anyOf:[{enum:[!0]},{$ref:"#/definitions/CacheOptionsNormalized"}]},CacheOptionsNormalized:{anyOf:[{enum:[!1]},{$ref:"#/definitions/MemoryCacheOptions"},{$ref:"#/definitions/FileCacheOptions"}]},Charset:{type:"boolean"},ChunkFilename:{oneOf:[{$ref:"#/definitions/FilenameTemplate"}]},ChunkFormat:{anyOf:[{enum:["array-push","commonjs","module",!1]},{type:"string"}]},ChunkLoadTimeout:{type:"number"},ChunkLoading:{anyOf:[{enum:[!1]},{$ref:"#/definitions/ChunkLoadingType"}]},ChunkLoadingGlobal:{type:"string"},ChunkLoadingType:{anyOf:[{enum:["jsonp","import-scripts","require","async-node","import"]},{type:"string"}]},Clean:{anyOf:[{type:"boolean"},{$ref:"#/definitions/CleanOptions"}]},CleanOptions:{type:"object",additionalProperties:!1,properties:{dry:{type:"boolean"},keep:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!1},{instanceof:"Function"}]}}},CompareBeforeEmit:{type:"boolean"},Context:{type:"string",absolutePath:!0},CrossOriginLoading:{enum:[!1,"anonymous","use-credentials"]},CssChunkFilename:{oneOf:[{$ref:"#/definitions/FilenameTemplate"}]},CssExperimentOptions:{type:"object",additionalProperties:!1,properties:{exportsOnly:{type:"boolean"}}},CssFilename:{oneOf:[{$ref:"#/definitions/FilenameTemplate"}]},CssGeneratorOptions:{type:"object",additionalProperties:!1,properties:{}},CssParserOptions:{type:"object",additionalProperties:!1,properties:{}},Dependencies:{type:"array",items:{type:"string"}},DevServer:{type:"object"},DevTool:{anyOf:[{enum:[!1,"eval"]},{type:"string",pattern:"^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$"}]},DevtoolFallbackModuleFilenameTemplate:{anyOf:[{type:"string"},{instanceof:"Function"}]},DevtoolModuleFilenameTemplate:{anyOf:[{type:"string"},{instanceof:"Function"}]},DevtoolNamespace:{type:"string"},EmptyGeneratorOptions:{type:"object",additionalProperties:!1},EmptyParserOptions:{type:"object",additionalProperties:!1},EnabledChunkLoadingTypes:{type:"array",items:{$ref:"#/definitions/ChunkLoadingType"}},EnabledLibraryTypes:{type:"array",items:{$ref:"#/definitions/LibraryType"}},EnabledWasmLoadingTypes:{type:"array",items:{$ref:"#/definitions/WasmLoadingType"}},Entry:{anyOf:[{$ref:"#/definitions/EntryDynamic"},{$ref:"#/definitions/EntryStatic"}]},EntryDescription:{type:"object",additionalProperties:!1,properties:{asyncChunks:{type:"boolean"},baseUri:{type:"string"},chunkLoading:{$ref:"#/definitions/ChunkLoading"},dependOn:{anyOf:[{type:"array",items:{type:"string",minLength:1},minItems:1,uniqueItems:!0},{type:"string",minLength:1}]},filename:{$ref:"#/definitions/EntryFilename"},import:{$ref:"#/definitions/EntryItem"},layer:{$ref:"#/definitions/Layer"},library:{$ref:"#/definitions/LibraryOptions"},publicPath:{$ref:"#/definitions/PublicPath"},runtime:{$ref:"#/definitions/EntryRuntime"},wasmLoading:{$ref:"#/definitions/WasmLoading"}},required:["import"]},EntryDescriptionNormalized:{type:"object",additionalProperties:!1,properties:{asyncChunks:{type:"boolean"},baseUri:{type:"string"},chunkLoading:{$ref:"#/definitions/ChunkLoading"},dependOn:{type:"array",items:{type:"string",minLength:1},minItems:1,uniqueItems:!0},filename:{$ref:"#/definitions/Filename"},import:{type:"array",items:{type:"string",minLength:1},minItems:1,uniqueItems:!0},layer:{$ref:"#/definitions/Layer"},library:{$ref:"#/definitions/LibraryOptions"},publicPath:{$ref:"#/definitions/PublicPath"},runtime:{$ref:"#/definitions/EntryRuntime"},wasmLoading:{$ref:"#/definitions/WasmLoading"}}},EntryDynamic:{instanceof:"Function"},EntryDynamicNormalized:{instanceof:"Function"},EntryFilename:{oneOf:[{$ref:"#/definitions/FilenameTemplate"}]},EntryItem:{anyOf:[{type:"array",items:{type:"string",minLength:1},minItems:1,uniqueItems:!0},{type:"string",minLength:1}]},EntryNormalized:{anyOf:[{$ref:"#/definitions/EntryDynamicNormalized"},{$ref:"#/definitions/EntryStaticNormalized"}]},EntryObject:{type:"object",additionalProperties:{anyOf:[{$ref:"#/definitions/EntryItem"},{$ref:"#/definitions/EntryDescription"}]}},EntryRuntime:{anyOf:[{enum:[!1]},{type:"string",minLength:1}]},EntryStatic:{anyOf:[{$ref:"#/definitions/EntryObject"},{$ref:"#/definitions/EntryUnnamed"}]},EntryStaticNormalized:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/EntryDescriptionNormalized"}]}},EntryUnnamed:{oneOf:[{$ref:"#/definitions/EntryItem"}]},Environment:{type:"object",additionalProperties:!1,properties:{arrowFunction:{type:"boolean"},bigIntLiteral:{type:"boolean"},const:{type:"boolean"},destructuring:{type:"boolean"},dynamicImport:{type:"boolean"},dynamicImportInWorker:{type:"boolean"},forOf:{type:"boolean"},globalThis:{type:"boolean"},module:{type:"boolean"},optionalChaining:{type:"boolean"},templateLiteral:{type:"boolean"}}},Experiments:{type:"object",additionalProperties:!1,properties:{asyncWebAssembly:{type:"boolean"},backCompat:{type:"boolean"},buildHttp:{anyOf:[{$ref:"#/definitions/HttpUriAllowedUris"},{$ref:"#/definitions/HttpUriOptions"}]},cacheUnaffected:{type:"boolean"},css:{anyOf:[{type:"boolean"},{$ref:"#/definitions/CssExperimentOptions"}]},futureDefaults:{type:"boolean"},layers:{type:"boolean"},lazyCompilation:{anyOf:[{type:"boolean"},{$ref:"#/definitions/LazyCompilationOptions"}]},outputModule:{type:"boolean"},syncWebAssembly:{type:"boolean"},topLevelAwait:{type:"boolean"}}},ExperimentsCommon:{type:"object",additionalProperties:!1,properties:{asyncWebAssembly:{type:"boolean"},backCompat:{type:"boolean"},cacheUnaffected:{type:"boolean"},futureDefaults:{type:"boolean"},layers:{type:"boolean"},outputModule:{type:"boolean"},syncWebAssembly:{type:"boolean"},topLevelAwait:{type:"boolean"}}},ExperimentsNormalized:{type:"object",additionalProperties:!1,properties:{asyncWebAssembly:{type:"boolean"},backCompat:{type:"boolean"},buildHttp:{oneOf:[{$ref:"#/definitions/HttpUriOptions"}]},cacheUnaffected:{type:"boolean"},css:{anyOf:[{enum:[!1]},{$ref:"#/definitions/CssExperimentOptions"}]},futureDefaults:{type:"boolean"},layers:{type:"boolean"},lazyCompilation:{anyOf:[{enum:[!1]},{$ref:"#/definitions/LazyCompilationOptions"}]},outputModule:{type:"boolean"},syncWebAssembly:{type:"boolean"},topLevelAwait:{type:"boolean"}}},Extends:{anyOf:[{type:"array",items:{$ref:"#/definitions/ExtendsItem"}},{$ref:"#/definitions/ExtendsItem"}]},ExtendsItem:{type:"string"},ExternalItem:{anyOf:[{instanceof:"RegExp"},{type:"string"},{type:"object",additionalProperties:{$ref:"#/definitions/ExternalItemValue"},properties:{byLayer:{anyOf:[{type:"object",additionalProperties:{$ref:"#/definitions/ExternalItem"}},{instanceof:"Function"}]}}},{instanceof:"Function"}]},ExternalItemFunctionData:{type:"object",additionalProperties:!1,properties:{context:{type:"string"},contextInfo:{type:"object"},dependencyType:{type:"string"},getResolve:{instanceof:"Function"},request:{type:"string"}}},ExternalItemValue:{anyOf:[{type:"array",items:{type:"string",minLength:1}},{type:"boolean"},{type:"string"},{type:"object"}]},Externals:{anyOf:[{type:"array",items:{$ref:"#/definitions/ExternalItem"}},{$ref:"#/definitions/ExternalItem"}]},ExternalsPresets:{type:"object",additionalProperties:!1,properties:{electron:{type:"boolean"},electronMain:{type:"boolean"},electronPreload:{type:"boolean"},electronRenderer:{type:"boolean"},node:{type:"boolean"},nwjs:{type:"boolean"},web:{type:"boolean"},webAsync:{type:"boolean"}}},ExternalsType:{enum:["var","module","assign","this","window","self","global","commonjs","commonjs2","commonjs-module","commonjs-static","amd","amd-require","umd","umd2","jsonp","system","promise","import","script","node-commonjs"]},Falsy:{enum:[!1,0,"",null],undefinedAsNull:!0},FileCacheOptions:{type:"object",additionalProperties:!1,properties:{allowCollectingMemory:{type:"boolean"},buildDependencies:{type:"object",additionalProperties:{type:"array",items:{type:"string",minLength:1}}},cacheDirectory:{type:"string",absolutePath:!0},cacheLocation:{type:"string",absolutePath:!0},compression:{enum:[!1,"gzip","brotli"]},hashAlgorithm:{type:"string"},idleTimeout:{type:"number",minimum:0},idleTimeoutAfterLargeChanges:{type:"number",minimum:0},idleTimeoutForInitialStore:{type:"number",minimum:0},immutablePaths:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0,minLength:1}]}},managedPaths:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0,minLength:1}]}},maxAge:{type:"number",minimum:0},maxMemoryGenerations:{type:"number",minimum:0},memoryCacheUnaffected:{type:"boolean"},name:{type:"string"},profile:{type:"boolean"},readonly:{type:"boolean"},store:{enum:["pack"]},type:{enum:["filesystem"]},version:{type:"string"}},required:["type"]},Filename:{oneOf:[{$ref:"#/definitions/FilenameTemplate"}]},FilenameTemplate:{anyOf:[{type:"string",absolutePath:!1,minLength:1},{instanceof:"Function"}]},FilterItemTypes:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!1},{instanceof:"Function"}]},FilterTypes:{anyOf:[{type:"array",items:{oneOf:[{$ref:"#/definitions/FilterItemTypes"}]}},{$ref:"#/definitions/FilterItemTypes"}]},GeneratorOptionsByModuleType:{type:"object",additionalProperties:{type:"object",additionalProperties:!0},properties:{asset:{$ref:"#/definitions/AssetGeneratorOptions"},"asset/inline":{$ref:"#/definitions/AssetInlineGeneratorOptions"},"asset/resource":{$ref:"#/definitions/AssetResourceGeneratorOptions"},javascript:{$ref:"#/definitions/EmptyGeneratorOptions"},"javascript/auto":{$ref:"#/definitions/EmptyGeneratorOptions"},"javascript/dynamic":{$ref:"#/definitions/EmptyGeneratorOptions"},"javascript/esm":{$ref:"#/definitions/EmptyGeneratorOptions"}}},GlobalObject:{type:"string",minLength:1},HashDigest:{type:"string"},HashDigestLength:{type:"number",minimum:1},HashFunction:{anyOf:[{type:"string",minLength:1},{instanceof:"Function"}]},HashSalt:{type:"string",minLength:1},HotUpdateChunkFilename:{type:"string",absolutePath:!1},HotUpdateGlobal:{type:"string"},HotUpdateMainFilename:{type:"string",absolutePath:!1},HttpUriAllowedUris:{oneOf:[{$ref:"#/definitions/HttpUriOptionsAllowedUris"}]},HttpUriOptions:{type:"object",additionalProperties:!1,properties:{allowedUris:{$ref:"#/definitions/HttpUriOptionsAllowedUris"},cacheLocation:{anyOf:[{enum:[!1]},{type:"string",absolutePath:!0}]},frozen:{type:"boolean"},lockfileLocation:{type:"string",absolutePath:!0},proxy:{type:"string"},upgrade:{type:"boolean"}},required:["allowedUris"]},HttpUriOptionsAllowedUris:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",pattern:"^https?://"},{instanceof:"Function"}]}},IgnoreWarnings:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"object",additionalProperties:!1,properties:{file:{instanceof:"RegExp"},message:{instanceof:"RegExp"},module:{instanceof:"RegExp"}}},{instanceof:"Function"}]}},IgnoreWarningsNormalized:{type:"array",items:{instanceof:"Function"}},Iife:{type:"boolean"},ImportFunctionName:{type:"string"},ImportMetaName:{type:"string"},InfrastructureLogging:{type:"object",additionalProperties:!1,properties:{appendOnly:{type:"boolean"},colors:{type:"boolean"},console:{},debug:{anyOf:[{type:"boolean"},{$ref:"#/definitions/FilterTypes"}]},level:{enum:["none","error","warn","info","log","verbose"]},stream:{}}},JavascriptParserOptions:{type:"object",additionalProperties:!0,properties:{amd:{$ref:"#/definitions/Amd"},browserify:{type:"boolean"},commonjs:{type:"boolean"},commonjsMagicComments:{type:"boolean"},createRequire:{anyOf:[{type:"boolean"},{type:"string"}]},dynamicImportFetchPriority:{enum:["low","high","auto",!1]},dynamicImportMode:{enum:["eager","weak","lazy","lazy-once"]},dynamicImportPrefetch:{anyOf:[{type:"number"},{type:"boolean"}]},dynamicImportPreload:{anyOf:[{type:"number"},{type:"boolean"}]},exportsPresence:{enum:["error","warn","auto",!1]},exprContextCritical:{type:"boolean"},exprContextRecursive:{type:"boolean"},exprContextRegExp:{anyOf:[{instanceof:"RegExp"},{type:"boolean"}]},exprContextRequest:{type:"string"},harmony:{type:"boolean"},import:{type:"boolean"},importExportsPresence:{enum:["error","warn","auto",!1]},importMeta:{type:"boolean"},importMetaContext:{type:"boolean"},node:{$ref:"#/definitions/Node"},reexportExportsPresence:{enum:["error","warn","auto",!1]},requireContext:{type:"boolean"},requireEnsure:{type:"boolean"},requireInclude:{type:"boolean"},requireJs:{type:"boolean"},strictExportPresence:{type:"boolean"},strictThisContextOnImports:{type:"boolean"},system:{type:"boolean"},unknownContextCritical:{type:"boolean"},unknownContextRecursive:{type:"boolean"},unknownContextRegExp:{anyOf:[{instanceof:"RegExp"},{type:"boolean"}]},unknownContextRequest:{type:"string"},url:{anyOf:[{enum:["relative"]},{type:"boolean"}]},worker:{anyOf:[{type:"array",items:{type:"string",minLength:1}},{type:"boolean"}]},wrappedContextCritical:{type:"boolean"},wrappedContextRecursive:{type:"boolean"},wrappedContextRegExp:{instanceof:"RegExp"}}},Layer:{anyOf:[{enum:[null]},{type:"string",minLength:1}]},LazyCompilationDefaultBackendOptions:{type:"object",additionalProperties:!1,properties:{client:{type:"string"},listen:{anyOf:[{type:"number"},{type:"object",additionalProperties:!0,properties:{host:{type:"string"},port:{type:"number"}}},{instanceof:"Function"}]},protocol:{enum:["http","https"]},server:{anyOf:[{type:"object",additionalProperties:!0,properties:{}},{instanceof:"Function"}]}}},LazyCompilationOptions:{type:"object",additionalProperties:!1,properties:{backend:{anyOf:[{instanceof:"Function"},{$ref:"#/definitions/LazyCompilationDefaultBackendOptions"}]},entries:{type:"boolean"},imports:{type:"boolean"},test:{anyOf:[{instanceof:"RegExp"},{type:"string"},{instanceof:"Function"}]}}},Library:{anyOf:[{$ref:"#/definitions/LibraryName"},{$ref:"#/definitions/LibraryOptions"}]},LibraryCustomUmdCommentObject:{type:"object",additionalProperties:!1,properties:{amd:{type:"string"},commonjs:{type:"string"},commonjs2:{type:"string"},root:{type:"string"}}},LibraryCustomUmdObject:{type:"object",additionalProperties:!1,properties:{amd:{type:"string",minLength:1},commonjs:{type:"string",minLength:1},root:{anyOf:[{type:"array",items:{type:"string",minLength:1}},{type:"string",minLength:1}]}}},LibraryExport:{anyOf:[{type:"array",items:{type:"string",minLength:1}},{type:"string",minLength:1}]},LibraryName:{anyOf:[{type:"array",items:{type:"string",minLength:1},minItems:1},{type:"string",minLength:1},{$ref:"#/definitions/LibraryCustomUmdObject"}]},LibraryOptions:{type:"object",additionalProperties:!1,properties:{amdContainer:{$ref:"#/definitions/AmdContainer"},auxiliaryComment:{$ref:"#/definitions/AuxiliaryComment"},export:{$ref:"#/definitions/LibraryExport"},name:{$ref:"#/definitions/LibraryName"},type:{$ref:"#/definitions/LibraryType"},umdNamedDefine:{$ref:"#/definitions/UmdNamedDefine"}},required:["type"]},LibraryType:{anyOf:[{enum:["var","module","assign","assign-properties","this","window","self","global","commonjs","commonjs2","commonjs-module","commonjs-static","amd","amd-require","umd","umd2","jsonp","system"]},{type:"string"}]},Loader:{type:"object"},MemoryCacheOptions:{type:"object",additionalProperties:!1,properties:{cacheUnaffected:{type:"boolean"},maxGenerations:{type:"number",minimum:1},type:{enum:["memory"]}},required:["type"]},Mode:{enum:["development","production","none"]},ModuleFilterItemTypes:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!1},{instanceof:"Function"}]},ModuleFilterTypes:{anyOf:[{type:"array",items:{oneOf:[{$ref:"#/definitions/ModuleFilterItemTypes"}]}},{$ref:"#/definitions/ModuleFilterItemTypes"}]},ModuleOptions:{type:"object",additionalProperties:!1,properties:{defaultRules:{oneOf:[{$ref:"#/definitions/RuleSetRules"}]},exprContextCritical:{type:"boolean"},exprContextRecursive:{type:"boolean"},exprContextRegExp:{anyOf:[{instanceof:"RegExp"},{type:"boolean"}]},exprContextRequest:{type:"string"},generator:{$ref:"#/definitions/GeneratorOptionsByModuleType"},noParse:{$ref:"#/definitions/NoParse"},parser:{$ref:"#/definitions/ParserOptionsByModuleType"},rules:{oneOf:[{$ref:"#/definitions/RuleSetRules"}]},strictExportPresence:{type:"boolean"},strictThisContextOnImports:{type:"boolean"},unknownContextCritical:{type:"boolean"},unknownContextRecursive:{type:"boolean"},unknownContextRegExp:{anyOf:[{instanceof:"RegExp"},{type:"boolean"}]},unknownContextRequest:{type:"string"},unsafeCache:{anyOf:[{type:"boolean"},{instanceof:"Function"}]},wrappedContextCritical:{type:"boolean"},wrappedContextRecursive:{type:"boolean"},wrappedContextRegExp:{instanceof:"RegExp"}}},ModuleOptionsNormalized:{type:"object",additionalProperties:!1,properties:{defaultRules:{oneOf:[{$ref:"#/definitions/RuleSetRules"}]},generator:{$ref:"#/definitions/GeneratorOptionsByModuleType"},noParse:{$ref:"#/definitions/NoParse"},parser:{$ref:"#/definitions/ParserOptionsByModuleType"},rules:{oneOf:[{$ref:"#/definitions/RuleSetRules"}]},unsafeCache:{anyOf:[{type:"boolean"},{instanceof:"Function"}]}},required:["defaultRules","generator","parser","rules"]},Name:{type:"string"},NoParse:{anyOf:[{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0},{instanceof:"Function"}]},minItems:1},{instanceof:"RegExp"},{type:"string",absolutePath:!0},{instanceof:"Function"}]},Node:{anyOf:[{enum:[!1]},{$ref:"#/definitions/NodeOptions"}]},NodeOptions:{type:"object",additionalProperties:!1,properties:{__dirname:{enum:[!1,!0,"warn-mock","mock","eval-only"]},__filename:{enum:[!1,!0,"warn-mock","mock","eval-only"]},global:{enum:[!1,!0,"warn"]}}},Optimization:{type:"object",additionalProperties:!1,properties:{checkWasmTypes:{type:"boolean"},chunkIds:{enum:["natural","named","deterministic","size","total-size",!1]},concatenateModules:{type:"boolean"},emitOnErrors:{type:"boolean"},flagIncludedChunks:{type:"boolean"},innerGraph:{type:"boolean"},mangleExports:{anyOf:[{enum:["size","deterministic"]},{type:"boolean"}]},mangleWasmImports:{type:"boolean"},mergeDuplicateChunks:{type:"boolean"},minimize:{type:"boolean"},minimizer:{type:"array",items:{anyOf:[{enum:["..."]},{$ref:"#/definitions/Falsy"},{$ref:"#/definitions/WebpackPluginInstance"},{$ref:"#/definitions/WebpackPluginFunction"}]}},moduleIds:{enum:["natural","named","hashed","deterministic","size",!1]},noEmitOnErrors:{type:"boolean"},nodeEnv:{anyOf:[{enum:[!1]},{type:"string"}]},portableRecords:{type:"boolean"},providedExports:{type:"boolean"},realContentHash:{type:"boolean"},removeAvailableModules:{type:"boolean"},removeEmptyChunks:{type:"boolean"},runtimeChunk:{$ref:"#/definitions/OptimizationRuntimeChunk"},sideEffects:{anyOf:[{enum:["flag"]},{type:"boolean"}]},splitChunks:{anyOf:[{enum:[!1]},{$ref:"#/definitions/OptimizationSplitChunksOptions"}]},usedExports:{anyOf:[{enum:["global"]},{type:"boolean"}]}}},OptimizationRuntimeChunk:{anyOf:[{enum:["single","multiple"]},{type:"boolean"},{type:"object",additionalProperties:!1,properties:{name:{anyOf:[{type:"string"},{instanceof:"Function"}]}}}]},OptimizationRuntimeChunkNormalized:{anyOf:[{enum:[!1]},{type:"object",additionalProperties:!1,properties:{name:{instanceof:"Function"}}}]},OptimizationSplitChunksCacheGroup:{type:"object",additionalProperties:!1,properties:{automaticNameDelimiter:{type:"string",minLength:1},chunks:{anyOf:[{enum:["initial","async","all"]},{instanceof:"RegExp"},{instanceof:"Function"}]},enforce:{type:"boolean"},enforceSizeThreshold:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},filename:{anyOf:[{type:"string",absolutePath:!1,minLength:1},{instanceof:"Function"}]},idHint:{type:"string"},layer:{anyOf:[{instanceof:"RegExp"},{type:"string"},{instanceof:"Function"}]},maxAsyncRequests:{type:"number",minimum:1},maxAsyncSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},maxInitialRequests:{type:"number",minimum:1},maxInitialSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},maxSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},minChunks:{type:"number",minimum:1},minRemainingSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},minSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},minSizeReduction:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},name:{anyOf:[{enum:[!1]},{type:"string"},{instanceof:"Function"}]},priority:{type:"number"},reuseExistingChunk:{type:"boolean"},test:{anyOf:[{instanceof:"RegExp"},{type:"string"},{instanceof:"Function"}]},type:{anyOf:[{instanceof:"RegExp"},{type:"string"},{instanceof:"Function"}]},usedExports:{type:"boolean"}}},OptimizationSplitChunksGetCacheGroups:{instanceof:"Function"},OptimizationSplitChunksOptions:{type:"object",additionalProperties:!1,properties:{automaticNameDelimiter:{type:"string",minLength:1},cacheGroups:{type:"object",additionalProperties:{anyOf:[{enum:[!1]},{instanceof:"RegExp"},{type:"string"},{instanceof:"Function"},{$ref:"#/definitions/OptimizationSplitChunksCacheGroup"}]},not:{type:"object",additionalProperties:!0,properties:{test:{anyOf:[{instanceof:"RegExp"},{type:"string"},{instanceof:"Function"}]}},required:["test"]}},chunks:{anyOf:[{enum:["initial","async","all"]},{instanceof:"RegExp"},{instanceof:"Function"}]},defaultSizeTypes:{type:"array",items:{type:"string"},minItems:1},enforceSizeThreshold:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},fallbackCacheGroup:{type:"object",additionalProperties:!1,properties:{automaticNameDelimiter:{type:"string",minLength:1},chunks:{anyOf:[{enum:["initial","async","all"]},{instanceof:"RegExp"},{instanceof:"Function"}]},maxAsyncSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},maxInitialSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},maxSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},minSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},minSizeReduction:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]}}},filename:{anyOf:[{type:"string",absolutePath:!1,minLength:1},{instanceof:"Function"}]},hidePathInfo:{type:"boolean"},maxAsyncRequests:{type:"number",minimum:1},maxAsyncSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},maxInitialRequests:{type:"number",minimum:1},maxInitialSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},maxSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},minChunks:{type:"number",minimum:1},minRemainingSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},minSize:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},minSizeReduction:{oneOf:[{$ref:"#/definitions/OptimizationSplitChunksSizes"}]},name:{anyOf:[{enum:[!1]},{type:"string"},{instanceof:"Function"}]},usedExports:{type:"boolean"}}},OptimizationSplitChunksSizes:{anyOf:[{type:"number",minimum:0},{type:"object",additionalProperties:{type:"number"}}]},Output:{type:"object",additionalProperties:!1,properties:{amdContainer:{oneOf:[{$ref:"#/definitions/AmdContainer"}]},assetModuleFilename:{$ref:"#/definitions/AssetModuleFilename"},asyncChunks:{type:"boolean"},auxiliaryComment:{oneOf:[{$ref:"#/definitions/AuxiliaryComment"}]},charset:{$ref:"#/definitions/Charset"},chunkFilename:{$ref:"#/definitions/ChunkFilename"},chunkFormat:{$ref:"#/definitions/ChunkFormat"},chunkLoadTimeout:{$ref:"#/definitions/ChunkLoadTimeout"},chunkLoading:{$ref:"#/definitions/ChunkLoading"},chunkLoadingGlobal:{$ref:"#/definitions/ChunkLoadingGlobal"},clean:{$ref:"#/definitions/Clean"},compareBeforeEmit:{$ref:"#/definitions/CompareBeforeEmit"},crossOriginLoading:{$ref:"#/definitions/CrossOriginLoading"},cssChunkFilename:{$ref:"#/definitions/CssChunkFilename"},cssFilename:{$ref:"#/definitions/CssFilename"},devtoolFallbackModuleFilenameTemplate:{$ref:"#/definitions/DevtoolFallbackModuleFilenameTemplate"},devtoolModuleFilenameTemplate:{$ref:"#/definitions/DevtoolModuleFilenameTemplate"},devtoolNamespace:{$ref:"#/definitions/DevtoolNamespace"},enabledChunkLoadingTypes:{$ref:"#/definitions/EnabledChunkLoadingTypes"},enabledLibraryTypes:{$ref:"#/definitions/EnabledLibraryTypes"},enabledWasmLoadingTypes:{$ref:"#/definitions/EnabledWasmLoadingTypes"},environment:{$ref:"#/definitions/Environment"},filename:{$ref:"#/definitions/Filename"},globalObject:{$ref:"#/definitions/GlobalObject"},hashDigest:{$ref:"#/definitions/HashDigest"},hashDigestLength:{$ref:"#/definitions/HashDigestLength"},hashFunction:{$ref:"#/definitions/HashFunction"},hashSalt:{$ref:"#/definitions/HashSalt"},hotUpdateChunkFilename:{$ref:"#/definitions/HotUpdateChunkFilename"},hotUpdateGlobal:{$ref:"#/definitions/HotUpdateGlobal"},hotUpdateMainFilename:{$ref:"#/definitions/HotUpdateMainFilename"},ignoreBrowserWarnings:{type:"boolean"},iife:{$ref:"#/definitions/Iife"},importFunctionName:{$ref:"#/definitions/ImportFunctionName"},importMetaName:{$ref:"#/definitions/ImportMetaName"},library:{$ref:"#/definitions/Library"},libraryExport:{oneOf:[{$ref:"#/definitions/LibraryExport"}]},libraryTarget:{oneOf:[{$ref:"#/definitions/LibraryType"}]},module:{$ref:"#/definitions/OutputModule"},path:{$ref:"#/definitions/Path"},pathinfo:{$ref:"#/definitions/Pathinfo"},publicPath:{$ref:"#/definitions/PublicPath"},scriptType:{$ref:"#/definitions/ScriptType"},sourceMapFilename:{$ref:"#/definitions/SourceMapFilename"},sourcePrefix:{$ref:"#/definitions/SourcePrefix"},strictModuleErrorHandling:{$ref:"#/definitions/StrictModuleErrorHandling"},strictModuleExceptionHandling:{$ref:"#/definitions/StrictModuleExceptionHandling"},trustedTypes:{anyOf:[{enum:[!0]},{type:"string",minLength:1},{$ref:"#/definitions/TrustedTypes"}]},umdNamedDefine:{oneOf:[{$ref:"#/definitions/UmdNamedDefine"}]},uniqueName:{$ref:"#/definitions/UniqueName"},wasmLoading:{$ref:"#/definitions/WasmLoading"},webassemblyModuleFilename:{$ref:"#/definitions/WebassemblyModuleFilename"},workerChunkLoading:{$ref:"#/definitions/ChunkLoading"},workerPublicPath:{$ref:"#/definitions/WorkerPublicPath"},workerWasmLoading:{$ref:"#/definitions/WasmLoading"}}},OutputModule:{type:"boolean"},OutputNormalized:{type:"object",additionalProperties:!1,properties:{assetModuleFilename:{$ref:"#/definitions/AssetModuleFilename"},asyncChunks:{type:"boolean"},charset:{$ref:"#/definitions/Charset"},chunkFilename:{$ref:"#/definitions/ChunkFilename"},chunkFormat:{$ref:"#/definitions/ChunkFormat"},chunkLoadTimeout:{$ref:"#/definitions/ChunkLoadTimeout"},chunkLoading:{$ref:"#/definitions/ChunkLoading"},chunkLoadingGlobal:{$ref:"#/definitions/ChunkLoadingGlobal"},clean:{$ref:"#/definitions/Clean"},compareBeforeEmit:{$ref:"#/definitions/CompareBeforeEmit"},crossOriginLoading:{$ref:"#/definitions/CrossOriginLoading"},cssChunkFilename:{$ref:"#/definitions/CssChunkFilename"},cssFilename:{$ref:"#/definitions/CssFilename"},devtoolFallbackModuleFilenameTemplate:{$ref:"#/definitions/DevtoolFallbackModuleFilenameTemplate"},devtoolModuleFilenameTemplate:{$ref:"#/definitions/DevtoolModuleFilenameTemplate"},devtoolNamespace:{$ref:"#/definitions/DevtoolNamespace"},enabledChunkLoadingTypes:{$ref:"#/definitions/EnabledChunkLoadingTypes"},enabledLibraryTypes:{$ref:"#/definitions/EnabledLibraryTypes"},enabledWasmLoadingTypes:{$ref:"#/definitions/EnabledWasmLoadingTypes"},environment:{$ref:"#/definitions/Environment"},filename:{$ref:"#/definitions/Filename"},globalObject:{$ref:"#/definitions/GlobalObject"},hashDigest:{$ref:"#/definitions/HashDigest"},hashDigestLength:{$ref:"#/definitions/HashDigestLength"},hashFunction:{$ref:"#/definitions/HashFunction"},hashSalt:{$ref:"#/definitions/HashSalt"},hotUpdateChunkFilename:{$ref:"#/definitions/HotUpdateChunkFilename"},hotUpdateGlobal:{$ref:"#/definitions/HotUpdateGlobal"},hotUpdateMainFilename:{$ref:"#/definitions/HotUpdateMainFilename"},ignoreBrowserWarnings:{type:"boolean"},iife:{$ref:"#/definitions/Iife"},importFunctionName:{$ref:"#/definitions/ImportFunctionName"},importMetaName:{$ref:"#/definitions/ImportMetaName"},library:{$ref:"#/definitions/LibraryOptions"},module:{$ref:"#/definitions/OutputModule"},path:{$ref:"#/definitions/Path"},pathinfo:{$ref:"#/definitions/Pathinfo"},publicPath:{$ref:"#/definitions/PublicPath"},scriptType:{$ref:"#/definitions/ScriptType"},sourceMapFilename:{$ref:"#/definitions/SourceMapFilename"},sourcePrefix:{$ref:"#/definitions/SourcePrefix"},strictModuleErrorHandling:{$ref:"#/definitions/StrictModuleErrorHandling"},strictModuleExceptionHandling:{$ref:"#/definitions/StrictModuleExceptionHandling"},trustedTypes:{$ref:"#/definitions/TrustedTypes"},uniqueName:{$ref:"#/definitions/UniqueName"},wasmLoading:{$ref:"#/definitions/WasmLoading"},webassemblyModuleFilename:{$ref:"#/definitions/WebassemblyModuleFilename"},workerChunkLoading:{$ref:"#/definitions/ChunkLoading"},workerPublicPath:{$ref:"#/definitions/WorkerPublicPath"},workerWasmLoading:{$ref:"#/definitions/WasmLoading"}}},Parallelism:{type:"number",minimum:1},ParserOptionsByModuleType:{type:"object",additionalProperties:{type:"object",additionalProperties:!0},properties:{asset:{$ref:"#/definitions/AssetParserOptions"},"asset/inline":{$ref:"#/definitions/EmptyParserOptions"},"asset/resource":{$ref:"#/definitions/EmptyParserOptions"},"asset/source":{$ref:"#/definitions/EmptyParserOptions"},javascript:{$ref:"#/definitions/JavascriptParserOptions"},"javascript/auto":{$ref:"#/definitions/JavascriptParserOptions"},"javascript/dynamic":{$ref:"#/definitions/JavascriptParserOptions"},"javascript/esm":{$ref:"#/definitions/JavascriptParserOptions"}}},Path:{type:"string",absolutePath:!0},Pathinfo:{anyOf:[{enum:["verbose"]},{type:"boolean"}]},Performance:{anyOf:[{enum:[!1]},{$ref:"#/definitions/PerformanceOptions"}]},PerformanceOptions:{type:"object",additionalProperties:!1,properties:{assetFilter:{instanceof:"Function"},hints:{enum:[!1,"warning","error"]},maxAssetSize:{type:"number"},maxEntrypointSize:{type:"number"}}},Plugins:{type:"array",items:{anyOf:[{$ref:"#/definitions/Falsy"},{$ref:"#/definitions/WebpackPluginInstance"},{$ref:"#/definitions/WebpackPluginFunction"}]}},Profile:{type:"boolean"},PublicPath:{anyOf:[{enum:["auto"]},{$ref:"#/definitions/RawPublicPath"}]},RawPublicPath:{anyOf:[{type:"string"},{instanceof:"Function"}]},RecordsInputPath:{anyOf:[{enum:[!1]},{type:"string",absolutePath:!0}]},RecordsOutputPath:{anyOf:[{enum:[!1]},{type:"string",absolutePath:!0}]},RecordsPath:{anyOf:[{enum:[!1]},{type:"string",absolutePath:!0}]},Resolve:{oneOf:[{$ref:"#/definitions/ResolveOptions"}]},ResolveAlias:{anyOf:[{type:"array",items:{type:"object",additionalProperties:!1,properties:{alias:{anyOf:[{type:"array",items:{type:"string",minLength:1}},{enum:[!1]},{type:"string",minLength:1}]},name:{type:"string"},onlyModule:{type:"boolean"}},required:["alias","name"]}},{type:"object",additionalProperties:{anyOf:[{type:"array",items:{type:"string",minLength:1}},{enum:[!1]},{type:"string",minLength:1}]}}]},ResolveLoader:{oneOf:[{$ref:"#/definitions/ResolveOptions"}]},ResolveOptions:{type:"object",additionalProperties:!1,properties:{alias:{$ref:"#/definitions/ResolveAlias"},aliasFields:{type:"array",items:{anyOf:[{type:"array",items:{type:"string",minLength:1}},{type:"string",minLength:1}]}},byDependency:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/ResolveOptions"}]}},cache:{type:"boolean"},cachePredicate:{instanceof:"Function"},cacheWithContext:{type:"boolean"},conditionNames:{type:"array",items:{type:"string"}},descriptionFiles:{type:"array",items:{type:"string",minLength:1}},enforceExtension:{type:"boolean"},exportsFields:{type:"array",items:{type:"string"}},extensionAlias:{type:"object",additionalProperties:{anyOf:[{type:"array",items:{type:"string",minLength:1}},{type:"string",minLength:1}]}},extensions:{type:"array",items:{type:"string"}},fallback:{oneOf:[{$ref:"#/definitions/ResolveAlias"}]},fileSystem:{},fullySpecified:{type:"boolean"},importsFields:{type:"array",items:{type:"string"}},mainFields:{type:"array",items:{anyOf:[{type:"array",items:{type:"string",minLength:1}},{type:"string",minLength:1}]}},mainFiles:{type:"array",items:{type:"string",minLength:1}},modules:{type:"array",items:{type:"string",minLength:1}},plugins:{type:"array",items:{anyOf:[{enum:["..."]},{$ref:"#/definitions/Falsy"},{$ref:"#/definitions/ResolvePluginInstance"}]}},preferAbsolute:{type:"boolean"},preferRelative:{type:"boolean"},resolver:{},restrictions:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0,minLength:1}]}},roots:{type:"array",items:{type:"string"}},symlinks:{type:"boolean"},unsafeCache:{anyOf:[{type:"boolean"},{type:"object",additionalProperties:!0}]},useSyncFileSystemCalls:{type:"boolean"}}},ResolvePluginInstance:{type:"object",additionalProperties:!0,properties:{apply:{instanceof:"Function"}},required:["apply"]},RuleSetCondition:{anyOf:[{instanceof:"RegExp"},{type:"string"},{instanceof:"Function"},{$ref:"#/definitions/RuleSetLogicalConditions"},{$ref:"#/definitions/RuleSetConditions"}]},RuleSetConditionAbsolute:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0},{instanceof:"Function"},{$ref:"#/definitions/RuleSetLogicalConditionsAbsolute"},{$ref:"#/definitions/RuleSetConditionsAbsolute"}]},RuleSetConditionOrConditions:{anyOf:[{$ref:"#/definitions/RuleSetCondition"},{$ref:"#/definitions/RuleSetConditions"}]},RuleSetConditionOrConditionsAbsolute:{anyOf:[{$ref:"#/definitions/RuleSetConditionAbsolute"},{$ref:"#/definitions/RuleSetConditionsAbsolute"}]},RuleSetConditions:{type:"array",items:{oneOf:[{$ref:"#/definitions/RuleSetCondition"}]}},RuleSetConditionsAbsolute:{type:"array",items:{oneOf:[{$ref:"#/definitions/RuleSetConditionAbsolute"}]}},RuleSetLoader:{type:"string",minLength:1},RuleSetLoaderOptions:{anyOf:[{type:"string"},{type:"object"}]},RuleSetLogicalConditions:{type:"object",additionalProperties:!1,properties:{and:{oneOf:[{$ref:"#/definitions/RuleSetConditions"}]},not:{oneOf:[{$ref:"#/definitions/RuleSetCondition"}]},or:{oneOf:[{$ref:"#/definitions/RuleSetConditions"}]}}},RuleSetLogicalConditionsAbsolute:{type:"object",additionalProperties:!1,properties:{and:{oneOf:[{$ref:"#/definitions/RuleSetConditionsAbsolute"}]},not:{oneOf:[{$ref:"#/definitions/RuleSetConditionAbsolute"}]},or:{oneOf:[{$ref:"#/definitions/RuleSetConditionsAbsolute"}]}}},RuleSetRule:{type:"object",additionalProperties:!1,properties:{assert:{type:"object",additionalProperties:{$ref:"#/definitions/RuleSetConditionOrConditions"}},compiler:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditions"}]},dependency:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditions"}]},descriptionData:{type:"object",additionalProperties:{$ref:"#/definitions/RuleSetConditionOrConditions"}},enforce:{enum:["pre","post"]},exclude:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},generator:{type:"object"},include:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},issuer:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},issuerLayer:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditions"}]},layer:{type:"string"},loader:{oneOf:[{$ref:"#/definitions/RuleSetLoader"}]},mimetype:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditions"}]},oneOf:{type:"array",items:{anyOf:[{$ref:"#/definitions/Falsy"},{$ref:"#/definitions/RuleSetRule"}]}},options:{oneOf:[{$ref:"#/definitions/RuleSetLoaderOptions"}]},parser:{type:"object",additionalProperties:!0},realResource:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},resolve:{type:"object",oneOf:[{$ref:"#/definitions/ResolveOptions"}]},resource:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},resourceFragment:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditions"}]},resourceQuery:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditions"}]},rules:{type:"array",items:{anyOf:[{$ref:"#/definitions/Falsy"},{$ref:"#/definitions/RuleSetRule"}]}},scheme:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditions"}]},sideEffects:{type:"boolean"},test:{oneOf:[{$ref:"#/definitions/RuleSetConditionOrConditionsAbsolute"}]},type:{type:"string"},use:{oneOf:[{$ref:"#/definitions/RuleSetUse"}]}}},RuleSetRules:{type:"array",items:{anyOf:[{enum:["..."]},{$ref:"#/definitions/Falsy"},{$ref:"#/definitions/RuleSetRule"}]}},RuleSetUse:{anyOf:[{type:"array",items:{anyOf:[{$ref:"#/definitions/Falsy"},{$ref:"#/definitions/RuleSetUseItem"}]}},{instanceof:"Function"},{$ref:"#/definitions/RuleSetUseItem"}]},RuleSetUseItem:{anyOf:[{type:"object",additionalProperties:!1,properties:{ident:{type:"string"},loader:{oneOf:[{$ref:"#/definitions/RuleSetLoader"}]},options:{oneOf:[{$ref:"#/definitions/RuleSetLoaderOptions"}]}}},{instanceof:"Function"},{$ref:"#/definitions/RuleSetLoader"}]},ScriptType:{enum:[!1,"text/javascript","module"]},SnapshotOptions:{type:"object",additionalProperties:!1,properties:{buildDependencies:{type:"object",additionalProperties:!1,properties:{hash:{type:"boolean"},timestamp:{type:"boolean"}}},immutablePaths:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0,minLength:1}]}},managedPaths:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0,minLength:1}]}},module:{type:"object",additionalProperties:!1,properties:{hash:{type:"boolean"},timestamp:{type:"boolean"}}},resolve:{type:"object",additionalProperties:!1,properties:{hash:{type:"boolean"},timestamp:{type:"boolean"}}},resolveBuildDependencies:{type:"object",additionalProperties:!1,properties:{hash:{type:"boolean"},timestamp:{type:"boolean"}}}}},SourceMapFilename:{type:"string",absolutePath:!1},SourcePrefix:{type:"string"},StatsOptions:{type:"object",additionalProperties:!1,properties:{all:{type:"boolean"},assets:{type:"boolean"},assetsSort:{type:"string"},assetsSpace:{type:"number"},builtAt:{type:"boolean"},cached:{type:"boolean"},cachedAssets:{type:"boolean"},cachedModules:{type:"boolean"},children:{type:"boolean"},chunkGroupAuxiliary:{type:"boolean"},chunkGroupChildren:{type:"boolean"},chunkGroupMaxAssets:{type:"number"},chunkGroups:{type:"boolean"},chunkModules:{type:"boolean"},chunkModulesSpace:{type:"number"},chunkOrigins:{type:"boolean"},chunkRelations:{type:"boolean"},chunks:{type:"boolean"},chunksSort:{type:"string"},colors:{anyOf:[{type:"boolean"},{type:"object",additionalProperties:!1,properties:{bold:{type:"string"},cyan:{type:"string"},green:{type:"string"},magenta:{type:"string"},red:{type:"string"},yellow:{type:"string"}}}]},context:{type:"string",absolutePath:!0},dependentModules:{type:"boolean"},depth:{type:"boolean"},entrypoints:{anyOf:[{enum:["auto"]},{type:"boolean"}]},env:{type:"boolean"},errorDetails:{anyOf:[{enum:["auto"]},{type:"boolean"}]},errorStack:{type:"boolean"},errors:{type:"boolean"},errorsCount:{type:"boolean"},errorsSpace:{type:"number"},exclude:{anyOf:[{type:"boolean"},{$ref:"#/definitions/ModuleFilterTypes"}]},excludeAssets:{oneOf:[{$ref:"#/definitions/AssetFilterTypes"}]},excludeModules:{anyOf:[{type:"boolean"},{$ref:"#/definitions/ModuleFilterTypes"}]},groupAssetsByChunk:{type:"boolean"},groupAssetsByEmitStatus:{type:"boolean"},groupAssetsByExtension:{type:"boolean"},groupAssetsByInfo:{type:"boolean"},groupAssetsByPath:{type:"boolean"},groupModulesByAttributes:{type:"boolean"},groupModulesByCacheStatus:{type:"boolean"},groupModulesByExtension:{type:"boolean"},groupModulesByLayer:{type:"boolean"},groupModulesByPath:{type:"boolean"},groupModulesByType:{type:"boolean"},groupReasonsByOrigin:{type:"boolean"},hash:{type:"boolean"},ids:{type:"boolean"},logging:{anyOf:[{enum:["none","error","warn","info","log","verbose"]},{type:"boolean"}]},loggingDebug:{anyOf:[{type:"boolean"},{$ref:"#/definitions/FilterTypes"}]},loggingTrace:{type:"boolean"},moduleAssets:{type:"boolean"},moduleTrace:{type:"boolean"},modules:{type:"boolean"},modulesSort:{type:"string"},modulesSpace:{type:"number"},nestedModules:{type:"boolean"},nestedModulesSpace:{type:"number"},optimizationBailout:{type:"boolean"},orphanModules:{type:"boolean"},outputPath:{type:"boolean"},performance:{type:"boolean"},preset:{anyOf:[{type:"boolean"},{type:"string"}]},providedExports:{type:"boolean"},publicPath:{type:"boolean"},reasons:{type:"boolean"},reasonsSpace:{type:"number"},relatedAssets:{type:"boolean"},runtime:{type:"boolean"},runtimeModules:{type:"boolean"},source:{type:"boolean"},timings:{type:"boolean"},usedExports:{type:"boolean"},version:{type:"boolean"},warnings:{type:"boolean"},warningsCount:{type:"boolean"},warningsFilter:{oneOf:[{$ref:"#/definitions/WarningFilterTypes"}]},warningsSpace:{type:"number"}}},StatsValue:{anyOf:[{enum:["none","summary","errors-only","errors-warnings","minimal","normal","detailed","verbose"]},{type:"boolean"},{$ref:"#/definitions/StatsOptions"}]},StrictModuleErrorHandling:{type:"boolean"},StrictModuleExceptionHandling:{type:"boolean"},Target:{anyOf:[{type:"array",items:{type:"string",minLength:1},minItems:1},{enum:[!1]},{type:"string",minLength:1}]},TrustedTypes:{type:"object",additionalProperties:!1,properties:{onPolicyCreationFailure:{enum:["continue","stop"]},policyName:{type:"string",minLength:1}}},UmdNamedDefine:{type:"boolean"},UniqueName:{type:"string",minLength:1},WarningFilterItemTypes:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!1},{instanceof:"Function"}]},WarningFilterTypes:{anyOf:[{type:"array",items:{oneOf:[{$ref:"#/definitions/WarningFilterItemTypes"}]}},{$ref:"#/definitions/WarningFilterItemTypes"}]},WasmLoading:{anyOf:[{enum:[!1]},{$ref:"#/definitions/WasmLoadingType"}]},WasmLoadingType:{anyOf:[{enum:["fetch-streaming","fetch","async-node"]},{type:"string"}]},Watch:{type:"boolean"},WatchOptions:{type:"object",additionalProperties:!1,properties:{aggregateTimeout:{type:"number"},followSymlinks:{type:"boolean"},ignored:{anyOf:[{type:"array",items:{type:"string",minLength:1}},{instanceof:"RegExp"},{type:"string",minLength:1}]},poll:{anyOf:[{type:"number"},{type:"boolean"}]},stdin:{type:"boolean"}}},WebassemblyModuleFilename:{type:"string",absolutePath:!1},WebpackOptionsNormalized:{type:"object",additionalProperties:!1,properties:{amd:{$ref:"#/definitions/Amd"},bail:{$ref:"#/definitions/Bail"},cache:{$ref:"#/definitions/CacheOptionsNormalized"},context:{$ref:"#/definitions/Context"},dependencies:{$ref:"#/definitions/Dependencies"},devServer:{$ref:"#/definitions/DevServer"},devtool:{$ref:"#/definitions/DevTool"},entry:{$ref:"#/definitions/EntryNormalized"},experiments:{$ref:"#/definitions/ExperimentsNormalized"},externals:{$ref:"#/definitions/Externals"},externalsPresets:{$ref:"#/definitions/ExternalsPresets"},externalsType:{$ref:"#/definitions/ExternalsType"},ignoreWarnings:{$ref:"#/definitions/IgnoreWarningsNormalized"},infrastructureLogging:{$ref:"#/definitions/InfrastructureLogging"},loader:{$ref:"#/definitions/Loader"},mode:{$ref:"#/definitions/Mode"},module:{$ref:"#/definitions/ModuleOptionsNormalized"},name:{$ref:"#/definitions/Name"},node:{$ref:"#/definitions/Node"},optimization:{$ref:"#/definitions/Optimization"},output:{$ref:"#/definitions/OutputNormalized"},parallelism:{$ref:"#/definitions/Parallelism"},performance:{$ref:"#/definitions/Performance"},plugins:{$ref:"#/definitions/Plugins"},profile:{$ref:"#/definitions/Profile"},recordsInputPath:{$ref:"#/definitions/RecordsInputPath"},recordsOutputPath:{$ref:"#/definitions/RecordsOutputPath"},resolve:{$ref:"#/definitions/Resolve"},resolveLoader:{$ref:"#/definitions/ResolveLoader"},snapshot:{$ref:"#/definitions/SnapshotOptions"},stats:{$ref:"#/definitions/StatsValue"},target:{$ref:"#/definitions/Target"},watch:{$ref:"#/definitions/Watch"},watchOptions:{$ref:"#/definitions/WatchOptions"}},required:["cache","snapshot","entry","experiments","externals","externalsPresets","infrastructureLogging","module","node","optimization","output","plugins","resolve","resolveLoader","stats","watchOptions"]},WebpackPluginFunction:{instanceof:"Function"},WebpackPluginInstance:{type:"object",additionalProperties:!0,properties:{apply:{instanceof:"Function"}},required:["apply"]},WorkerPublicPath:{type:"string"}},type:"object",additionalProperties:!1,properties:{amd:{$ref:"#/definitions/Amd"},bail:{$ref:"#/definitions/Bail"},cache:{$ref:"#/definitions/CacheOptions"},context:{$ref:"#/definitions/Context"},dependencies:{$ref:"#/definitions/Dependencies"},devServer:{$ref:"#/definitions/DevServer"},devtool:{$ref:"#/definitions/DevTool"},entry:{$ref:"#/definitions/Entry"},experiments:{$ref:"#/definitions/Experiments"},extends:{$ref:"#/definitions/Extends"},externals:{$ref:"#/definitions/Externals"},externalsPresets:{$ref:"#/definitions/ExternalsPresets"},externalsType:{$ref:"#/definitions/ExternalsType"},ignoreWarnings:{$ref:"#/definitions/IgnoreWarnings"},infrastructureLogging:{$ref:"#/definitions/InfrastructureLogging"},loader:{$ref:"#/definitions/Loader"},mode:{$ref:"#/definitions/Mode"},module:{$ref:"#/definitions/ModuleOptions"},name:{$ref:"#/definitions/Name"},node:{$ref:"#/definitions/Node"},optimization:{$ref:"#/definitions/Optimization"},output:{$ref:"#/definitions/Output"},parallelism:{$ref:"#/definitions/Parallelism"},performance:{$ref:"#/definitions/Performance"},plugins:{$ref:"#/definitions/Plugins"},profile:{$ref:"#/definitions/Profile"},recordsInputPath:{$ref:"#/definitions/RecordsInputPath"},recordsOutputPath:{$ref:"#/definitions/RecordsOutputPath"},recordsPath:{$ref:"#/definitions/RecordsPath"},resolve:{$ref:"#/definitions/Resolve"},resolveLoader:{$ref:"#/definitions/ResolveLoader"},snapshot:{$ref:"#/definitions/SnapshotOptions"},stats:{$ref:"#/definitions/StatsValue"},target:{$ref:"#/definitions/Target"},watch:{$ref:"#/definitions/Watch"},watchOptions:{$ref:"#/definitions/WatchOptions"}}},n=Object.prototype.hasOwnProperty,r={type:"object",additionalProperties:!1,properties:{allowCollectingMemory:{type:"boolean"},buildDependencies:{type:"object",additionalProperties:{type:"array",items:{type:"string",minLength:1}}},cacheDirectory:{type:"string",absolutePath:!0},cacheLocation:{type:"string",absolutePath:!0},compression:{enum:[!1,"gzip","brotli"]},hashAlgorithm:{type:"string"},idleTimeout:{type:"number",minimum:0},idleTimeoutAfterLargeChanges:{type:"number",minimum:0},idleTimeoutForInitialStore:{type:"number",minimum:0},immutablePaths:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0,minLength:1}]}},managedPaths:{type:"array",items:{anyOf:[{instanceof:"RegExp"},{type:"string",absolutePath:!0,minLength:1}]}},maxAge:{type:"number",minimum:0},maxMemoryGenerations:{type:"number",minimum:0},memoryCacheUnaffected:{type:"boolean"},name:{type:"string"},profile:{type:"boolean"},readonly:{type:"boolean"},store:{enum:["pack"]},type:{enum:["filesystem"]},version:{type:"string"}},required:["type"]};function o(t,{instancePath:s="",parentData:i,parentDataProperty:a,rootData:l=t}={}){let p=null,f=0;const u=f;let c=!1;const y=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var m=y===f;if(c=c||m,!c){const o=f;if(f==f)if(t&&"object"==typeof t&&!Array.isArray(t)){let e;if(void 0===t.type&&(e="type")){const t={params:{missingProperty:e}};null===p?p=[t]:p.push(t),f++}else{const e=f;for(const e in t)if("cacheUnaffected"!==e&&"maxGenerations"!==e&&"type"!==e){const t={params:{additionalProperty:e}};null===p?p=[t]:p.push(t),f++;break}if(e===f){if(void 0!==t.cacheUnaffected){const e=f;if("boolean"!=typeof t.cacheUnaffected){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}var d=e===f}else d=!0;if(d){if(void 0!==t.maxGenerations){let e=t.maxGenerations;const n=f;if(f===n)if("number"==typeof e){if(e<1||isNaN(e)){const e={params:{comparison:">=",limit:1}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d)if(void 0!==t.type){const e=f;if("memory"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0}}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),f++}if(m=o===f,c=c||m,!c){const o=f;if(f==f)if(t&&"object"==typeof t&&!Array.isArray(t)){let o;if(void 0===t.type&&(o="type")){const e={params:{missingProperty:o}};null===p?p=[e]:p.push(e),f++}else{const o=f;for(const e in t)if(!n.call(r.properties,e)){const t={params:{additionalProperty:e}};null===p?p=[t]:p.push(t),f++;break}if(o===f){if(void 0!==t.allowCollectingMemory){const e=f;if("boolean"!=typeof t.allowCollectingMemory){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}var h=e===f}else h=!0;if(h){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=f;if(f===n)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=f;if(f===r)if(Array.isArray(n)){const e=n.length;for(let t=0;t=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.idleTimeoutAfterLargeChanges){let e=t.idleTimeoutAfterLargeChanges;const n=f;if(f===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.idleTimeoutForInitialStore){let e=t.idleTimeoutForInitialStore;const n=f;if(f===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=f;if(f===r)if(Array.isArray(n)){const t=n.length;for(let r=0;r=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.maxMemoryGenerations){let e=t.maxMemoryGenerations;const n=f;if(f===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.memoryCacheUnaffected){const e=f;if("boolean"!=typeof t.memoryCacheUnaffected){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.name){const e=f;if("string"!=typeof t.name){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.profile){const e=f;if("boolean"!=typeof t.profile){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.readonly){const e=f;if("boolean"!=typeof t.readonly){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.store){const e=f;if("pack"!==t.store){const e={params:{}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.type){const e=f;if("filesystem"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h)if(void 0!==t.version){const e=f;if("string"!=typeof t.version){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0}}}}}}}}}}}}}}}}}}}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),f++}m=o===f,c=c||m}}if(!c){const e={params:{}};return null===p?p=[e]:p.push(e),f++,o.errors=p,!1}return f=u,null!==p&&(u?p.length=u:p=null),o.errors=p,0===f}function s(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let a=null,l=0;const p=l;let f=!1;const u=l;if(!0!==e){const e={params:{}};null===a?a=[e]:a.push(e),l++}var c=u===l;if(f=f||c,!f){const s=l;o(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:i})||(a=null===a?o.errors:a.concat(o.errors),l=a.length),c=s===l,f=f||c}if(!f){const e={params:{}};return null===a?a=[e]:a.push(e),l++,s.errors=a,!1}return l=p,null!==a&&(p?a.length=p:a=null),s.errors=a,0===l}const i={type:"object",additionalProperties:!1,properties:{asyncChunks:{type:"boolean"},baseUri:{type:"string"},chunkLoading:{$ref:"#/definitions/ChunkLoading"},dependOn:{anyOf:[{type:"array",items:{type:"string",minLength:1},minItems:1,uniqueItems:!0},{type:"string",minLength:1}]},filename:{$ref:"#/definitions/EntryFilename"},import:{$ref:"#/definitions/EntryItem"},layer:{$ref:"#/definitions/Layer"},library:{$ref:"#/definitions/LibraryOptions"},publicPath:{$ref:"#/definitions/PublicPath"},runtime:{$ref:"#/definitions/EntryRuntime"},wasmLoading:{$ref:"#/definitions/WasmLoading"}},required:["import"]};function a(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const l=i;let p=!1;const f=i;if(!1!==e){const e={params:{}};null===s?s=[e]:s.push(e),i++}var u=f===i;if(p=p||u,!p){const t=i,n=i;let r=!1;const o=i;if("jsonp"!==e&&"import-scripts"!==e&&"require"!==e&&"async-node"!==e&&"import"!==e){const e={params:{}};null===s?s=[e]:s.push(e),i++}var c=o===i;if(r=r||c,!r){const t=i;if("string"!=typeof e){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}c=t===i,r=r||c}if(r)i=n,null!==s&&(n?s.length=n:s=null);else{const e={params:{}};null===s?s=[e]:s.push(e),i++}u=t===i,p=p||u}if(!p){const e={params:{}};return null===s?s=[e]:s.push(e),i++,a.errors=s,!1}return i=l,null!==s&&(l?s.length=l:s=null),a.errors=s,0===i}function l(t,{instancePath:n="",parentData:r,parentDataProperty:o,rootData:s=t}={}){let i=null,a=0;const p=a;let f=!1,u=null;const c=a,y=a;let m=!1;const d=a;if(a===d)if("string"==typeof t){if(t.includes("!")||!1!==e.test(t)){const e={params:{}};null===i?i=[e]:i.push(e),a++}else if(t.length<1){const e={params:{}};null===i?i=[e]:i.push(e),a++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),a++}var h=d===a;if(m=m||h,!m){const e=a;if(!(t instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),a++}h=e===a,m=m||h}if(m)a=y,null!==i&&(y?i.length=y:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),a++}if(c===a&&(f=!0,u=0),!f){const e={params:{passingSchemas:u}};return null===i?i=[e]:i.push(e),a++,l.errors=i,!1}return a=p,null!==i&&(p?i.length=p:i=null),l.errors=i,0===a}function p(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1;const f=i;if("string"!=typeof e){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}var u=f===i;if(l=l||u,!l){const t=i;if(i==i)if(e&&"object"==typeof e&&!Array.isArray(e)){const t=i;for(const t in e)if("amd"!==t&&"commonjs"!==t&&"commonjs2"!==t&&"root"!==t){const e={params:{additionalProperty:t}};null===s?s=[e]:s.push(e),i++;break}if(t===i){if(void 0!==e.amd){const t=i;if("string"!=typeof e.amd){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}var c=t===i}else c=!0;if(c){if(void 0!==e.commonjs){const t=i;if("string"!=typeof e.commonjs){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}c=t===i}else c=!0;if(c){if(void 0!==e.commonjs2){const t=i;if("string"!=typeof e.commonjs2){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}c=t===i}else c=!0;if(c)if(void 0!==e.root){const t=i;if("string"!=typeof e.root){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}c=t===i}else c=!0}}}}else{const e={params:{type:"object"}};null===s?s=[e]:s.push(e),i++}u=t===i,l=l||u}if(!l){const e={params:{}};return null===s?s=[e]:s.push(e),i++,p.errors=s,!1}return i=a,null!==s&&(a?s.length=a:s=null),p.errors=s,0===i}function f(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1;const p=i;if(i===p)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===s?s=[e]:s.push(e),i++}else{const t=e.length;for(let n=0;n1){const r={};for(;n--;){let o=t[n];if("string"==typeof o){if("number"==typeof r[o]){e=r[o];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),f++;break}r[o]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),f++}var g=s===f;if(o=o||g,!o){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}g=e===f,o=o||g}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),d=n===f}else d=!0;if(d){if(void 0!==e.filename){const n=f;l(e.filename,{instancePath:t+"/filename",parentData:e,parentDataProperty:"filename",rootData:s})||(p=null===p?l.errors:p.concat(l.errors),f=p.length),d=n===f}else d=!0;if(d){if(void 0!==e.import){let t=e.import;const n=f,r=f;let o=!1;const s=f;if(f===s)if(Array.isArray(t))if(t.length<1){const e={params:{limit:1}};null===p?p=[e]:p.push(e),f++}else{var b=!0;const e=t.length;for(let n=0;n1){const r={};for(;n--;){let o=t[n];if("string"==typeof o){if("number"==typeof r[o]){e=r[o];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),f++;break}r[o]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),f++}var v=s===f;if(o=o||v,!o){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}v=e===f,o=o||v}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),d=n===f}else d=!0;if(d){if(void 0!==e.layer){let t=e.layer;const n=f,r=f;let o=!1;const s=f;if(null!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var P=s===f;if(o=o||P,!o){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}P=e===f,o=o||P}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),d=n===f}else d=!0;if(d){if(void 0!==e.library){const n=f;u(e.library,{instancePath:t+"/library",parentData:e,parentDataProperty:"library",rootData:s})||(p=null===p?u.errors:p.concat(u.errors),f=p.length),d=n===f}else d=!0;if(d){if(void 0!==e.publicPath){const n=f;c(e.publicPath,{instancePath:t+"/publicPath",parentData:e,parentDataProperty:"publicPath",rootData:s})||(p=null===p?c.errors:p.concat(c.errors),f=p.length),d=n===f}else d=!0;if(d){if(void 0!==e.runtime){let t=e.runtime;const n=f,r=f;let o=!1;const s=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var D=s===f;if(o=o||D,!o){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}D=e===f,o=o||D}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),d=n===f}else d=!0;if(d)if(void 0!==e.wasmLoading){const n=f;y(e.wasmLoading,{instancePath:t+"/wasmLoading",parentData:e,parentDataProperty:"wasmLoading",rootData:s})||(p=null===p?y.errors:p.concat(y.errors),f=p.length),d=n===f}else d=!0}}}}}}}}}}}}}return m.errors=p,0===f}function d(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;if(0===i){if(!e||"object"!=typeof e||Array.isArray(e))return d.errors=[{params:{type:"object"}}],!1;for(const n in e){let r=e[n];const f=i,u=i;let c=!1;const y=i,h=i;let g=!1;const b=i;if(i===b)if(Array.isArray(r))if(r.length<1){const e={params:{limit:1}};null===s?s=[e]:s.push(e),i++}else{var a=!0;const e=r.length;for(let t=0;t1){const n={};for(;t--;){let o=r[t];if("string"==typeof o){if("number"==typeof n[o]){e=n[o];const r={params:{i:t,j:e}};null===s?s=[r]:s.push(r),i++;break}n[o]=t}}}}}else{const e={params:{type:"array"}};null===s?s=[e]:s.push(e),i++}var l=b===i;if(g=g||l,!g){const e=i;if(i===e)if("string"==typeof r){if(r.length<1){const e={params:{}};null===s?s=[e]:s.push(e),i++}}else{const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}l=e===i,g=g||l}if(g)i=h,null!==s&&(h?s.length=h:s=null);else{const e={params:{}};null===s?s=[e]:s.push(e),i++}var p=y===i;if(c=c||p,!c){const a=i;m(r,{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:o})||(s=null===s?m.errors:s.concat(m.errors),i=s.length),p=a===i,c=c||p}if(!c){const e={params:{}};return null===s?s=[e]:s.push(e),i++,d.errors=s,!1}if(i=u,null!==s&&(u?s.length=u:s=null),f!==i)break}}return d.errors=s,0===i}function h(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1,p=null;const f=i,u=i;let c=!1;const y=i;if(i===y)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===s?s=[e]:s.push(e),i++}else{var m=!0;const t=e.length;for(let n=0;n1){const r={};for(;n--;){let o=e[n];if("string"==typeof o){if("number"==typeof r[o]){t=r[o];const e={params:{i:n,j:t}};null===s?s=[e]:s.push(e),i++;break}r[o]=n}}}}}else{const e={params:{type:"array"}};null===s?s=[e]:s.push(e),i++}var d=y===i;if(c=c||d,!c){const t=i;if(i===t)if("string"==typeof e){if(e.length<1){const e={params:{}};null===s?s=[e]:s.push(e),i++}}else{const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}d=t===i,c=c||d}if(c)i=u,null!==s&&(u?s.length=u:s=null);else{const e={params:{}};null===s?s=[e]:s.push(e),i++}if(f===i&&(l=!0,p=0),!l){const e={params:{passingSchemas:p}};return null===s?s=[e]:s.push(e),i++,h.errors=s,!1}return i=a,null!==s&&(a?s.length=a:s=null),h.errors=s,0===i}function g(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1;const p=i;d(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:o})||(s=null===s?d.errors:s.concat(d.errors),i=s.length);var f=p===i;if(l=l||f,!l){const a=i;h(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:o})||(s=null===s?h.errors:s.concat(h.errors),i=s.length),f=a===i,l=l||f}if(!l){const e={params:{}};return null===s?s=[e]:s.push(e),i++,g.errors=s,!1}return i=a,null!==s&&(a?s.length=a:s=null),g.errors=s,0===i}function b(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1;const p=i;if(!(e instanceof Function)){const e={params:{}};null===s?s=[e]:s.push(e),i++}var f=p===i;if(l=l||f,!l){const a=i;g(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:o})||(s=null===s?g.errors:s.concat(g.errors),i=s.length),f=a===i,l=l||f}if(!l){const e={params:{}};return null===s?s=[e]:s.push(e),i++,b.errors=s,!1}return i=a,null!==s&&(a?s.length=a:s=null),b.errors=s,0===i}const v={type:"object",additionalProperties:!1,properties:{asyncWebAssembly:{type:"boolean"},backCompat:{type:"boolean"},buildHttp:{anyOf:[{$ref:"#/definitions/HttpUriAllowedUris"},{$ref:"#/definitions/HttpUriOptions"}]},cacheUnaffected:{type:"boolean"},css:{anyOf:[{type:"boolean"},{$ref:"#/definitions/CssExperimentOptions"}]},futureDefaults:{type:"boolean"},layers:{type:"boolean"},lazyCompilation:{anyOf:[{type:"boolean"},{$ref:"#/definitions/LazyCompilationOptions"}]},outputModule:{type:"boolean"},syncWebAssembly:{type:"boolean"},topLevelAwait:{type:"boolean"}}},P=new RegExp("^https?://","u");function D(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1,p=null;const f=i;if(i==i)if(Array.isArray(e)){const t=e.length;for(let n=0;n=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var u=y===l;if(c=c||u,!c){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}u=t===l,c=c||u}if(c)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,o=l;let s=!1;const i=l;if(l===i)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===a?a=[e]:a.push(e),l++}else if(n.length<1){const e={params:{}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}var c=i===l;if(s=s||c,!s){const e=l;if(!(n instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}c=e===l,s=s||c}if(!s){const e={params:{}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=o,null!==a&&(o?a.length=o:a=null),p=r===l}else p=!0;if(p){if(void 0!==t.idHint){const e=l;if("string"!=typeof t.idHint)return fe.errors=[{params:{type:"string"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.layer){let e=t.layer;const n=l,r=l;let o=!1;const s=l;if(!(e instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}var y=s===l;if(o=o||y,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(y=t===l,o=o||y,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}y=t===l,o=o||y}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e)return fe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return fe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var m=c===l;if(u=u||m,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}m=t===l,u=u||m}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e)return fe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return fe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var d=c===l;if(u=u||d,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}d=t===l,u=u||d}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var h=c===l;if(u=u||h,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}h=t===l,u=u||h}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e)return fe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return fe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var g=c===l;if(u=u||g,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}g=t===l,u=u||g}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var b=c===l;if(u=u||b,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}b=t===l,u=u||b}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSizeReduction){let e=t.minSizeReduction;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var v=c===l;if(u=u||v,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}v=t===l,u=u||v}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let o=!1;const s=l;if(!1!==e){const e={params:{}};null===a?a=[e]:a.push(e),l++}var P=s===l;if(o=o||P,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(P=t===l,o=o||P,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}P=t===l,o=o||P}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.priority){const e=l;if("number"!=typeof t.priority)return fe.errors=[{params:{type:"number"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.reuseExistingChunk){const e=l;if("boolean"!=typeof t.reuseExistingChunk)return fe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.test){let e=t.test;const n=l,r=l;let o=!1;const s=l;if(!(e instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}var D=s===l;if(o=o||D,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(D=t===l,o=o||D,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}D=t===l,o=o||D}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.type){let e=t.type;const n=l,r=l;let o=!1;const s=l;if(!(e instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}var O=s===l;if(o=o||O,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(O=t===l,o=o||O,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}O=t===l,o=o||O}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,fe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return fe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}}}}}return fe.errors=a,0===l}function ue(t,{instancePath:r="",parentData:o,parentDataProperty:s,rootData:i=t}={}){let a=null,l=0;if(0===l){if(!t||"object"!=typeof t||Array.isArray(t))return ue.errors=[{params:{type:"object"}}],!1;{const o=l;for(const e in t)if(!n.call(le.properties,e))return ue.errors=[{params:{additionalProperty:e}}],!1;if(o===l){if(void 0!==t.automaticNameDelimiter){let e=t.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof e)return ue.errors=[{params:{type:"string"}}],!1;if(e.length<1)return ue.errors=[{params:{}}],!1}var p=n===l}else p=!0;if(p){if(void 0!==t.cacheGroups){let e=t.cacheGroups;const n=l,o=l,s=l;if(l===s)if(e&&"object"==typeof e&&!Array.isArray(e)){let t;if(void 0===e.test&&(t="test")){const e={};null===a?a=[e]:a.push(e),l++}else if(void 0!==e.test){let t=e.test;const n=l;let r=!1;const o=l;if(!(t instanceof RegExp)){const e={};null===a?a=[e]:a.push(e),l++}var f=o===l;if(r=r||f,!r){const e=l;if("string"!=typeof t){const e={};null===a?a=[e]:a.push(e),l++}if(f=e===l,r=r||f,!r){const e=l;if(!(t instanceof Function)){const e={};null===a?a=[e]:a.push(e),l++}f=e===l,r=r||f}}if(r)l=n,null!==a&&(n?a.length=n:a=null);else{const e={};null===a?a=[e]:a.push(e),l++}}}else{const e={};null===a?a=[e]:a.push(e),l++}if(s===l)return ue.errors=[{params:{}}],!1;if(l=o,null!==a&&(o?a.length=o:a=null),l===n){if(!e||"object"!=typeof e||Array.isArray(e))return ue.errors=[{params:{type:"object"}}],!1;for(const t in e){let n=e[t];const o=l,s=l;let p=!1;const f=l;if(!1!==n){const e={params:{}};null===a?a=[e]:a.push(e),l++}var u=f===l;if(p=p||u,!p){const o=l;if(!(n instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}if(u=o===l,p=p||u,!p){const o=l;if("string"!=typeof n){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(u=o===l,p=p||u,!p){const o=l;if(!(n instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}if(u=o===l,p=p||u,!p){const o=l;fe(n,{instancePath:r+"/cacheGroups/"+t.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:t,rootData:i})||(a=null===a?fe.errors:a.concat(fe.errors),l=a.length),u=o===l,p=p||u}}}}if(!p){const e={params:{}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}if(l=s,null!==a&&(s?a.length=s:a=null),o!==l)break}}p=n===l}else p=!0;if(p){if(void 0!==t.chunks){let e=t.chunks;const n=l,r=l;let o=!1;const s=l;if("initial"!==e&&"async"!==e&&"all"!==e){const e={params:{}};null===a?a=[e]:a.push(e),l++}var c=s===l;if(o=o||c,!o){const t=l;if(!(e instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}if(c=t===l,o=o||c,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}c=t===l,o=o||c}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.defaultSizeTypes){let e=t.defaultSizeTypes;const n=l;if(l===n){if(!Array.isArray(e))return ue.errors=[{params:{type:"array"}}],!1;if(e.length<1)return ue.errors=[{params:{limit:1}}],!1;{const t=e.length;for(let n=0;n=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var y=c===l;if(u=u||y,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}y=t===l,u=u||y}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.fallbackCacheGroup){let e=t.fallbackCacheGroup;const n=l;if(l===n){if(!e||"object"!=typeof e||Array.isArray(e))return ue.errors=[{params:{type:"object"}}],!1;{const t=l;for(const t in e)if("automaticNameDelimiter"!==t&&"chunks"!==t&&"maxAsyncSize"!==t&&"maxInitialSize"!==t&&"maxSize"!==t&&"minSize"!==t&&"minSizeReduction"!==t)return ue.errors=[{params:{additionalProperty:t}}],!1;if(t===l){if(void 0!==e.automaticNameDelimiter){let t=e.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof t)return ue.errors=[{params:{type:"string"}}],!1;if(t.length<1)return ue.errors=[{params:{}}],!1}var m=n===l}else m=!0;if(m){if(void 0!==e.chunks){let t=e.chunks;const n=l,r=l;let o=!1;const s=l;if("initial"!==t&&"async"!==t&&"all"!==t){const e={params:{}};null===a?a=[e]:a.push(e),l++}var d=s===l;if(o=o||d,!o){const e=l;if(!(t instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}if(d=e===l,o=o||d,!o){const e=l;if(!(t instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}d=e===l,o=o||d}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m){if(void 0!==e.maxAsyncSize){let t=e.maxAsyncSize;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var h=u===l;if(f=f||h,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}h=e===l,f=f||h}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m){if(void 0!==e.maxInitialSize){let t=e.maxInitialSize;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var g=u===l;if(f=f||g,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}g=e===l,f=f||g}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m){if(void 0!==e.maxSize){let t=e.maxSize;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var b=u===l;if(f=f||b,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}b=e===l,f=f||b}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m){if(void 0!==e.minSize){let t=e.minSize;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var v=u===l;if(f=f||v,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}v=e===l,f=f||v}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m)if(void 0!==e.minSizeReduction){let t=e.minSizeReduction;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var P=u===l;if(f=f||P,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}P=e===l,f=f||P}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0}}}}}}}}p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,o=l;let s=!1;const i=l;if(l===i)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===a?a=[e]:a.push(e),l++}else if(n.length<1){const e={params:{}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}var D=i===l;if(s=s||D,!s){const e=l;if(!(n instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}D=e===l,s=s||D}if(!s){const e={params:{}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=o,null!==a&&(o?a.length=o:a=null),p=r===l}else p=!0;if(p){if(void 0!==t.hidePathInfo){const e=l;if("boolean"!=typeof t.hidePathInfo)return ue.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e)return ue.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return ue.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var O=c===l;if(u=u||O,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}O=t===l,u=u||O}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e)return ue.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return ue.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var x=c===l;if(u=u||x,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}x=t===l,u=u||x}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var A=c===l;if(u=u||A,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}A=t===l,u=u||A}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e)return ue.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return ue.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var C=c===l;if(u=u||C,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}C=t===l,u=u||C}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var k=c===l;if(u=u||k,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}k=t===l,u=u||k}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSizeReduction){let e=t.minSizeReduction;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var $=c===l;if(u=u||$,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}$=t===l,u=u||$}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let o=!1;const s=l;if(!1!==e){const e={params:{}};null===a?a=[e]:a.push(e),l++}var S=s===l;if(o=o||S,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(S=t===l,o=o||S,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}S=t===l,o=o||S}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,ue.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return ue.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}}return ue.errors=a,0===l}function ce(e,{instancePath:t="",parentData:r,parentDataProperty:o,rootData:s=e}={}){let i=null,a=0;if(0===a){if(!e||"object"!=typeof e||Array.isArray(e))return ce.errors=[{params:{type:"object"}}],!1;{const r=a;for(const t in e)if(!n.call(ae.properties,t))return ce.errors=[{params:{additionalProperty:t}}],!1;if(r===a){if(void 0!==e.checkWasmTypes){const t=a;if("boolean"!=typeof e.checkWasmTypes)return ce.errors=[{params:{type:"boolean"}}],!1;var l=t===a}else l=!0;if(l){if(void 0!==e.chunkIds){let t=e.chunkIds;const n=a;if("natural"!==t&&"named"!==t&&"deterministic"!==t&&"size"!==t&&"total-size"!==t&&!1!==t)return ce.errors=[{params:{}}],!1;l=n===a}else l=!0;if(l){if(void 0!==e.concatenateModules){const t=a;if("boolean"!=typeof e.concatenateModules)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.emitOnErrors){const t=a;if("boolean"!=typeof e.emitOnErrors)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.flagIncludedChunks){const t=a;if("boolean"!=typeof e.flagIncludedChunks)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.innerGraph){const t=a;if("boolean"!=typeof e.innerGraph)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.mangleExports){let t=e.mangleExports;const n=a,r=a;let o=!1;const s=a;if("size"!==t&&"deterministic"!==t){const e={params:{}};null===i?i=[e]:i.push(e),a++}var p=s===a;if(o=o||p,!o){const e=a;if("boolean"!=typeof t){const e={params:{type:"boolean"}};null===i?i=[e]:i.push(e),a++}p=e===a,o=o||p}if(!o){const e={params:{}};return null===i?i=[e]:i.push(e),a++,ce.errors=i,!1}a=r,null!==i&&(r?i.length=r:i=null),l=n===a}else l=!0;if(l){if(void 0!==e.mangleWasmImports){const t=a;if("boolean"!=typeof e.mangleWasmImports)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.mergeDuplicateChunks){const t=a;if("boolean"!=typeof e.mergeDuplicateChunks)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.minimize){const t=a;if("boolean"!=typeof e.minimize)return ce.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.minimizer){let t=e.minimizer;const n=a;if(a===n){if(!Array.isArray(t))return ce.errors=[{params:{type:"array"}}],!1;{const e=t.length;for(let n=0;n=",limit:1}}],!1}u=n===f}else u=!0;if(u){if(void 0!==t.hashFunction){let e=t.hashFunction;const n=f,r=f;let o=!1;const s=f;if(f===s)if("string"==typeof e){if(e.length<1){const e={params:{}};null===l?l=[e]:l.push(e),f++}}else{const e={params:{type:"string"}};null===l?l=[e]:l.push(e),f++}var v=s===f;if(o=o||v,!o){const t=f;if(!(e instanceof Function)){const e={params:{}};null===l?l=[e]:l.push(e),f++}v=t===f,o=o||v}if(!o){const e={params:{}};return null===l?l=[e]:l.push(e),f++,Ae.errors=l,!1}f=r,null!==l&&(r?l.length=r:l=null),u=n===f}else u=!0;if(u){if(void 0!==t.hashSalt){let e=t.hashSalt;const n=f;if(f==f){if("string"!=typeof e)return Ae.errors=[{params:{type:"string"}}],!1;if(e.length<1)return Ae.errors=[{params:{}}],!1}u=n===f}else u=!0;if(u){if(void 0!==t.hotUpdateChunkFilename){let n=t.hotUpdateChunkFilename;const r=f;if(f==f){if("string"!=typeof n)return Ae.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return Ae.errors=[{params:{}}],!1}u=r===f}else u=!0;if(u){if(void 0!==t.hotUpdateGlobal){const e=f;if("string"!=typeof t.hotUpdateGlobal)return Ae.errors=[{params:{type:"string"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.hotUpdateMainFilename){let n=t.hotUpdateMainFilename;const r=f;if(f==f){if("string"!=typeof n)return Ae.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return Ae.errors=[{params:{}}],!1}u=r===f}else u=!0;if(u){if(void 0!==t.ignoreBrowserWarnings){const e=f;if("boolean"!=typeof t.ignoreBrowserWarnings)return Ae.errors=[{params:{type:"boolean"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.iife){const e=f;if("boolean"!=typeof t.iife)return Ae.errors=[{params:{type:"boolean"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.importFunctionName){const e=f;if("string"!=typeof t.importFunctionName)return Ae.errors=[{params:{type:"string"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.importMetaName){const e=f;if("string"!=typeof t.importMetaName)return Ae.errors=[{params:{type:"string"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.library){const e=f;xe(t.library,{instancePath:r+"/library",parentData:t,parentDataProperty:"library",rootData:i})||(l=null===l?xe.errors:l.concat(xe.errors),f=l.length),u=e===f}else u=!0;if(u){if(void 0!==t.libraryExport){let e=t.libraryExport;const n=f,r=f;let o=!1,s=null;const i=f,a=f;let p=!1;const c=f;if(f===c)if(Array.isArray(e)){const t=e.length;for(let n=0;n=",limit:1}}],!1}c=t===f}else c=!0;if(c){if(void 0!==r.performance){const e=f;Ce(r.performance,{instancePath:o+"/performance",parentData:r,parentDataProperty:"performance",rootData:l})||(p=null===p?Ce.errors:p.concat(Ce.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.plugins){const e=f;ke(r.plugins,{instancePath:o+"/plugins",parentData:r,parentDataProperty:"plugins",rootData:l})||(p=null===p?ke.errors:p.concat(ke.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.profile){const e=f;if("boolean"!=typeof r.profile)return we.errors=[{params:{type:"boolean"}}],!1;c=e===f}else c=!0;if(c){if(void 0!==r.recordsInputPath){let t=r.recordsInputPath;const n=f,o=f;let s=!1;const i=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var g=i===f;if(s=s||g,!s){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}g=n===f,s=s||g}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,we.errors=p,!1}f=o,null!==p&&(o?p.length=o:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.recordsOutputPath){let t=r.recordsOutputPath;const n=f,o=f;let s=!1;const i=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var v=i===f;if(s=s||v,!s){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}v=n===f,s=s||v}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,we.errors=p,!1}f=o,null!==p&&(o?p.length=o:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.recordsPath){let t=r.recordsPath;const n=f,o=f;let s=!1;const i=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var P=i===f;if(s=s||P,!s){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}P=n===f,s=s||P}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,we.errors=p,!1}f=o,null!==p&&(o?p.length=o:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.resolve){const e=f;$e(r.resolve,{instancePath:o+"/resolve",parentData:r,parentDataProperty:"resolve",rootData:l})||(p=null===p?$e.errors:p.concat($e.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.resolveLoader){const e=f;Se(r.resolveLoader,{instancePath:o+"/resolveLoader",parentData:r,parentDataProperty:"resolveLoader",rootData:l})||(p=null===p?Se.errors:p.concat(Se.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.snapshot){let t=r.snapshot;const n=f;if(f==f){if(!t||"object"!=typeof t||Array.isArray(t))return we.errors=[{params:{type:"object"}}],!1;{const n=f;for(const e in t)if("buildDependencies"!==e&&"immutablePaths"!==e&&"managedPaths"!==e&&"module"!==e&&"resolve"!==e&&"resolveBuildDependencies"!==e)return we.errors=[{params:{additionalProperty:e}}],!1;if(n===f){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=f;if(f===n){if(!e||"object"!=typeof e||Array.isArray(e))return we.errors=[{params:{type:"object"}}],!1;{const t=f;for(const t in e)if("hash"!==t&&"timestamp"!==t)return we.errors=[{params:{additionalProperty:t}}],!1;if(t===f){if(void 0!==e.hash){const t=f;if("boolean"!=typeof e.hash)return we.errors=[{params:{type:"boolean"}}],!1;var D=t===f}else D=!0;if(D)if(void 0!==e.timestamp){const t=f;if("boolean"!=typeof e.timestamp)return we.errors=[{params:{type:"boolean"}}],!1;D=t===f}else D=!0}}}var O=n===f}else O=!0;if(O){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=f;if(f===r){if(!Array.isArray(n))return we.errors=[{params:{type:"array"}}],!1;{const t=n.length;for(let r=0;r=",limit:1}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}d=n===f}else d=!0;if(d)if(void 0!==t.type){const e=f;if("memory"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),f++}d=e===f}else d=!0}}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),f++}if(m=o===f,c=c||m,!c){const o=f;if(f==f)if(t&&"object"==typeof t&&!Array.isArray(t)){let o;if(void 0===t.type&&(o="type")){const e={params:{missingProperty:o}};null===p?p=[e]:p.push(e),f++}else{const o=f;for(const e in t)if(!n.call(r.properties,e)){const t={params:{additionalProperty:e}};null===p?p=[t]:p.push(t),f++;break}if(o===f){if(void 0!==t.allowCollectingMemory){const e=f;if("boolean"!=typeof t.allowCollectingMemory){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}var h=e===f}else h=!0;if(h){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=f;if(f===n)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){let n=e[t];const r=f;if(f===r)if(Array.isArray(n)){const e=n.length;for(let t=0;t=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.idleTimeoutAfterLargeChanges){let e=t.idleTimeoutAfterLargeChanges;const n=f;if(f===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.idleTimeoutForInitialStore){let e=t.idleTimeoutForInitialStore;const n=f;if(f===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=f;if(f===r)if(Array.isArray(n)){const t=n.length;for(let r=0;r=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.maxMemoryGenerations){let e=t.maxMemoryGenerations;const n=f;if(f===n)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"number"}};null===p?p=[e]:p.push(e),f++}h=n===f}else h=!0;if(h){if(void 0!==t.memoryCacheUnaffected){const e=f;if("boolean"!=typeof t.memoryCacheUnaffected){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.name){const e=f;if("string"!=typeof t.name){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.profile){const e=f;if("boolean"!=typeof t.profile){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.readonly){const e=f;if("boolean"!=typeof t.readonly){const e={params:{type:"boolean"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.store){const e=f;if("pack"!==t.store){const e={params:{}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h){if(void 0!==t.type){const e=f;if("filesystem"!==t.type){const e={params:{}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0;if(h)if(void 0!==t.version){const e=f;if("string"!=typeof t.version){const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}h=e===f}else h=!0}}}}}}}}}}}}}}}}}}}}}else{const e={params:{type:"object"}};null===p?p=[e]:p.push(e),f++}m=o===f,c=c||m}}if(!c){const e={params:{}};return null===p?p=[e]:p.push(e),f++,o.errors=p,!1}return f=u,null!==p&&(u?p.length=u:p=null),o.errors=p,0===f}function s(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:i=e}={}){let a=null,l=0;const p=l;let f=!1;const u=l;if(!0!==e){const e={params:{}};null===a?a=[e]:a.push(e),l++}var c=u===l;if(f=f||c,!f){const s=l;o(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:i})||(a=null===a?o.errors:a.concat(o.errors),l=a.length),c=s===l,f=f||c}if(!f){const e={params:{}};return null===a?a=[e]:a.push(e),l++,s.errors=a,!1}return l=p,null!==a&&(p?a.length=p:a=null),s.errors=a,0===l}const i={type:"object",additionalProperties:!1,properties:{asyncChunks:{type:"boolean"},baseUri:{type:"string"},chunkLoading:{$ref:"#/definitions/ChunkLoading"},dependOn:{anyOf:[{type:"array",items:{type:"string",minLength:1},minItems:1,uniqueItems:!0},{type:"string",minLength:1}]},filename:{$ref:"#/definitions/EntryFilename"},import:{$ref:"#/definitions/EntryItem"},layer:{$ref:"#/definitions/Layer"},library:{$ref:"#/definitions/LibraryOptions"},publicPath:{$ref:"#/definitions/PublicPath"},runtime:{$ref:"#/definitions/EntryRuntime"},wasmLoading:{$ref:"#/definitions/WasmLoading"}},required:["import"]};function a(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const l=i;let p=!1;const f=i;if(!1!==e){const e={params:{}};null===s?s=[e]:s.push(e),i++}var u=f===i;if(p=p||u,!p){const t=i,n=i;let r=!1;const o=i;if("jsonp"!==e&&"import-scripts"!==e&&"require"!==e&&"async-node"!==e&&"import"!==e){const e={params:{}};null===s?s=[e]:s.push(e),i++}var c=o===i;if(r=r||c,!r){const t=i;if("string"!=typeof e){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}c=t===i,r=r||c}if(r)i=n,null!==s&&(n?s.length=n:s=null);else{const e={params:{}};null===s?s=[e]:s.push(e),i++}u=t===i,p=p||u}if(!p){const e={params:{}};return null===s?s=[e]:s.push(e),i++,a.errors=s,!1}return i=l,null!==s&&(l?s.length=l:s=null),a.errors=s,0===i}function l(t,{instancePath:n="",parentData:r,parentDataProperty:o,rootData:s=t}={}){let i=null,a=0;const p=a;let f=!1,u=null;const c=a,y=a;let m=!1;const d=a;if(a===d)if("string"==typeof t){if(t.includes("!")||!1!==e.test(t)){const e={params:{}};null===i?i=[e]:i.push(e),a++}else if(t.length<1){const e={params:{}};null===i?i=[e]:i.push(e),a++}}else{const e={params:{type:"string"}};null===i?i=[e]:i.push(e),a++}var h=d===a;if(m=m||h,!m){const e=a;if(!(t instanceof Function)){const e={params:{}};null===i?i=[e]:i.push(e),a++}h=e===a,m=m||h}if(m)a=y,null!==i&&(y?i.length=y:i=null);else{const e={params:{}};null===i?i=[e]:i.push(e),a++}if(c===a&&(f=!0,u=0),!f){const e={params:{passingSchemas:u}};return null===i?i=[e]:i.push(e),a++,l.errors=i,!1}return a=p,null!==i&&(p?i.length=p:i=null),l.errors=i,0===a}function p(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1;const f=i;if("string"!=typeof e){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}var u=f===i;if(l=l||u,!l){const t=i;if(i==i)if(e&&"object"==typeof e&&!Array.isArray(e)){const t=i;for(const t in e)if("amd"!==t&&"commonjs"!==t&&"commonjs2"!==t&&"root"!==t){const e={params:{additionalProperty:t}};null===s?s=[e]:s.push(e),i++;break}if(t===i){if(void 0!==e.amd){const t=i;if("string"!=typeof e.amd){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}var c=t===i}else c=!0;if(c){if(void 0!==e.commonjs){const t=i;if("string"!=typeof e.commonjs){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}c=t===i}else c=!0;if(c){if(void 0!==e.commonjs2){const t=i;if("string"!=typeof e.commonjs2){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}c=t===i}else c=!0;if(c)if(void 0!==e.root){const t=i;if("string"!=typeof e.root){const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}c=t===i}else c=!0}}}}else{const e={params:{type:"object"}};null===s?s=[e]:s.push(e),i++}u=t===i,l=l||u}if(!l){const e={params:{}};return null===s?s=[e]:s.push(e),i++,p.errors=s,!1}return i=a,null!==s&&(a?s.length=a:s=null),p.errors=s,0===i}function f(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1;const p=i;if(i===p)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===s?s=[e]:s.push(e),i++}else{const t=e.length;for(let n=0;n1){const r={};for(;n--;){let o=t[n];if("string"==typeof o){if("number"==typeof r[o]){e=r[o];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),f++;break}r[o]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),f++}var g=s===f;if(o=o||g,!o){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}g=e===f,o=o||g}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),d=n===f}else d=!0;if(d){if(void 0!==e.filename){const n=f;l(e.filename,{instancePath:t+"/filename",parentData:e,parentDataProperty:"filename",rootData:s})||(p=null===p?l.errors:p.concat(l.errors),f=p.length),d=n===f}else d=!0;if(d){if(void 0!==e.import){let t=e.import;const n=f,r=f;let o=!1;const s=f;if(f===s)if(Array.isArray(t))if(t.length<1){const e={params:{limit:1}};null===p?p=[e]:p.push(e),f++}else{var b=!0;const e=t.length;for(let n=0;n1){const r={};for(;n--;){let o=t[n];if("string"==typeof o){if("number"==typeof r[o]){e=r[o];const t={params:{i:n,j:e}};null===p?p=[t]:p.push(t),f++;break}r[o]=n}}}}}else{const e={params:{type:"array"}};null===p?p=[e]:p.push(e),f++}var v=s===f;if(o=o||v,!o){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}v=e===f,o=o||v}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),d=n===f}else d=!0;if(d){if(void 0!==e.layer){let t=e.layer;const n=f,r=f;let o=!1;const s=f;if(null!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var P=s===f;if(o=o||P,!o){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}P=e===f,o=o||P}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),d=n===f}else d=!0;if(d){if(void 0!==e.library){const n=f;u(e.library,{instancePath:t+"/library",parentData:e,parentDataProperty:"library",rootData:s})||(p=null===p?u.errors:p.concat(u.errors),f=p.length),d=n===f}else d=!0;if(d){if(void 0!==e.publicPath){const n=f;c(e.publicPath,{instancePath:t+"/publicPath",parentData:e,parentDataProperty:"publicPath",rootData:s})||(p=null===p?c.errors:p.concat(c.errors),f=p.length),d=n===f}else d=!0;if(d){if(void 0!==e.runtime){let t=e.runtime;const n=f,r=f;let o=!1;const s=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var D=s===f;if(o=o||D,!o){const e=f;if(f===e)if("string"==typeof t){if(t.length<1){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}D=e===f,o=o||D}if(!o){const e={params:{}};return null===p?p=[e]:p.push(e),f++,m.errors=p,!1}f=r,null!==p&&(r?p.length=r:p=null),d=n===f}else d=!0;if(d)if(void 0!==e.wasmLoading){const n=f;y(e.wasmLoading,{instancePath:t+"/wasmLoading",parentData:e,parentDataProperty:"wasmLoading",rootData:s})||(p=null===p?y.errors:p.concat(y.errors),f=p.length),d=n===f}else d=!0}}}}}}}}}}}}}return m.errors=p,0===f}function d(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;if(0===i){if(!e||"object"!=typeof e||Array.isArray(e))return d.errors=[{params:{type:"object"}}],!1;for(const n in e){let r=e[n];const f=i,u=i;let c=!1;const y=i,h=i;let g=!1;const b=i;if(i===b)if(Array.isArray(r))if(r.length<1){const e={params:{limit:1}};null===s?s=[e]:s.push(e),i++}else{var a=!0;const e=r.length;for(let t=0;t1){const n={};for(;t--;){let o=r[t];if("string"==typeof o){if("number"==typeof n[o]){e=n[o];const r={params:{i:t,j:e}};null===s?s=[r]:s.push(r),i++;break}n[o]=t}}}}}else{const e={params:{type:"array"}};null===s?s=[e]:s.push(e),i++}var l=b===i;if(g=g||l,!g){const e=i;if(i===e)if("string"==typeof r){if(r.length<1){const e={params:{}};null===s?s=[e]:s.push(e),i++}}else{const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}l=e===i,g=g||l}if(g)i=h,null!==s&&(h?s.length=h:s=null);else{const e={params:{}};null===s?s=[e]:s.push(e),i++}var p=y===i;if(c=c||p,!c){const a=i;m(r,{instancePath:t+"/"+n.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:n,rootData:o})||(s=null===s?m.errors:s.concat(m.errors),i=s.length),p=a===i,c=c||p}if(!c){const e={params:{}};return null===s?s=[e]:s.push(e),i++,d.errors=s,!1}if(i=u,null!==s&&(u?s.length=u:s=null),f!==i)break}}return d.errors=s,0===i}function h(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1,p=null;const f=i,u=i;let c=!1;const y=i;if(i===y)if(Array.isArray(e))if(e.length<1){const e={params:{limit:1}};null===s?s=[e]:s.push(e),i++}else{var m=!0;const t=e.length;for(let n=0;n1){const r={};for(;n--;){let o=e[n];if("string"==typeof o){if("number"==typeof r[o]){t=r[o];const e={params:{i:n,j:t}};null===s?s=[e]:s.push(e),i++;break}r[o]=n}}}}}else{const e={params:{type:"array"}};null===s?s=[e]:s.push(e),i++}var d=y===i;if(c=c||d,!c){const t=i;if(i===t)if("string"==typeof e){if(e.length<1){const e={params:{}};null===s?s=[e]:s.push(e),i++}}else{const e={params:{type:"string"}};null===s?s=[e]:s.push(e),i++}d=t===i,c=c||d}if(c)i=u,null!==s&&(u?s.length=u:s=null);else{const e={params:{}};null===s?s=[e]:s.push(e),i++}if(f===i&&(l=!0,p=0),!l){const e={params:{passingSchemas:p}};return null===s?s=[e]:s.push(e),i++,h.errors=s,!1}return i=a,null!==s&&(a?s.length=a:s=null),h.errors=s,0===i}function g(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1;const p=i;d(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:o})||(s=null===s?d.errors:s.concat(d.errors),i=s.length);var f=p===i;if(l=l||f,!l){const a=i;h(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:o})||(s=null===s?h.errors:s.concat(h.errors),i=s.length),f=a===i,l=l||f}if(!l){const e={params:{}};return null===s?s=[e]:s.push(e),i++,g.errors=s,!1}return i=a,null!==s&&(a?s.length=a:s=null),g.errors=s,0===i}function b(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1;const p=i;if(!(e instanceof Function)){const e={params:{}};null===s?s=[e]:s.push(e),i++}var f=p===i;if(l=l||f,!l){const a=i;g(e,{instancePath:t,parentData:n,parentDataProperty:r,rootData:o})||(s=null===s?g.errors:s.concat(g.errors),i=s.length),f=a===i,l=l||f}if(!l){const e={params:{}};return null===s?s=[e]:s.push(e),i++,b.errors=s,!1}return i=a,null!==s&&(a?s.length=a:s=null),b.errors=s,0===i}const v={type:"object",additionalProperties:!1,properties:{asyncWebAssembly:{type:"boolean"},backCompat:{type:"boolean"},buildHttp:{anyOf:[{$ref:"#/definitions/HttpUriAllowedUris"},{$ref:"#/definitions/HttpUriOptions"}]},cacheUnaffected:{type:"boolean"},css:{type:"boolean"},futureDefaults:{type:"boolean"},layers:{type:"boolean"},lazyCompilation:{anyOf:[{type:"boolean"},{$ref:"#/definitions/LazyCompilationOptions"}]},outputModule:{type:"boolean"},syncWebAssembly:{type:"boolean"},topLevelAwait:{type:"boolean"}}},P=new RegExp("^https?://","u");function D(e,{instancePath:t="",parentData:n,parentDataProperty:r,rootData:o=e}={}){let s=null,i=0;const a=i;let l=!1,p=null;const f=i;if(i==i)if(Array.isArray(e)){const t=e.length;for(let n=0;n=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var u=y===l;if(c=c||u,!c){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}u=t===l,c=c||u}if(c)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,Pe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,o=l;let s=!1;const i=l;if(l===i)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===a?a=[e]:a.push(e),l++}else if(n.length<1){const e={params:{}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}var c=i===l;if(s=s||c,!s){const e=l;if(!(n instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}c=e===l,s=s||c}if(!s){const e={params:{}};return null===a?a=[e]:a.push(e),l++,Pe.errors=a,!1}l=o,null!==a&&(o?a.length=o:a=null),p=r===l}else p=!0;if(p){if(void 0!==t.idHint){const e=l;if("string"!=typeof t.idHint)return Pe.errors=[{params:{type:"string"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.layer){let e=t.layer;const n=l,r=l;let o=!1;const s=l;if(!(e instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}var y=s===l;if(o=o||y,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(y=t===l,o=o||y,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}y=t===l,o=o||y}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,Pe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e)return Pe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return Pe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var m=c===l;if(u=u||m,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}m=t===l,u=u||m}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,Pe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e)return Pe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return Pe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var d=c===l;if(u=u||d,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}d=t===l,u=u||d}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,Pe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var h=c===l;if(u=u||h,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}h=t===l,u=u||h}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,Pe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e)return Pe.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return Pe.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var g=c===l;if(u=u||g,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}g=t===l,u=u||g}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,Pe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var b=c===l;if(u=u||b,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}b=t===l,u=u||b}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,Pe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSizeReduction){let e=t.minSizeReduction;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var v=c===l;if(u=u||v,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}v=t===l,u=u||v}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,Pe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let o=!1;const s=l;if(!1!==e){const e={params:{}};null===a?a=[e]:a.push(e),l++}var P=s===l;if(o=o||P,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(P=t===l,o=o||P,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}P=t===l,o=o||P}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,Pe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.priority){const e=l;if("number"!=typeof t.priority)return Pe.errors=[{params:{type:"number"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.reuseExistingChunk){const e=l;if("boolean"!=typeof t.reuseExistingChunk)return Pe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.test){let e=t.test;const n=l,r=l;let o=!1;const s=l;if(!(e instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}var D=s===l;if(o=o||D,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(D=t===l,o=o||D,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}D=t===l,o=o||D}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,Pe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.type){let e=t.type;const n=l,r=l;let o=!1;const s=l;if(!(e instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}var O=s===l;if(o=o||O,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(O=t===l,o=o||O,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}O=t===l,o=o||O}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,Pe.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return Pe.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}}}}}return Pe.errors=a,0===l}function De(t,{instancePath:r="",parentData:o,parentDataProperty:s,rootData:i=t}={}){let a=null,l=0;if(0===l){if(!t||"object"!=typeof t||Array.isArray(t))return De.errors=[{params:{type:"object"}}],!1;{const o=l;for(const e in t)if(!n.call(be.properties,e))return De.errors=[{params:{additionalProperty:e}}],!1;if(o===l){if(void 0!==t.automaticNameDelimiter){let e=t.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof e)return De.errors=[{params:{type:"string"}}],!1;if(e.length<1)return De.errors=[{params:{}}],!1}var p=n===l}else p=!0;if(p){if(void 0!==t.cacheGroups){let e=t.cacheGroups;const n=l,o=l,s=l;if(l===s)if(e&&"object"==typeof e&&!Array.isArray(e)){let t;if(void 0===e.test&&(t="test")){const e={};null===a?a=[e]:a.push(e),l++}else if(void 0!==e.test){let t=e.test;const n=l;let r=!1;const o=l;if(!(t instanceof RegExp)){const e={};null===a?a=[e]:a.push(e),l++}var f=o===l;if(r=r||f,!r){const e=l;if("string"!=typeof t){const e={};null===a?a=[e]:a.push(e),l++}if(f=e===l,r=r||f,!r){const e=l;if(!(t instanceof Function)){const e={};null===a?a=[e]:a.push(e),l++}f=e===l,r=r||f}}if(r)l=n,null!==a&&(n?a.length=n:a=null);else{const e={};null===a?a=[e]:a.push(e),l++}}}else{const e={};null===a?a=[e]:a.push(e),l++}if(s===l)return De.errors=[{params:{}}],!1;if(l=o,null!==a&&(o?a.length=o:a=null),l===n){if(!e||"object"!=typeof e||Array.isArray(e))return De.errors=[{params:{type:"object"}}],!1;for(const t in e){let n=e[t];const o=l,s=l;let p=!1;const f=l;if(!1!==n){const e={params:{}};null===a?a=[e]:a.push(e),l++}var u=f===l;if(p=p||u,!p){const o=l;if(!(n instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}if(u=o===l,p=p||u,!p){const o=l;if("string"!=typeof n){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(u=o===l,p=p||u,!p){const o=l;if(!(n instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}if(u=o===l,p=p||u,!p){const o=l;Pe(n,{instancePath:r+"/cacheGroups/"+t.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:t,rootData:i})||(a=null===a?Pe.errors:a.concat(Pe.errors),l=a.length),u=o===l,p=p||u}}}}if(!p){const e={params:{}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}if(l=s,null!==a&&(s?a.length=s:a=null),o!==l)break}}p=n===l}else p=!0;if(p){if(void 0!==t.chunks){let e=t.chunks;const n=l,r=l;let o=!1;const s=l;if("initial"!==e&&"async"!==e&&"all"!==e){const e={params:{}};null===a?a=[e]:a.push(e),l++}var c=s===l;if(o=o||c,!o){const t=l;if(!(e instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}if(c=t===l,o=o||c,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}c=t===l,o=o||c}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.defaultSizeTypes){let e=t.defaultSizeTypes;const n=l;if(l===n){if(!Array.isArray(e))return De.errors=[{params:{type:"array"}}],!1;if(e.length<1)return De.errors=[{params:{limit:1}}],!1;{const t=e.length;for(let n=0;n=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var y=c===l;if(u=u||y,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}y=t===l,u=u||y}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.fallbackCacheGroup){let e=t.fallbackCacheGroup;const n=l;if(l===n){if(!e||"object"!=typeof e||Array.isArray(e))return De.errors=[{params:{type:"object"}}],!1;{const t=l;for(const t in e)if("automaticNameDelimiter"!==t&&"chunks"!==t&&"maxAsyncSize"!==t&&"maxInitialSize"!==t&&"maxSize"!==t&&"minSize"!==t&&"minSizeReduction"!==t)return De.errors=[{params:{additionalProperty:t}}],!1;if(t===l){if(void 0!==e.automaticNameDelimiter){let t=e.automaticNameDelimiter;const n=l;if(l===n){if("string"!=typeof t)return De.errors=[{params:{type:"string"}}],!1;if(t.length<1)return De.errors=[{params:{}}],!1}var m=n===l}else m=!0;if(m){if(void 0!==e.chunks){let t=e.chunks;const n=l,r=l;let o=!1;const s=l;if("initial"!==t&&"async"!==t&&"all"!==t){const e={params:{}};null===a?a=[e]:a.push(e),l++}var d=s===l;if(o=o||d,!o){const e=l;if(!(t instanceof RegExp)){const e={params:{}};null===a?a=[e]:a.push(e),l++}if(d=e===l,o=o||d,!o){const e=l;if(!(t instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}d=e===l,o=o||d}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m){if(void 0!==e.maxAsyncSize){let t=e.maxAsyncSize;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var h=u===l;if(f=f||h,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}h=e===l,f=f||h}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m){if(void 0!==e.maxInitialSize){let t=e.maxInitialSize;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var g=u===l;if(f=f||g,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}g=e===l,f=f||g}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m){if(void 0!==e.maxSize){let t=e.maxSize;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var b=u===l;if(f=f||b,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}b=e===l,f=f||b}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m){if(void 0!==e.minSize){let t=e.minSize;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var v=u===l;if(f=f||v,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}v=e===l,f=f||v}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0;if(m)if(void 0!==e.minSizeReduction){let t=e.minSizeReduction;const n=l,r=l;let o=!1,s=null;const i=l,p=l;let f=!1;const u=l;if(l===u)if("number"==typeof t){if(t<0||isNaN(t)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var P=u===l;if(f=f||P,!f){const e=l;if(l===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const e in t){const n=l;if("number"!=typeof t[e]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}P=e===l,f=f||P}if(f)l=p,null!==a&&(p?a.length=p:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),m=n===l}else m=!0}}}}}}}}p=n===l}else p=!0;if(p){if(void 0!==t.filename){let n=t.filename;const r=l,o=l;let s=!1;const i=l;if(l===i)if("string"==typeof n){if(n.includes("!")||!1!==e.test(n)){const e={params:{}};null===a?a=[e]:a.push(e),l++}else if(n.length<1){const e={params:{}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}var D=i===l;if(s=s||D,!s){const e=l;if(!(n instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}D=e===l,s=s||D}if(!s){const e={params:{}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=o,null!==a&&(o?a.length=o:a=null),p=r===l}else p=!0;if(p){if(void 0!==t.hidePathInfo){const e=l;if("boolean"!=typeof t.hidePathInfo)return De.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0;if(p){if(void 0!==t.maxAsyncRequests){let e=t.maxAsyncRequests;const n=l;if(l===n){if("number"!=typeof e)return De.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return De.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxAsyncSize){let e=t.maxAsyncSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var O=c===l;if(u=u||O,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}O=t===l,u=u||O}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialRequests){let e=t.maxInitialRequests;const n=l;if(l===n){if("number"!=typeof e)return De.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return De.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.maxInitialSize){let e=t.maxInitialSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var x=c===l;if(u=u||x,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}x=t===l,u=u||x}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.maxSize){let e=t.maxSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var A=c===l;if(u=u||A,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}A=t===l,u=u||A}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minChunks){let e=t.minChunks;const n=l;if(l===n){if("number"!=typeof e)return De.errors=[{params:{type:"number"}}],!1;if(e<1||isNaN(e))return De.errors=[{params:{comparison:">=",limit:1}}],!1}p=n===l}else p=!0;if(p){if(void 0!==t.minRemainingSize){let e=t.minRemainingSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var C=c===l;if(u=u||C,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}C=t===l,u=u||C}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSize){let e=t.minSize;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var $=c===l;if(u=u||$,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}$=t===l,u=u||$}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.minSizeReduction){let e=t.minSizeReduction;const n=l,r=l;let o=!1,s=null;const i=l,f=l;let u=!1;const c=l;if(l===c)if("number"==typeof e){if(e<0||isNaN(e)){const e={params:{comparison:">=",limit:0}};null===a?a=[e]:a.push(e),l++}}else{const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}var k=c===l;if(u=u||k,!u){const t=l;if(l===t)if(e&&"object"==typeof e&&!Array.isArray(e))for(const t in e){const n=l;if("number"!=typeof e[t]){const e={params:{type:"number"}};null===a?a=[e]:a.push(e),l++}if(n!==l)break}else{const e={params:{type:"object"}};null===a?a=[e]:a.push(e),l++}k=t===l,u=u||k}if(u)l=f,null!==a&&(f?a.length=f:a=null);else{const e={params:{}};null===a?a=[e]:a.push(e),l++}if(i===l&&(o=!0,s=0),!o){const e={params:{passingSchemas:s}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p){if(void 0!==t.name){let e=t.name;const n=l,r=l;let o=!1;const s=l;if(!1!==e){const e={params:{}};null===a?a=[e]:a.push(e),l++}var j=s===l;if(o=o||j,!o){const t=l;if("string"!=typeof e){const e={params:{type:"string"}};null===a?a=[e]:a.push(e),l++}if(j=t===l,o=o||j,!o){const t=l;if(!(e instanceof Function)){const e={params:{}};null===a?a=[e]:a.push(e),l++}j=t===l,o=o||j}}if(!o){const e={params:{}};return null===a?a=[e]:a.push(e),l++,De.errors=a,!1}l=r,null!==a&&(r?a.length=r:a=null),p=n===l}else p=!0;if(p)if(void 0!==t.usedExports){const e=l;if("boolean"!=typeof t.usedExports)return De.errors=[{params:{type:"boolean"}}],!1;p=e===l}else p=!0}}}}}}}}}}}}}}}}}}}}return De.errors=a,0===l}function Oe(e,{instancePath:t="",parentData:r,parentDataProperty:o,rootData:s=e}={}){let i=null,a=0;if(0===a){if(!e||"object"!=typeof e||Array.isArray(e))return Oe.errors=[{params:{type:"object"}}],!1;{const r=a;for(const t in e)if(!n.call(ge.properties,t))return Oe.errors=[{params:{additionalProperty:t}}],!1;if(r===a){if(void 0!==e.checkWasmTypes){const t=a;if("boolean"!=typeof e.checkWasmTypes)return Oe.errors=[{params:{type:"boolean"}}],!1;var l=t===a}else l=!0;if(l){if(void 0!==e.chunkIds){let t=e.chunkIds;const n=a;if("natural"!==t&&"named"!==t&&"deterministic"!==t&&"size"!==t&&"total-size"!==t&&!1!==t)return Oe.errors=[{params:{}}],!1;l=n===a}else l=!0;if(l){if(void 0!==e.concatenateModules){const t=a;if("boolean"!=typeof e.concatenateModules)return Oe.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.emitOnErrors){const t=a;if("boolean"!=typeof e.emitOnErrors)return Oe.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.flagIncludedChunks){const t=a;if("boolean"!=typeof e.flagIncludedChunks)return Oe.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.innerGraph){const t=a;if("boolean"!=typeof e.innerGraph)return Oe.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.mangleExports){let t=e.mangleExports;const n=a,r=a;let o=!1;const s=a;if("size"!==t&&"deterministic"!==t){const e={params:{}};null===i?i=[e]:i.push(e),a++}var p=s===a;if(o=o||p,!o){const e=a;if("boolean"!=typeof t){const e={params:{type:"boolean"}};null===i?i=[e]:i.push(e),a++}p=e===a,o=o||p}if(!o){const e={params:{}};return null===i?i=[e]:i.push(e),a++,Oe.errors=i,!1}a=r,null!==i&&(r?i.length=r:i=null),l=n===a}else l=!0;if(l){if(void 0!==e.mangleWasmImports){const t=a;if("boolean"!=typeof e.mangleWasmImports)return Oe.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.mergeDuplicateChunks){const t=a;if("boolean"!=typeof e.mergeDuplicateChunks)return Oe.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.minimize){const t=a;if("boolean"!=typeof e.minimize)return Oe.errors=[{params:{type:"boolean"}}],!1;l=t===a}else l=!0;if(l){if(void 0!==e.minimizer){let t=e.minimizer;const n=a;if(a===n){if(!Array.isArray(t))return Oe.errors=[{params:{type:"array"}}],!1;{const e=t.length;for(let n=0;n=",limit:1}}],!1}u=n===f}else u=!0;if(u){if(void 0!==t.hashFunction){let e=t.hashFunction;const n=f,r=f;let o=!1;const s=f;if(f===s)if("string"==typeof e){if(e.length<1){const e={params:{}};null===l?l=[e]:l.push(e),f++}}else{const e={params:{type:"string"}};null===l?l=[e]:l.push(e),f++}var v=s===f;if(o=o||v,!o){const t=f;if(!(e instanceof Function)){const e={params:{}};null===l?l=[e]:l.push(e),f++}v=t===f,o=o||v}if(!o){const e={params:{}};return null===l?l=[e]:l.push(e),f++,ze.errors=l,!1}f=r,null!==l&&(r?l.length=r:l=null),u=n===f}else u=!0;if(u){if(void 0!==t.hashSalt){let e=t.hashSalt;const n=f;if(f==f){if("string"!=typeof e)return ze.errors=[{params:{type:"string"}}],!1;if(e.length<1)return ze.errors=[{params:{}}],!1}u=n===f}else u=!0;if(u){if(void 0!==t.hotUpdateChunkFilename){let n=t.hotUpdateChunkFilename;const r=f;if(f==f){if("string"!=typeof n)return ze.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return ze.errors=[{params:{}}],!1}u=r===f}else u=!0;if(u){if(void 0!==t.hotUpdateGlobal){const e=f;if("string"!=typeof t.hotUpdateGlobal)return ze.errors=[{params:{type:"string"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.hotUpdateMainFilename){let n=t.hotUpdateMainFilename;const r=f;if(f==f){if("string"!=typeof n)return ze.errors=[{params:{type:"string"}}],!1;if(n.includes("!")||!1!==e.test(n))return ze.errors=[{params:{}}],!1}u=r===f}else u=!0;if(u){if(void 0!==t.ignoreBrowserWarnings){const e=f;if("boolean"!=typeof t.ignoreBrowserWarnings)return ze.errors=[{params:{type:"boolean"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.iife){const e=f;if("boolean"!=typeof t.iife)return ze.errors=[{params:{type:"boolean"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.importFunctionName){const e=f;if("string"!=typeof t.importFunctionName)return ze.errors=[{params:{type:"string"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.importMetaName){const e=f;if("string"!=typeof t.importMetaName)return ze.errors=[{params:{type:"string"}}],!1;u=e===f}else u=!0;if(u){if(void 0!==t.library){const e=f;Le(t.library,{instancePath:r+"/library",parentData:t,parentDataProperty:"library",rootData:i})||(l=null===l?Le.errors:l.concat(Le.errors),f=l.length),u=e===f}else u=!0;if(u){if(void 0!==t.libraryExport){let e=t.libraryExport;const n=f,r=f;let o=!1,s=null;const i=f,a=f;let p=!1;const c=f;if(f===c)if(Array.isArray(e)){const t=e.length;for(let n=0;n=",limit:1}}],!1}c=t===f}else c=!0;if(c){if(void 0!==r.performance){const e=f;Me(r.performance,{instancePath:o+"/performance",parentData:r,parentDataProperty:"performance",rootData:l})||(p=null===p?Me.errors:p.concat(Me.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.plugins){const e=f;we(r.plugins,{instancePath:o+"/plugins",parentData:r,parentDataProperty:"plugins",rootData:l})||(p=null===p?we.errors:p.concat(we.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.profile){const e=f;if("boolean"!=typeof r.profile)return _e.errors=[{params:{type:"boolean"}}],!1;c=e===f}else c=!0;if(c){if(void 0!==r.recordsInputPath){let t=r.recordsInputPath;const n=f,o=f;let s=!1;const i=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var v=i===f;if(s=s||v,!s){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}v=n===f,s=s||v}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,_e.errors=p,!1}f=o,null!==p&&(o?p.length=o:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.recordsOutputPath){let t=r.recordsOutputPath;const n=f,o=f;let s=!1;const i=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var P=i===f;if(s=s||P,!s){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}P=n===f,s=s||P}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,_e.errors=p,!1}f=o,null!==p&&(o?p.length=o:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.recordsPath){let t=r.recordsPath;const n=f,o=f;let s=!1;const i=f;if(!1!==t){const e={params:{}};null===p?p=[e]:p.push(e),f++}var D=i===f;if(s=s||D,!s){const n=f;if(f===n)if("string"==typeof t){if(t.includes("!")||!0!==e.test(t)){const e={params:{}};null===p?p=[e]:p.push(e),f++}}else{const e={params:{type:"string"}};null===p?p=[e]:p.push(e),f++}D=n===f,s=s||D}if(!s){const e={params:{}};return null===p?p=[e]:p.push(e),f++,_e.errors=p,!1}f=o,null!==p&&(o?p.length=o:p=null),c=n===f}else c=!0;if(c){if(void 0!==r.resolve){const e=f;Te(r.resolve,{instancePath:o+"/resolve",parentData:r,parentDataProperty:"resolve",rootData:l})||(p=null===p?Te.errors:p.concat(Te.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.resolveLoader){const e=f;Ne(r.resolveLoader,{instancePath:o+"/resolveLoader",parentData:r,parentDataProperty:"resolveLoader",rootData:l})||(p=null===p?Ne.errors:p.concat(Ne.errors),f=p.length),c=e===f}else c=!0;if(c){if(void 0!==r.snapshot){let t=r.snapshot;const n=f;if(f==f){if(!t||"object"!=typeof t||Array.isArray(t))return _e.errors=[{params:{type:"object"}}],!1;{const n=f;for(const e in t)if("buildDependencies"!==e&&"immutablePaths"!==e&&"managedPaths"!==e&&"module"!==e&&"resolve"!==e&&"resolveBuildDependencies"!==e&&"unmanagedPaths"!==e)return _e.errors=[{params:{additionalProperty:e}}],!1;if(n===f){if(void 0!==t.buildDependencies){let e=t.buildDependencies;const n=f;if(f===n){if(!e||"object"!=typeof e||Array.isArray(e))return _e.errors=[{params:{type:"object"}}],!1;{const t=f;for(const t in e)if("hash"!==t&&"timestamp"!==t)return _e.errors=[{params:{additionalProperty:t}}],!1;if(t===f){if(void 0!==e.hash){const t=f;if("boolean"!=typeof e.hash)return _e.errors=[{params:{type:"boolean"}}],!1;var O=t===f}else O=!0;if(O)if(void 0!==e.timestamp){const t=f;if("boolean"!=typeof e.timestamp)return _e.errors=[{params:{type:"boolean"}}],!1;O=t===f}else O=!0}}}var x=n===f}else x=!0;if(x){if(void 0!==t.immutablePaths){let n=t.immutablePaths;const r=f;if(f===r){if(!Array.isArray(n))return _e.errors=[{params:{type:"array"}}],!1;{const t=n.length;for(let r=0;r { ... }').", "type": "boolean" }, + "asyncFunction": { + "description": "The environment supports async function and await ('async function () { await ... }').", + "type": "boolean" + }, "bigIntLiteral": { "description": "The environment supports BigInt as literal (123n).", "type": "boolean" @@ -801,14 +879,7 @@ }, "css": { "description": "Enable css support.", - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/CssExperimentOptions" - } - ] + "type": "boolean" }, "futureDefaults": { "description": "Apply defaults of next major version.", @@ -910,14 +981,7 @@ }, "css": { "description": "Enable css support.", - "anyOf": [ - { - "enum": [false] - }, - { - "$ref": "#/definitions/CssExperimentOptions" - } - ] + "type": "boolean" }, "futureDefaults": { "description": "Apply defaults of next major version.", @@ -1375,6 +1439,18 @@ "asset/resource": { "$ref": "#/definitions/AssetResourceGeneratorOptions" }, + "css": { + "$ref": "#/definitions/CssGeneratorOptions" + }, + "css/auto": { + "$ref": "#/definitions/CssAutoGeneratorOptions" + }, + "css/global": { + "$ref": "#/definitions/CssGlobalGeneratorOptions" + }, + "css/module": { + "$ref": "#/definitions/CssModuleGeneratorOptions" + }, "javascript": { "$ref": "#/definitions/EmptyGeneratorOptions" }, @@ -2402,11 +2478,11 @@ "properties": { "__dirname": { "description": "Include a polyfill for the '__dirname' variable.", - "enum": [false, true, "warn-mock", "mock", "eval-only"] + "enum": [false, true, "warn-mock", "mock", "node-module", "eval-only"] }, "__filename": { "description": "Include a polyfill for the '__filename' variable.", - "enum": [false, true, "warn-mock", "mock", "eval-only"] + "enum": [false, true, "warn-mock", "mock", "node-module", "eval-only"] }, "global": { "description": "Include a polyfill for the 'global' variable.", @@ -3518,6 +3594,18 @@ "asset/source": { "$ref": "#/definitions/EmptyParserOptions" }, + "css": { + "$ref": "#/definitions/CssParserOptions" + }, + "css/auto": { + "$ref": "#/definitions/CssAutoParserOptions" + }, + "css/global": { + "$ref": "#/definitions/CssGlobalParserOptions" + }, + "css/module": { + "$ref": "#/definitions/CssModuleParserOptions" + }, "javascript": { "$ref": "#/definitions/JavascriptParserOptions" }, @@ -4614,6 +4702,26 @@ "type": "boolean" } } + }, + "unmanagedPaths": { + "description": "List of paths that are not managed by a package manager and the contents are subject to change.", + "type": "array", + "items": { + "description": "List of paths that are not managed by a package manager and the contents are subject to change.", + "anyOf": [ + { + "description": "A RegExp matching an unmanaged directory.", + "instanceof": "RegExp", + "tsType": "RegExp" + }, + { + "description": "A path to an unmanaged directory.", + "type": "string", + "absolutePath": true, + "minLength": 1 + } + ] + } } } }, diff --git a/schemas/plugins/css/CssAutoGeneratorOptions.check.d.ts b/schemas/plugins/css/CssAutoGeneratorOptions.check.d.ts new file mode 100644 index 00000000000..6b6174c3f9d --- /dev/null +++ b/schemas/plugins/css/CssAutoGeneratorOptions.check.d.ts @@ -0,0 +1,7 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare const check: (options: any) => boolean; +export = check; diff --git a/schemas/plugins/css/CssAutoGeneratorOptions.check.js b/schemas/plugins/css/CssAutoGeneratorOptions.check.js new file mode 100644 index 00000000000..79b79e2cbb2 --- /dev/null +++ b/schemas/plugins/css/CssAutoGeneratorOptions.check.js @@ -0,0 +1,6 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +"use strict";function r(t,{instancePath:a="",parentData:e,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const a=0;for(const a in t)if("exportsOnly"!==a)return r.errors=[{params:{additionalProperty:a}}],!1;if(0===a&&void 0!==t.exportsOnly&&"boolean"!=typeof t.exportsOnly)return r.errors=[{params:{type:"boolean"}}],!1}return r.errors=null,!0}function t(a,{instancePath:e="",parentData:o,parentDataProperty:n,rootData:s=a}={}){let p=null,l=0;return r(a,{instancePath:e,parentData:o,parentDataProperty:n,rootData:s})||(p=null===p?r.errors:p.concat(r.errors),l=p.length),t.errors=p,0===l}module.exports=t,module.exports.default=t; \ No newline at end of file diff --git a/schemas/plugins/css/CssAutoGeneratorOptions.json b/schemas/plugins/css/CssAutoGeneratorOptions.json new file mode 100644 index 00000000000..99f9a565c31 --- /dev/null +++ b/schemas/plugins/css/CssAutoGeneratorOptions.json @@ -0,0 +1,3 @@ +{ + "$ref": "../../WebpackOptions.json#/definitions/CssAutoGeneratorOptions" +} diff --git a/schemas/plugins/css/CssAutoParserOptions.check.d.ts b/schemas/plugins/css/CssAutoParserOptions.check.d.ts new file mode 100644 index 00000000000..6b6174c3f9d --- /dev/null +++ b/schemas/plugins/css/CssAutoParserOptions.check.d.ts @@ -0,0 +1,7 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare const check: (options: any) => boolean; +export = check; diff --git a/schemas/plugins/css/CssAutoParserOptions.check.js b/schemas/plugins/css/CssAutoParserOptions.check.js new file mode 100644 index 00000000000..43b6d176df5 --- /dev/null +++ b/schemas/plugins/css/CssAutoParserOptions.check.js @@ -0,0 +1,6 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +"use strict";function r(t,{instancePath:a="",parentData:e,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const a=0;for(const a in t)if("namedExports"!==a)return r.errors=[{params:{additionalProperty:a}}],!1;if(0===a&&void 0!==t.namedExports&&"boolean"!=typeof t.namedExports)return r.errors=[{params:{type:"boolean"}}],!1}return r.errors=null,!0}function t(a,{instancePath:e="",parentData:o,parentDataProperty:n,rootData:s=a}={}){let p=null,i=0;return r(a,{instancePath:e,parentData:o,parentDataProperty:n,rootData:s})||(p=null===p?r.errors:p.concat(r.errors),i=p.length),t.errors=p,0===i}module.exports=t,module.exports.default=t; \ No newline at end of file diff --git a/schemas/plugins/css/CssAutoParserOptions.json b/schemas/plugins/css/CssAutoParserOptions.json new file mode 100644 index 00000000000..0a406e58ff7 --- /dev/null +++ b/schemas/plugins/css/CssAutoParserOptions.json @@ -0,0 +1,3 @@ +{ + "$ref": "../../WebpackOptions.json#/definitions/CssAutoParserOptions" +} diff --git a/schemas/plugins/css/CssGeneratorOptions.check.js b/schemas/plugins/css/CssGeneratorOptions.check.js index c41b7d08aca..79b79e2cbb2 100644 --- a/schemas/plugins/css/CssGeneratorOptions.check.js +++ b/schemas/plugins/css/CssGeneratorOptions.check.js @@ -3,4 +3,4 @@ * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ -"use strict";function r(t,{instancePath:e="",parentData:a,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;for(const e in t)return r.errors=[{params:{additionalProperty:e}}],!1;return r.errors=null,!0}module.exports=r,module.exports.default=r; \ No newline at end of file +"use strict";function r(t,{instancePath:a="",parentData:e,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const a=0;for(const a in t)if("exportsOnly"!==a)return r.errors=[{params:{additionalProperty:a}}],!1;if(0===a&&void 0!==t.exportsOnly&&"boolean"!=typeof t.exportsOnly)return r.errors=[{params:{type:"boolean"}}],!1}return r.errors=null,!0}function t(a,{instancePath:e="",parentData:o,parentDataProperty:n,rootData:s=a}={}){let p=null,l=0;return r(a,{instancePath:e,parentData:o,parentDataProperty:n,rootData:s})||(p=null===p?r.errors:p.concat(r.errors),l=p.length),t.errors=p,0===l}module.exports=t,module.exports.default=t; \ No newline at end of file diff --git a/schemas/plugins/css/CssGlobalGeneratorOptions.check.d.ts b/schemas/plugins/css/CssGlobalGeneratorOptions.check.d.ts new file mode 100644 index 00000000000..6b6174c3f9d --- /dev/null +++ b/schemas/plugins/css/CssGlobalGeneratorOptions.check.d.ts @@ -0,0 +1,7 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare const check: (options: any) => boolean; +export = check; diff --git a/schemas/plugins/css/CssGlobalGeneratorOptions.check.js b/schemas/plugins/css/CssGlobalGeneratorOptions.check.js new file mode 100644 index 00000000000..79b79e2cbb2 --- /dev/null +++ b/schemas/plugins/css/CssGlobalGeneratorOptions.check.js @@ -0,0 +1,6 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +"use strict";function r(t,{instancePath:a="",parentData:e,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const a=0;for(const a in t)if("exportsOnly"!==a)return r.errors=[{params:{additionalProperty:a}}],!1;if(0===a&&void 0!==t.exportsOnly&&"boolean"!=typeof t.exportsOnly)return r.errors=[{params:{type:"boolean"}}],!1}return r.errors=null,!0}function t(a,{instancePath:e="",parentData:o,parentDataProperty:n,rootData:s=a}={}){let p=null,l=0;return r(a,{instancePath:e,parentData:o,parentDataProperty:n,rootData:s})||(p=null===p?r.errors:p.concat(r.errors),l=p.length),t.errors=p,0===l}module.exports=t,module.exports.default=t; \ No newline at end of file diff --git a/schemas/plugins/css/CssGlobalGeneratorOptions.json b/schemas/plugins/css/CssGlobalGeneratorOptions.json new file mode 100644 index 00000000000..a4a1aaf56e8 --- /dev/null +++ b/schemas/plugins/css/CssGlobalGeneratorOptions.json @@ -0,0 +1,3 @@ +{ + "$ref": "../../WebpackOptions.json#/definitions/CssGlobalGeneratorOptions" +} diff --git a/schemas/plugins/css/CssGlobalParserOptions.check.d.ts b/schemas/plugins/css/CssGlobalParserOptions.check.d.ts new file mode 100644 index 00000000000..6b6174c3f9d --- /dev/null +++ b/schemas/plugins/css/CssGlobalParserOptions.check.d.ts @@ -0,0 +1,7 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare const check: (options: any) => boolean; +export = check; diff --git a/schemas/plugins/css/CssGlobalParserOptions.check.js b/schemas/plugins/css/CssGlobalParserOptions.check.js new file mode 100644 index 00000000000..43b6d176df5 --- /dev/null +++ b/schemas/plugins/css/CssGlobalParserOptions.check.js @@ -0,0 +1,6 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +"use strict";function r(t,{instancePath:a="",parentData:e,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const a=0;for(const a in t)if("namedExports"!==a)return r.errors=[{params:{additionalProperty:a}}],!1;if(0===a&&void 0!==t.namedExports&&"boolean"!=typeof t.namedExports)return r.errors=[{params:{type:"boolean"}}],!1}return r.errors=null,!0}function t(a,{instancePath:e="",parentData:o,parentDataProperty:n,rootData:s=a}={}){let p=null,i=0;return r(a,{instancePath:e,parentData:o,parentDataProperty:n,rootData:s})||(p=null===p?r.errors:p.concat(r.errors),i=p.length),t.errors=p,0===i}module.exports=t,module.exports.default=t; \ No newline at end of file diff --git a/schemas/plugins/css/CssGlobalParserOptions.json b/schemas/plugins/css/CssGlobalParserOptions.json new file mode 100644 index 00000000000..75f9de6a2e7 --- /dev/null +++ b/schemas/plugins/css/CssGlobalParserOptions.json @@ -0,0 +1,3 @@ +{ + "$ref": "../../WebpackOptions.json#/definitions/CssGlobalParserOptions" +} diff --git a/schemas/plugins/css/CssModuleGeneratorOptions.check.d.ts b/schemas/plugins/css/CssModuleGeneratorOptions.check.d.ts new file mode 100644 index 00000000000..6b6174c3f9d --- /dev/null +++ b/schemas/plugins/css/CssModuleGeneratorOptions.check.d.ts @@ -0,0 +1,7 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare const check: (options: any) => boolean; +export = check; diff --git a/schemas/plugins/css/CssModuleGeneratorOptions.check.js b/schemas/plugins/css/CssModuleGeneratorOptions.check.js new file mode 100644 index 00000000000..79b79e2cbb2 --- /dev/null +++ b/schemas/plugins/css/CssModuleGeneratorOptions.check.js @@ -0,0 +1,6 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +"use strict";function r(t,{instancePath:a="",parentData:e,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const a=0;for(const a in t)if("exportsOnly"!==a)return r.errors=[{params:{additionalProperty:a}}],!1;if(0===a&&void 0!==t.exportsOnly&&"boolean"!=typeof t.exportsOnly)return r.errors=[{params:{type:"boolean"}}],!1}return r.errors=null,!0}function t(a,{instancePath:e="",parentData:o,parentDataProperty:n,rootData:s=a}={}){let p=null,l=0;return r(a,{instancePath:e,parentData:o,parentDataProperty:n,rootData:s})||(p=null===p?r.errors:p.concat(r.errors),l=p.length),t.errors=p,0===l}module.exports=t,module.exports.default=t; \ No newline at end of file diff --git a/schemas/plugins/css/CssModuleGeneratorOptions.json b/schemas/plugins/css/CssModuleGeneratorOptions.json new file mode 100644 index 00000000000..5c95fb5541c --- /dev/null +++ b/schemas/plugins/css/CssModuleGeneratorOptions.json @@ -0,0 +1,3 @@ +{ + "$ref": "../../WebpackOptions.json#/definitions/CssModuleGeneratorOptions" +} diff --git a/schemas/plugins/css/CssModuleParserOptions.check.d.ts b/schemas/plugins/css/CssModuleParserOptions.check.d.ts new file mode 100644 index 00000000000..6b6174c3f9d --- /dev/null +++ b/schemas/plugins/css/CssModuleParserOptions.check.d.ts @@ -0,0 +1,7 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare const check: (options: any) => boolean; +export = check; diff --git a/schemas/plugins/css/CssModuleParserOptions.check.js b/schemas/plugins/css/CssModuleParserOptions.check.js new file mode 100644 index 00000000000..43b6d176df5 --- /dev/null +++ b/schemas/plugins/css/CssModuleParserOptions.check.js @@ -0,0 +1,6 @@ +/* + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +"use strict";function r(t,{instancePath:a="",parentData:e,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const a=0;for(const a in t)if("namedExports"!==a)return r.errors=[{params:{additionalProperty:a}}],!1;if(0===a&&void 0!==t.namedExports&&"boolean"!=typeof t.namedExports)return r.errors=[{params:{type:"boolean"}}],!1}return r.errors=null,!0}function t(a,{instancePath:e="",parentData:o,parentDataProperty:n,rootData:s=a}={}){let p=null,i=0;return r(a,{instancePath:e,parentData:o,parentDataProperty:n,rootData:s})||(p=null===p?r.errors:p.concat(r.errors),i=p.length),t.errors=p,0===i}module.exports=t,module.exports.default=t; \ No newline at end of file diff --git a/schemas/plugins/css/CssModuleParserOptions.json b/schemas/plugins/css/CssModuleParserOptions.json new file mode 100644 index 00000000000..97168a04bed --- /dev/null +++ b/schemas/plugins/css/CssModuleParserOptions.json @@ -0,0 +1,3 @@ +{ + "$ref": "../../WebpackOptions.json#/definitions/CssModuleParserOptions" +} diff --git a/schemas/plugins/css/CssParserOptions.check.js b/schemas/plugins/css/CssParserOptions.check.js index c41b7d08aca..43b6d176df5 100644 --- a/schemas/plugins/css/CssParserOptions.check.js +++ b/schemas/plugins/css/CssParserOptions.check.js @@ -3,4 +3,4 @@ * DO NOT MODIFY BY HAND. * Run `yarn special-lint-fix` to update */ -"use strict";function r(t,{instancePath:e="",parentData:a,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;for(const e in t)return r.errors=[{params:{additionalProperty:e}}],!1;return r.errors=null,!0}module.exports=r,module.exports.default=r; \ No newline at end of file +"use strict";function r(t,{instancePath:a="",parentData:e,parentDataProperty:o,rootData:n=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const a=0;for(const a in t)if("namedExports"!==a)return r.errors=[{params:{additionalProperty:a}}],!1;if(0===a&&void 0!==t.namedExports&&"boolean"!=typeof t.namedExports)return r.errors=[{params:{type:"boolean"}}],!1}return r.errors=null,!0}function t(a,{instancePath:e="",parentData:o,parentDataProperty:n,rootData:s=a}={}){let p=null,i=0;return r(a,{instancePath:e,parentData:o,parentDataProperty:n,rootData:s})||(p=null===p?r.errors:p.concat(r.errors),i=p.length),t.errors=p,0===i}module.exports=t,module.exports.default=t; \ No newline at end of file diff --git a/test/BuildDependencies.longtest.js b/test/BuildDependencies.longtest.js index 0624b1b0dd4..2127fc37c48 100644 --- a/test/BuildDependencies.longtest.js +++ b/test/BuildDependencies.longtest.js @@ -25,7 +25,7 @@ const exec = (n, options = {}) => { "--cache-dir", ".jest-cache/nyc", process.execPath - ] + ] : []), path.resolve(__dirname, "fixtures/buildDependencies/run.js"), n, @@ -133,7 +133,18 @@ describe("BuildDependencies", () => { ); fs.writeFileSync( path.resolve(inputDirectory, "esm-async-dependency.mjs"), - 'import path from "node:path"; import vm from "vm"; export default 0;' + `import path from "node:path"; +import vm from "vm"; + +async function preload() { + await import(\`markdown-wasm/dist/markdown-node.js\`); + await import("markdown-wasm/dist/markdown-node.js"); + await import('markdown-wasm/dist/markdown-node.js'); + await import('test-"/test'); + await import(\`test-"/test\`); +} + +export default 0;` ); await exec("0", { invalidBuildDependencies: true, diff --git a/test/Compiler.test.js b/test/Compiler.test.js index ae9bc43faa4..decae904470 100644 --- a/test/Compiler.test.js +++ b/test/Compiler.test.js @@ -163,9 +163,9 @@ describe("Compiler", () => { it("should compile a file with multiple chunks", done => { compile("./chunks", {}, (stats, files) => { expect(stats.chunks).toHaveLength(2); - expect(Object.keys(files)).toEqual(["/main.js", "/394.js"]); + expect(Object.keys(files)).toEqual(["/main.js", "/272.js"]); const bundle = files["/main.js"]; - const chunk = files["/394.js"]; + const chunk = files["/272.js"]; expect(bundle).toMatch("function __webpack_require__("); expect(bundle).toMatch("__webpack_require__(/*! ./b */"); expect(chunk).not.toMatch("__webpack_require__(/* ./b */"); diff --git a/test/ConfigTestCases.template.js b/test/ConfigTestCases.template.js index c0c00fb8785..c45b855ffe5 100644 --- a/test/ConfigTestCases.template.js +++ b/test/ConfigTestCases.template.js @@ -61,10 +61,8 @@ const describeCases = config => { jest.setTimeout(20000); for (const category of categories) { - // eslint-disable-next-line no-loop-func describe(category.name, () => { for (const testName of category.tests) { - // eslint-disable-next-line no-loop-func describe(testName, function () { const testDirectory = path.join(casesPath, category.name, testName); const filterPath = path.join(testDirectory, "test.filter.js"); @@ -257,7 +255,7 @@ const describeCases = config => { ? children.reduce( (all, { modules }) => all.concat(modules), modules || [] - ) + ) : modules; if ( allModules.some( @@ -458,7 +456,6 @@ const describeCases = config => { name: "context for esm" }); - // eslint-disable-next-line no-loop-func const _require = ( currentDirectory, options, @@ -551,7 +548,7 @@ const describeCases = config => { referencingModule.identifier ? referencingModule.identifier.slice( esmIdentifier.length + 1 - ) + ) : fileURLToPath(referencingModule.url) ), options, @@ -637,9 +634,9 @@ const describeCases = config => { ) { return testConfig.modules[module]; } else { - return require(module.startsWith("node:") - ? module.slice(5) - : module); + return require( + module.startsWith("node:") ? module.slice(5) : module + ); } }; diff --git a/test/Defaults.unittest.js b/test/Defaults.unittest.js index ea1ac1546b0..ab5922345f9 100644 --- a/test/Defaults.unittest.js +++ b/test/Defaults.unittest.js @@ -119,6 +119,7 @@ describe("snapshots", () => { "loader": Object { "environment": Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": undefined, "const": true, "destructuring": true, @@ -341,6 +342,7 @@ describe("snapshots", () => { ], "environment": Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": undefined, "const": true, "destructuring": true, @@ -373,6 +375,7 @@ describe("snapshots", () => { "scriptType": false, "sourceMapFilename": "[file].map[query]", "sourcePrefix": undefined, + "strictModuleErrorHandling": false, "strictModuleExceptionHandling": false, "trustedTypes": undefined, "uniqueName": "webpack", @@ -639,6 +642,7 @@ describe("snapshots", () => { "hash": true, "timestamp": true, }, + "unmanagedPaths": Array [], }, "stats": Object {}, "target": "web", @@ -2020,6 +2024,7 @@ describe("snapshots", () => { + "context": "/test/fixtures/browserslist", @@ ... @@ - "arrowFunction": true, + - "asyncFunction": true, - "bigIntLiteral": undefined, - "const": true, - "destructuring": true, @@ -2031,6 +2036,7 @@ describe("snapshots", () => { - "optionalChaining": true, - "templateLiteral": true, + "arrowFunction": false, + + "asyncFunction": false, + "bigIntLiteral": false, + "const": false, + "destructuring": false, @@ -2049,6 +2055,7 @@ describe("snapshots", () => { + "devtoolNamespace": "browserslist-test", @@ ... @@ - "arrowFunction": true, + - "asyncFunction": true, - "bigIntLiteral": undefined, - "const": true, - "destructuring": true, @@ -2060,6 +2067,7 @@ describe("snapshots", () => { - "optionalChaining": true, - "templateLiteral": true, + "arrowFunction": false, + + "asyncFunction": false, + "bigIntLiteral": false, + "const": false, + "destructuring": false, @@ -2203,9 +2211,7 @@ describe("snapshots", () => { - "css": undefined, - "futureDefaults": false, + "cacheUnaffected": true, - + "css": Object { - + "exportsOnly": false, - + }, + + "css": true, + "futureDefaults": true, @@ ... @@ + }, @@ -2232,12 +2238,12 @@ describe("snapshots", () => { + }, + "resolve": Object { + "fullySpecified": true, - @@ ... @@ + + }, + }, + ], + "type": "webassembly/async", + }, - @@ ... @@ + + Object { + "resolve": Object { + "fullySpecified": true, + "preferRelative": true, @@ -2250,7 +2256,7 @@ describe("snapshots", () => { + "resolve": Object { + "fullySpecified": true, + "preferRelative": true, - + }, + @@ ... @@ + "type": "css/module", + }, + Object { @@ -2261,7 +2267,18 @@ describe("snapshots", () => { + }, + "type": "css", + }, - + Object { + @@ ... @@ + - "generator": Object {}, + + "generator": Object { + + "css": Object { + + "exportsOnly": false, + + }, + + }, + @@ ... @@ + + }, + @@ ... @@ + + "css": Object { + + "namedExports": true, @@ ... @@ + "exportsPresence": "error", @@ ... @@ @@ -2295,9 +2312,12 @@ describe("snapshots", () => { + "style", @@ ... @@ + "mainFiles": Array [], + + "preferRelative": true, @@ ... @@ - "/node_modules/", + /^(.+?[\\\\/]node_modules[\\\\/])/, + @@ ... @@ + - "unmanagedPaths": Array [], `) ); @@ -2327,9 +2347,10 @@ describe("snapshots", () => { + "css": false, + "futureDefaults": true, @@ ... @@ + + }, + Object { + "rules": Array [ - @@ ... @@ + + Object { + "descriptionData": Object { + "type": "module", + }, @@ -2350,12 +2371,11 @@ describe("snapshots", () => { + }, + "resolve": Object { + "fullySpecified": true, - + }, + @@ ... @@ + }, + ], + "type": "webassembly/async", + }, - + Object { @@ ... @@ + "exportsPresence": "error", @@ ... @@ @@ -2373,6 +2393,8 @@ describe("snapshots", () => { @@ ... @@ - "/node_modules/", + /^(.+?[\\\\/]node_modules[\\\\/])/, + @@ ... @@ + - "unmanagedPaths": Array [], `) ); }); diff --git a/test/Errors.test.js b/test/Errors.test.js index ad25ba9e729..1e838ccb970 100644 --- a/test/Errors.test.js +++ b/test/Errors.test.js @@ -313,30 +313,30 @@ it("should emit no errors or warnings for no-errors-deprecate", async () => { it("should emit errors for missingFile for production", async () => { await expect(compile({ mode: "production", entry: "./missingFile" })).resolves .toMatchInlineSnapshot(` - Object { - "errors": Array [ - Object { - "loc": "4:0-20", - "message": "Module not found: Error: Can't resolve './missing' in '/test/fixtures/errors'", - "moduleId": 814, - "moduleIdentifier": "/test/fixtures/errors/missingFile.js", - "moduleName": "./missingFile.js", - "moduleTrace": Array [], - "stack": "ModuleNotFoundError: Module not found: Error: Can't resolve './missing' in '/test/fixtures/errors'", - }, - Object { - "loc": "12:9-34", - "message": "Module not found: Error: Can't resolve './dir/missing2' in '/test/fixtures/errors'", - "moduleId": 814, - "moduleIdentifier": "/test/fixtures/errors/missingFile.js", - "moduleName": "./missingFile.js", - "moduleTrace": Array [], - "stack": "ModuleNotFoundError: Module not found: Error: Can't resolve './dir/missing2' in '/test/fixtures/errors'", - }, - ], - "warnings": Array [], - } - `); + Object { + "errors": Array [ + Object { + "loc": "4:0-20", + "message": "Module not found: Error: Can't resolve './missing' in '/test/fixtures/errors'", + "moduleId": 96, + "moduleIdentifier": "/test/fixtures/errors/missingFile.js", + "moduleName": "./missingFile.js", + "moduleTrace": Array [], + "stack": "ModuleNotFoundError: Module not found: Error: Can't resolve './missing' in '/test/fixtures/errors'", + }, + Object { + "loc": "12:9-34", + "message": "Module not found: Error: Can't resolve './dir/missing2' in '/test/fixtures/errors'", + "moduleId": 96, + "moduleIdentifier": "/test/fixtures/errors/missingFile.js", + "moduleName": "./missingFile.js", + "moduleTrace": Array [], + "stack": "ModuleNotFoundError: Module not found: Error: Can't resolve './dir/missing2' in '/test/fixtures/errors'", + }, + ], + "warnings": Array [], + } + `); }); it("should emit module build errors", async () => { diff --git a/test/FileSystemInfo.unittest.js b/test/FileSystemInfo.unittest.js index fbca60f9cfe..217eca453bc 100644 --- a/test/FileSystemInfo.unittest.js +++ b/test/FileSystemInfo.unittest.js @@ -19,7 +19,10 @@ describe("FileSystemInfo", () => { "/path/nested/deep/symlink/file.txt", "/path/context+files/sub/symlink/file.txt", "/path/context/sub/symlink/file.txt", - "/path/missing.txt" + "/path/missing.txt", + "/path/node_modules/@foo/package1/index.js", + "/path/node_modules/@foo/package2/index.js", + "/path/node_modules/bar-package3/index.js" ]; const directories = [ "/path/context+files", @@ -27,6 +30,10 @@ describe("FileSystemInfo", () => { "/path/missing", "/path/node_modules/package", "/path/node_modules/missing", + "/path/node_modules/@foo", + "/path/node_modules/@foo/package1", + "/path/node_modules/@foo/package2", + "/path/node_modules/bar-package3", "/path/cache/package-1234", "/path/cache/package-missing" ]; @@ -48,6 +55,11 @@ describe("FileSystemInfo", () => { "/path/node_modules/package/ignored.txt", "/path/cache/package-1234/ignored.txt" ]; + const unmanagedPaths = [ + "/path/node_modules/@foo/package1", + "/path/node_modules/@foo/package2", + "/path/node_modules/bar-package3" + ]; const managedPaths = ["/path/node_modules"]; const immutablePaths = ["/path/cache"]; const createFs = () => { @@ -56,6 +68,10 @@ describe("FileSystemInfo", () => { fs.mkdirpSync("/path/context/sub"); fs.mkdirpSync("/path/nested/deep"); fs.mkdirpSync("/path/node_modules/package"); + fs.mkdirpSync("/path/node_modules/@foo"); + fs.mkdirpSync("/path/node_modules/@foo/package1"); + fs.mkdirpSync("/path/node_modules/@foo/package2"); + fs.mkdirpSync("/path/node_modules/bar-package3"); fs.mkdirpSync("/path/cache/package-1234"); fs.mkdirpSync("/path/folder/context"); fs.mkdirpSync("/path/folder/context+files"); @@ -92,6 +108,15 @@ describe("FileSystemInfo", () => { fs.writeFileSync("/path/folder/context/file.txt", "Hello World"); fs.writeFileSync("/path/folder/context+files/file.txt", "Hello World"); fs.writeFileSync("/path/folder/nested/file.txt", "Hello World"); + fs.writeFileSync( + "/path/node_modules/@foo/package1/index.js", + "Hello World" + ); + fs.writeFileSync( + "/path/node_modules/@foo/package2/index.js", + "Hello World" + ); + fs.writeFileSync("/path/node_modules/bar-package3/index.js", "Hello World"); fs.symlinkSync("/path/folder/context", "/path/context/sub/symlink", "dir"); fs.symlinkSync( "/path/folder/context+files", @@ -110,6 +135,7 @@ describe("FileSystemInfo", () => { }; const fsInfo = new FileSystemInfo(fs, { logger, + unmanagedPaths, managedPaths, immutablePaths, hashFunction: "sha256" @@ -287,6 +313,9 @@ ${details(snapshot)}`) "/path/folder/context/file.txt", "/path/folder/context+files/file.txt", "/path/folder/nested/file.txt", + "/path/node_modules/@foo/package1/index.js", + "/path/node_modules/@foo/package2/index.js", + "/path/node_modules/bar-package3/index.js", ...(name !== "timestamp" ? ignoredFileChanges : []), ...(name === "hash" ? ["/path/context/sub/ignored.txt"] : []) ]) { diff --git a/test/NodeTemplatePlugin.test.js b/test/NodeTemplatePlugin.test.js index 790b8c4100c..3ce706e3eb3 100644 --- a/test/NodeTemplatePlugin.test.js +++ b/test/NodeTemplatePlugin.test.js @@ -27,7 +27,7 @@ describe("NodeTemplatePlugin", () => { if (err) return err; expect(stats.hasErrors()).toBe(false); expect(stats.hasWarnings()).toBe(false); - // eslint-disable-next-line node/no-missing-require + // eslint-disable-next-line n/no-missing-require const result = require("./js/NodeTemplatePlugin/result").abc; expect(result.nextTick).toBe(process.nextTick); expect(result.fs).toBe(require("fs")); @@ -69,7 +69,7 @@ describe("NodeTemplatePlugin", () => { (err, stats) => { if (err) return err; expect(stats.hasErrors()).toBe(false); - // eslint-disable-next-line node/no-missing-require + // eslint-disable-next-line n/no-missing-require const result = require("./js/NodeTemplatePluginSingle/result2"); expect(result.nextTick).toBe(process.nextTick); expect(result.fs).toBe(require("fs")); diff --git a/test/TestCases.template.js b/test/TestCases.template.js index 43619be9b91..81452852eca 100644 --- a/test/TestCases.template.js +++ b/test/TestCases.template.js @@ -111,7 +111,7 @@ const describeCases = config => { emitOnErrors: true, minimizer: [terserForTesting], ...config.optimization - } + } : { removeAvailableModules: true, removeEmptyChunks: true, @@ -127,7 +127,7 @@ const describeCases = config => { chunkIds: "size", minimizer: [terserForTesting], ...config.optimization - }, + }, performance: { hints: false }, diff --git a/test/WatchSuspend.test.js b/test/WatchSuspend.test.js index dce53a7fc96..510057a8811 100644 --- a/test/WatchSuspend.test.js +++ b/test/WatchSuspend.test.js @@ -102,7 +102,6 @@ describe("WatchSuspend", () => { for (const changeBefore of [false, true]) for (const delay of [200, 1500]) { - // eslint-disable-next-line no-loop-func it(`should not ignore changes during resumed compilation (changeBefore: ${changeBefore}, delay: ${delay}ms)`, async () => { // aggregateTimeout must be long enough for this test // So set-up new watcher and wait when initial compilation is done diff --git a/test/WatchTestCases.template.js b/test/WatchTestCases.template.js index 68dbce53a75..51aec382e8a 100644 --- a/test/WatchTestCases.template.js +++ b/test/WatchTestCases.template.js @@ -348,10 +348,9 @@ const describeCases = config => { let testConfig = {}; try { // try to load a test file - testConfig = require(path.join( - testDirectory, - "test.config.js" - )); + testConfig = require( + path.join(testDirectory, "test.config.js") + ); } catch (e) { // empty } diff --git a/test/__snapshots__/Cli.basictest.js.snap b/test/__snapshots__/Cli.basictest.js.snap index a29f26a737d..edd53faa0b2 100644 --- a/test/__snapshots__/Cli.basictest.js.snap +++ b/test/__snapshots__/Cli.basictest.js.snap @@ -426,6 +426,22 @@ Object { "multiple": false, "simpleType": "boolean", }, + "dev-server": Object { + "configs": Array [ + Object { + "description": "Disable dev server.", + "multiple": false, + "path": "devServer", + "type": "enum", + "values": Array [ + false, + ], + }, + ], + "description": "Disable dev server.", + "multiple": false, + "simpleType": "boolean", + }, "devtool": Object { "configs": Array [ Object { @@ -633,19 +649,6 @@ Object { "multiple": false, "simpleType": "boolean", }, - "experiments-css-exports-only": Object { - "configs": Array [ - Object { - "description": "Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.", - "multiple": false, - "path": "experiments.css.exportsOnly", - "type": "boolean", - }, - ], - "description": "Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.", - "multiple": false, - "simpleType": "boolean", - }, "experiments-future-defaults": Object { "configs": Array [ Object { @@ -1426,6 +1429,58 @@ Object { "multiple": false, "simpleType": "string", }, + "module-generator-css-auto-exports-only": Object { + "configs": Array [ + Object { + "description": "Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.", + "multiple": false, + "path": "module.generator.css/auto.exportsOnly", + "type": "boolean", + }, + ], + "description": "Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.", + "multiple": false, + "simpleType": "boolean", + }, + "module-generator-css-exports-only": Object { + "configs": Array [ + Object { + "description": "Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.", + "multiple": false, + "path": "module.generator.css.exportsOnly", + "type": "boolean", + }, + ], + "description": "Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.", + "multiple": false, + "simpleType": "boolean", + }, + "module-generator-css-global-exports-only": Object { + "configs": Array [ + Object { + "description": "Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.", + "multiple": false, + "path": "module.generator.css/global.exportsOnly", + "type": "boolean", + }, + ], + "description": "Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.", + "multiple": false, + "simpleType": "boolean", + }, + "module-generator-css-module-exports-only": Object { + "configs": Array [ + Object { + "description": "Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.", + "multiple": false, + "path": "module.generator.css/module.exportsOnly", + "type": "boolean", + }, + ], + "description": "Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.", + "multiple": false, + "simpleType": "boolean", + }, "module-no-parse": Object { "configs": Array [ Object { @@ -1471,6 +1526,58 @@ Object { "multiple": false, "simpleType": "number", }, + "module-parser-css-auto-named-exports": Object { + "configs": Array [ + Object { + "description": "Use ES modules named export for css exports.", + "multiple": false, + "path": "module.parser.css/auto.namedExports", + "type": "boolean", + }, + ], + "description": "Use ES modules named export for css exports.", + "multiple": false, + "simpleType": "boolean", + }, + "module-parser-css-global-named-exports": Object { + "configs": Array [ + Object { + "description": "Use ES modules named export for css exports.", + "multiple": false, + "path": "module.parser.css/global.namedExports", + "type": "boolean", + }, + ], + "description": "Use ES modules named export for css exports.", + "multiple": false, + "simpleType": "boolean", + }, + "module-parser-css-module-named-exports": Object { + "configs": Array [ + Object { + "description": "Use ES modules named export for css exports.", + "multiple": false, + "path": "module.parser.css/module.namedExports", + "type": "boolean", + }, + ], + "description": "Use ES modules named export for css exports.", + "multiple": false, + "simpleType": "boolean", + }, + "module-parser-css-named-exports": Object { + "configs": Array [ + Object { + "description": "Use ES modules named export for css exports.", + "multiple": false, + "path": "module.parser.css.namedExports", + "type": "boolean", + }, + ], + "description": "Use ES modules named export for css exports.", + "multiple": false, + "simpleType": "boolean", + }, "module-parser-javascript-amd": Object { "configs": Array [ Object { @@ -1813,6 +1920,7 @@ Object { true, "warn-mock", "mock", + "node-module", "eval-only", ], }, @@ -1833,6 +1941,7 @@ Object { true, "warn-mock", "mock", + "node-module", "eval-only", ], }, @@ -2580,6 +2689,7 @@ Object { true, "warn-mock", "mock", + "node-module", "eval-only", ], }, @@ -2600,6 +2710,7 @@ Object { true, "warn-mock", "mock", + "node-module", "eval-only", ], }, @@ -3213,6 +3324,7 @@ Object { true, "warn-mock", "mock", + "node-module", "eval-only", ], }, @@ -3233,6 +3345,7 @@ Object { true, "warn-mock", "mock", + "node-module", "eval-only", ], }, @@ -3696,6 +3809,7 @@ Object { true, "warn-mock", "mock", + "node-module", "eval-only", ], }, @@ -3716,6 +3830,7 @@ Object { true, "warn-mock", "mock", + "node-module", "eval-only", ], }, @@ -4808,6 +4923,7 @@ Object { true, "warn-mock", "mock", + "node-module", "eval-only", ], }, @@ -4828,6 +4944,7 @@ Object { true, "warn-mock", "mock", + "node-module", "eval-only", ], }, @@ -5982,6 +6099,19 @@ Object { "multiple": false, "simpleType": "boolean", }, + "output-environment-async-function": Object { + "configs": Array [ + Object { + "description": "The environment supports async function and await ('async function () { await ... }').", + "multiple": false, + "path": "output.environment.asyncFunction", + "type": "boolean", + }, + ], + "description": "The environment supports async function and await ('async function () { await ... }').", + "multiple": false, + "simpleType": "boolean", + }, "output-environment-big-int-literal": Object { "configs": Array [ Object { @@ -8307,6 +8437,38 @@ Object { "multiple": false, "simpleType": "boolean", }, + "snapshot-unmanaged-paths": Object { + "configs": Array [ + Object { + "description": "A RegExp matching an unmanaged directory.", + "multiple": true, + "path": "snapshot.unmanagedPaths[]", + "type": "RegExp", + }, + Object { + "description": "A path to an unmanaged directory.", + "multiple": true, + "path": "snapshot.unmanagedPaths[]", + "type": "path", + }, + ], + "description": "A RegExp matching an unmanaged directory. A path to an unmanaged directory.", + "multiple": true, + "simpleType": "string", + }, + "snapshot-unmanaged-paths-reset": Object { + "configs": Array [ + Object { + "description": "Clear all items provided in 'snapshot.unmanagedPaths' configuration. List of paths that are not managed by a package manager and the contents are subject to change.", + "multiple": false, + "path": "snapshot.unmanagedPaths", + "type": "reset", + }, + ], + "description": "Clear all items provided in 'snapshot.unmanagedPaths' configuration. List of paths that are not managed by a package manager and the contents are subject to change.", + "multiple": false, + "simpleType": "boolean", + }, "stats": Object { "configs": Array [ Object { diff --git a/test/__snapshots__/ConfigCacheTestCases.longtest.js.snap b/test/__snapshots__/ConfigCacheTestCases.longtest.js.snap index 5720ac62b46..5d3ecb357f8 100644 --- a/test/__snapshots__/ConfigCacheTestCases.longtest.js.snap +++ b/test/__snapshots__/ConfigCacheTestCases.longtest.js.snap @@ -1901,29 +1901,29 @@ head{--webpack-use-style_js:class/local1/local2/local3/local4/local5/local6/loca `; exports[`ConfigCacheTestCases css css-modules exported tests should allow to create css modules 2`] = ` -".my-app-274-S { +".my-app-539-SM { color: red; } -.my-app-274-Zw, -.my-app-274-yl .global, -.my-app-274-J_ { +.my-app-539-ry, +.my-app-539-kW .global, +.my-app-539-rZ { color: green; } -.global .my-app-274-gc { +.global .my-app-539-yg { color: yellow; } -.my-app-274-Xg.global.my-app-274-AY { +.my-app-539-rE.global.my-app-539-k2 { color: blue; } -.my-app-274-Kw div:not(.disabled, .mButtonDisabled, .tipOnly) { +.my-app-539-do div:not(.disabled, .mButtonDisabled, .tipOnly) { pointer-events: initial !important; } -.my-app-274-rw :is(div.parent1.child1.vertical-tiny, +.my-app-539-yK :is(div.parent1.child1.vertical-tiny, div.parent1.child1.vertical-small, div.otherDiv.horizontal-tiny, div.otherDiv.horizontal-small div.description) { @@ -1932,7 +1932,7 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre overflow: hidden; } -.my-app-274-\\\\$Y :matches(div.parent1.child1.vertical-tiny, +.my-app-539-r8 :matches(div.parent1.child1.vertical-tiny, div.parent1.child1.vertical-small, div.otherDiv.horizontal-tiny, div.otherDiv.horizontal-small div.description) { @@ -1941,7 +1941,7 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre overflow: hidden; } -.my-app-274-ie :where(div.parent1.child1.vertical-tiny, +.my-app-539-ui :where(div.parent1.child1.vertical-tiny, div.parent1.child1.vertical-small, div.otherDiv.horizontal-tiny, div.otherDiv.horizontal-small div.description) { @@ -1950,31 +1950,31 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre overflow: hidden; } -.my-app-274-PK div:has(.disabled, .mButtonDisabled, .tipOnly) { +.my-app-539-kf div:has(.disabled, .mButtonDisabled, .tipOnly) { pointer-events: initial !important; } -.my-app-274-yK div:current(p, span) { +.my-app-539-eY div:current(p, span) { background-color: yellow; } -.my-app-274-P_ div:past(p, span) { +.my-app-539-mA div:past(p, span) { display: none; } -.my-app-274-Y4 div:future(p, span) { +.my-app-539-gJ div:future(p, span) { background-color: yellow; } -.my-app-274-TT div:-moz-any(ol, ul, menu, dir) { +.my-app-539-ol div:-moz-any(ol, ul, menu, dir) { list-style-type: square; } -.my-app-274-rT li:-webkit-any(:first-child, :last-child) { +.my-app-539-sZ li:-webkit-any(:first-child, :last-child) { background-color: aquamarine; } -.my-app-274-\\\\$Y :matches(div.parent1.child1.vertical-tiny, +.my-app-539-r8 :matches(div.parent1.child1.vertical-tiny, div.parent1.child1.vertical-small, div.otherDiv.horizontal-tiny, div.otherDiv.horizontal-small div.description) { @@ -1983,28 +1983,28 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre overflow: hidden; } -.my-app-274-RX.nested2.my-app-274-X2 { +.my-app-539-KY.nested2.my-app-539-c7 { color: pink; } -#my-app-274-yR { +#my-app-539-AB { color: purple; } -@keyframes my-app-274-y3{ +@keyframes my-app-539-Yf{ 0% { - left: var(--my-app-274-Gx); - top: var(--my-app-274-\\\\$s); + left: var(--my-app-539-Gw); + top: var(--my-app-539-uc); color: var(--theme-color1); } 100% { - left: var(--my-app-274-MX); - top: var(--my-app-274-nj); + left: var(--my-app-539-cP); + top: var(--my-app-539-EP); color: var(--theme-color2); } } -@keyframes my-app-274-JJ{ +@keyframes my-app-539-kB{ 0% { left: 0; } @@ -2013,13 +2013,13 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre } } -.my-app-274-oQ { - animation-name: my-app-274-y3; - animation: 3s ease-in 1s 2 reverse both paused my-app-274-y3, my-app-274-JJ; - --my-app-274-Gx: 0px; - --my-app-274-\\\\$s: 0px; - --my-app-274-MX: 10px; - --my-app-274-nj: 20px; +.my-app-539-OH { + animation-name: my-app-539-Yf; + animation: 3s ease-in 1s 2 reverse both paused my-app-539-Yf, my-app-539-kB; + --my-app-539-Gw: 0px; + --my-app-539-uc: 0px; + --my-app-539-cP: 10px; + --my-app-539-EP: 20px; } /* .composed { @@ -2027,45 +2027,45 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre composes: local2; } */ -.my-app-274-gR { - color: var(--my-app-274-y4); - --my-app-274-y4: red; +.my-app-539-ag { + color: var(--my-app-539-S4); + --my-app-539-S4: red; } -.my-app-274-xk { +.my-app-539-WW { color: var(--global-color); --global-color: red; } @media (min-width: 1600px) { - .my-app-274-w7 { - color: var(--my-app-274-y4); - --my-app-274-y4: green; + .my-app-539-qi { + color: var(--my-app-539-S4); + --my-app-539-S4: green; } } @media screen and (max-width: 600px) { - .my-app-274-J { - color: var(--my-app-274-y4); - --my-app-274-y4: purple; + .my-app-539-mI { + color: var(--my-app-539-S4); + --my-app-539-S4: purple; } } @supports (display: grid) { - .my-app-274-T\\\\$ { + .my-app-539-OQ { display: grid; } } @supports not (display: grid) { - .my-app-274-zz { + .my-app-539-AZ { float: right; } } @supports (display: flex) { @media screen and (min-width: 900px) { - .my-app-274-Kr { + .my-app-539-s9 { display: flex; } } @@ -2073,7 +2073,7 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre @media screen and (min-width: 900px) { @supports (display: flex) { - .my-app-274-SQ { + .my-app-539-I\\\\$ { display: flex; } } @@ -2081,35 +2081,35 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre @MEDIA screen and (min-width: 900px) { @SUPPORTS (display: flex) { - .my-app-274-XM { + .my-app-539-Wu { display: flex; } } } .animationUpperCase { - ANIMATION-NAME: my-app-274-T4; - ANIMATION: 3s ease-in 1s 2 reverse both paused my-app-274-T4, my-app-274-Xi; - --my-app-274-Gx: 0px; - --my-app-274-\\\\$s: 0px; - --my-app-274-MX: 10px; - --my-app-274-nj: 20px; + ANIMATION-NAME: my-app-539-ec; + ANIMATION: 3s ease-in 1s 2 reverse both paused my-app-539-ec, my-app-539-mQ; + --my-app-539-Gw: 0px; + --my-app-539-uc: 0px; + --my-app-539-cP: 10px; + --my-app-539-EP: 20px; } -@KEYFRAMES my-app-274-T4{ +@KEYFRAMES my-app-539-ec{ 0% { - left: VAR(--my-app-274-Gx); - top: VAR(--my-app-274-\\\\$s); + left: VAR(--my-app-539-Gw); + top: VAR(--my-app-539-uc); color: VAR(--theme-color1); } 100% { - left: VAR(--my-app-274-MX); - top: VAR(--my-app-274-nj); + left: VAR(--my-app-539-cP); + top: VAR(--my-app-539-EP); color: VAR(--theme-color2); } } -@KEYframes my-app-274-Xi{ +@KEYframes my-app-539-mQ{ 0% { left: 0; } @@ -2122,42 +2122,42 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre color: yellow; } -.my-app-274-ms { - color: VAR(--my-app-274-DJ); - --my-app-274-DJ: red; +.my-app-539-YL { + color: VAR(--my-app-539-KA); + --my-app-539-KA: red; } -.my-app-274-cU { +.my-app-539-ak { COLOR: VAR(--GLOBAR-COLOR); --GLOBAR-COLOR: red; } @supports (top: env(safe-area-inset-top, 0)) { - .my-app-274-FO { + .my-app-539-y_ { color: red; } } .a { - animation: 3s my-app-274-w3; - -webkit-animation: 3s my-app-274-w3; + animation: 3s my-app-539-es; + -webkit-animation: 3s my-app-539-es; } .b { - animation: my-app-274-w3 3s; - -webkit-animation: my-app-274-w3 3s; + animation: my-app-539-es 3s; + -webkit-animation: my-app-539-es 3s; } .c { - animation-name: my-app-274-w3; - -webkit-animation-name: my-app-274-w3; + animation-name: my-app-539-es; + -webkit-animation-name: my-app-539-es; } .d { - --my-app-274-VQ: animationName; + --my-app-539-mW: animationName; } -@keyframes my-app-274-w3{ +@keyframes my-app-539-es{ 0% { background: white; } @@ -2166,7 +2166,7 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre } } -@-webkit-keyframes my-app-274-w3{ +@-webkit-keyframes my-app-539-es{ 0% { background: white; } @@ -2175,7 +2175,7 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre } } -@-moz-keyframes my-app-274-t6{ +@-moz-keyframes my-app-539-kl{ 0% { background: white; } @@ -2203,27 +2203,27 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre } } -@property --my-app-274-lC{ +@property --my-app-539-iI{ syntax: \\"\\"; inherits: false; initial-value: #c0ffee; } -.my-app-274-S { - color: var(--my-app-274-lC); +.my-app-539-SM { + color: var(--my-app-539-iI); } @layer utilities { - .my-app-274-zE { + .my-app-539-Cg { padding: 0.5rem; } - .my-app-274-FP { + .my-app-539-sr { padding: 0.8rem; } } -.my-app-274-S { +.my-app-539-SM { color: red; .nested-pure { @@ -2284,7 +2284,7 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre .nested-var { .again { - color: var(--my-app-274-y4); + color: var(--my-app-539-S4); } } @@ -2329,7 +2329,7 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre } .nested-parens { - .my-app-274-\\\\$Y div:has(.vertical-tiny, .vertical-small) { + .my-app-539-r8 div:has(.vertical-tiny, .vertical-small) { max-height: 0; margin: 0; overflow: hidden; @@ -2354,21 +2354,21 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre } } -.class .my-app-274-Zv, -.class .my-app-274-Zv, -.my-app-274-gz .in-local-global-scope { +.class .my-app-539-_y, +.class .my-app-539-_y, +.my-app-539-sX .in-local-global-scope { color: red; } @container (width > 400px) { - .my-app-274-Gp { + .my-app-539-SU { font-size: 1.5em; } } @container summary (min-width: 400px) { @container (width > 400px) { - .my-app-274-rn { + .my-app-539-ay { font-size: 1.5em; } } @@ -2379,32 +2379,32 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre } .placeholder-gray-700:-ms-input-placeholder { - --my-app-274-xs: 1; + --my-app-539-qe: 1; color: #4a5568; - color: rgba(74, 85, 104, var(--my-app-274-xs)); + color: rgba(74, 85, 104, var(--my-app-539-qe)); } .placeholder-gray-700::-ms-input-placeholder { - --my-app-274-xs: 1; + --my-app-539-qe: 1; color: #4a5568; - color: rgba(74, 85, 104, var(--my-app-274-xs)); + color: rgba(74, 85, 104, var(--my-app-539-qe)); } .placeholder-gray-700::placeholder { - --my-app-274-xs: 1; + --my-app-539-qe: 1; color: #4a5568; - color: rgba(74, 85, 104, var(--my-app-274-xs)); + color: rgba(74, 85, 104, var(--my-app-539-qe)); } :root { - --my-app-274-Bu: dark; + --my-app-539-GM: dark; } -@media screen and (prefers-color-scheme: var(--my-app-274-Bu)) { - .my-app-274-Wx { +@media screen and (prefers-color-scheme: var(--my-app-539-GM)) { + .my-app-539-qE { color: white; } } -@keyframes my-app-274-Y8{ +@keyframes my-app-539-S0{ from { margin-left: 100%; width: 300%; @@ -2416,20 +2416,20 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre } } -.my-app-274-S { +.my-app-539-SM { animation: - foo var(--my-app-274-VQ) 3s, - var(--my-app-274-VQ) 3s, - 3s linear 1s infinite running my-app-274-Y8, - 3s linear env(foo, var(--my-app-274-Wx)) infinite running my-app-274-Y8; + foo var(--my-app-539-mW) 3s, + var(--my-app-539-mW) 3s, + 3s linear 1s infinite running my-app-539-S0, + 3s linear env(foo, var(--my-app-539-qE)) infinite running my-app-539-S0; } :root { - --my-app-274-Wx: 10px; + --my-app-539-qE: 10px; } -.my-app-274-S { - bar: env(foo, var(--my-app-274-Wx)); +.my-app-539-SM { + bar: env(foo, var(--my-app-539-qE)); } .global-foo, .bar { @@ -2484,12 +2484,12 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre .again-again-global { animation: slidein 3s; - .again-again-global, .my-app-274-S, .my-app-274-RX.nested2.my-app-274-X2 { - animation: my-app-274-Y8 3s; + .again-again-global, .my-app-539-SM, .my-app-539-KY.nested2.my-app-539-c7 { + animation: my-app-539-S0 3s; } - .my-app-274-yl .global, - .my-app-274-J_ { + .my-app-539-kW .global, + .my-app-539-rZ { color: red; } } @@ -2498,38 +2498,38 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre color: red; } -.my-app-274-S { - .my-app-274-S { - .my-app-274-S { - .my-app-274-S {} +.my-app-539-SM { + .my-app-539-SM { + .my-app-539-SM { + .my-app-539-SM {} } } } -.my-app-274-S { - .my-app-274-S { - .my-app-274-S { - .my-app-274-S { - animation: my-app-274-Y8 3s; +.my-app-539-SM { + .my-app-539-SM { + .my-app-539-SM { + .my-app-539-SM { + animation: my-app-539-S0 3s; } } } } -.my-app-274-S { - animation: my-app-274-Y8 3s; - .my-app-274-S { - animation: my-app-274-Y8 3s; - .my-app-274-S { - animation: my-app-274-Y8 3s; - .my-app-274-S { - animation: my-app-274-Y8 3s; +.my-app-539-SM { + animation: my-app-539-S0 3s; + .my-app-539-SM { + animation: my-app-539-S0 3s; + .my-app-539-SM { + animation: my-app-539-S0 3s; + .my-app-539-SM { + animation: my-app-539-S0 3s; } } } } -.my-app-444-s { +.my-app-248-u { color: red; } @@ -2539,17 +2539,300 @@ exports[`ConfigCacheTestCases css css-modules exported tests should allow to cre .UnusedClassName{ color: red; - padding: var(--my-app-627-Wc); - --my-app-627-Wc: 10px; + padding: var(--my-app-816-or); + --my-app-816-or: 10px; } -.my-app-627-Q3 { +.my-app-816-sZ { color: green; - padding: var(--my-app-627-PB); - --my-app-627-PB: 10px; + padding: var(--my-app-816-cP); + --my-app-816-cP: 10px; } -head{--webpack-my-app-249:S/Zw/yl/J_/gc/Xg/AY/Kw/rw/\\\\$Y/ie/PK/yK/P_/Y4/TT/rT/RX/X2/yR/y3/Gx%\\\\$s%MX%nj%JJ/oQ/gR/y4%xk/w7/J/T\\\\$/zz/Kr/SQ/XM/T4/Xi/ms/DJ%cU/FO/w3/VQ%t6/lC%zE/FP/Zv/gz/Gp/rn/xs%Bu%Wx%Y8/_274,s/_444,_438,Wc%Q3/PB%_627;}" +head{--webpack-my-app-848:SM/ry/kW/rZ/yg/rE/k2/do/yK/r8/ui/kf/eY/mA/gJ/ol/sZ/KY/c7/AB/Yf/Gw%uc%cP%EP%kB/OH/ag/S4%WW/qi/mI/OQ/AZ/s9/I\\\\$/Wu/ec/mQ/YL/KA%ak/y_/es/mW%kl/iI%Cg/sr/__y/sX/SU/ay/qe%GM%qE%S0/_539,u/_248,_535,or%sZ/cP%_816;}" +`; + +exports[`ConfigCacheTestCases css css-modules exported tests should allow to create css modules: dev 1`] = ` +Object { + "UsedClassName": "./identifiers.module.css-UsedClassName", + "VARS": "--./style.module.css-LOCAL-COLOR ./style.module.css-VARS undefined ./style.module.css-globalVarsUpperCase", + "animation": "./style.module.css-animation", + "animationName": "./style.module.css-animationName", + "class": "./style.module.css-class", + "classInContainer": "./style.module.css-class-in-container", + "classLocalScope": "./style.module.css-class-local-scope", + "cssModuleWithCustomFileExtension": "./style.module.my-css-myCssClass", + "currentWmultiParams": "./style.module.css-local12", + "deepClassInContainer": "./style.module.css-deep-class-in-container", + "displayFlexInSupportsInMediaUpperCase": "./style.module.css-displayFlexInSupportsInMediaUpperCase", + "futureWmultiParams": "./style.module.css-local14", + "global": undefined, + "hasWmultiParams": "./style.module.css-local11", + "ident": "./style.module.css-ident", + "inLocalGlobalScope": "./style.module.css-in-local-global-scope", + "inSupportScope": "./style.module.css-inSupportScope", + "isWmultiParams": "./style.module.css-local8", + "keyframes": "./style.module.css-localkeyframes", + "keyframesUPPERCASE": "./style.module.css-localkeyframesUPPERCASE", + "local": "./style.module.css-local1 ./style.module.css-local2 ./style.module.css-local3 ./style.module.css-local4", + "local2": "./style.module.css-local5 ./style.module.css-local6", + "localkeyframes2UPPPERCASE": "./style.module.css-localkeyframes2UPPPERCASE", + "matchesWmultiParams": "./style.module.css-local9", + "media": "./style.module.css-wideScreenClass", + "mediaInSupports": "./style.module.css-displayFlexInMediaInSupports", + "mediaWithOperator": "./style.module.css-narrowScreenClass", + "mozAnimationName": "./style.module.css-mozAnimationName", + "mozAnyWmultiParams": "./style.module.css-local15", + "myColor": "--./style.module.css-my-color", + "nested": "./style.module.css-nested1 undefined ./style.module.css-nested3", + "notAValidCssModuleExtension": true, + "notWmultiParams": "./style.module.css-local7", + "paddingLg": "./style.module.css-padding-lg", + "paddingSm": "./style.module.css-padding-sm", + "pastWmultiParams": "./style.module.css-local13", + "supports": "./style.module.css-displayGridInSupports", + "supportsInMedia": "./style.module.css-displayFlexInSupportsInMedia", + "supportsWithOperator": "./style.module.css-floatRightInNegativeSupports", + "vars": "--./style.module.css-local-color ./style.module.css-vars undefined ./style.module.css-globalVars", + "webkitAnyWmultiParams": "./style.module.css-local16", + "whereWmultiParams": "./style.module.css-local10", +} +`; + +exports[`ConfigCacheTestCases css css-modules exported tests should allow to create css modules: prod 1`] = ` +Object { + "UsedClassName": "my-app-816-sZ", + "VARS": "--my-app-539-KA my-app-539-YL undefined my-app-539-ak", + "animation": "my-app-539-OH", + "animationName": "my-app-539-es", + "class": "my-app-539-SM", + "classInContainer": "my-app-539-SU", + "classLocalScope": "my-app-539-sX", + "cssModuleWithCustomFileExtension": "my-app-248-u", + "currentWmultiParams": "my-app-539-eY", + "deepClassInContainer": "my-app-539-ay", + "displayFlexInSupportsInMediaUpperCase": "my-app-539-Wu", + "futureWmultiParams": "my-app-539-gJ", + "global": undefined, + "hasWmultiParams": "my-app-539-kf", + "ident": "my-app-539-AB", + "inLocalGlobalScope": "my-app-539-_y", + "inSupportScope": "my-app-539-y_", + "isWmultiParams": "my-app-539-yK", + "keyframes": "my-app-539-Yf", + "keyframesUPPERCASE": "my-app-539-ec", + "local": "my-app-539-ry my-app-539-kW my-app-539-rZ my-app-539-yg", + "local2": "my-app-539-rE my-app-539-k2", + "localkeyframes2UPPPERCASE": "my-app-539-mQ", + "matchesWmultiParams": "my-app-539-r8", + "media": "my-app-539-qi", + "mediaInSupports": "my-app-539-s9", + "mediaWithOperator": "my-app-539-mI", + "mozAnimationName": "my-app-539-kl", + "mozAnyWmultiParams": "my-app-539-ol", + "myColor": "--my-app-539-iI", + "nested": "my-app-539-KY undefined my-app-539-c7", + "notAValidCssModuleExtension": true, + "notWmultiParams": "my-app-539-do", + "paddingLg": "my-app-539-sr", + "paddingSm": "my-app-539-Cg", + "pastWmultiParams": "my-app-539-mA", + "supports": "my-app-539-OQ", + "supportsInMedia": "my-app-539-I$", + "supportsWithOperator": "my-app-539-AZ", + "vars": "--my-app-539-S4 my-app-539-ag undefined my-app-539-WW", + "webkitAnyWmultiParams": "my-app-539-sZ", + "whereWmultiParams": "my-app-539-ui", +} +`; + +exports[`ConfigCacheTestCases css css-modules-broken-keyframes exported tests should allow to create css modules: prod 1`] = ` +Object { + "class": "my-app-539-S", +} +`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to create css modules: dev 1`] = ` +Object { + "UsedClassName": "./identifiers.module.css-UsedClassName", + "VARS": "--./style.module.css-LOCAL-COLOR ./style.module.css-VARS undefined ./style.module.css-globalVarsUpperCase", + "animation": "./style.module.css-animation", + "animationName": "./style.module.css-animationName", + "class": "./style.module.css-class", + "classInContainer": "./style.module.css-class-in-container", + "classLocalScope": "./style.module.css-class-local-scope", + "cssModuleWithCustomFileExtension": "./style.module.my-css-myCssClass", + "currentWmultiParams": "./style.module.css-local12", + "deepClassInContainer": "./style.module.css-deep-class-in-container", + "displayFlexInSupportsInMediaUpperCase": "./style.module.css-displayFlexInSupportsInMediaUpperCase", + "futureWmultiParams": "./style.module.css-local14", + "global": undefined, + "hasWmultiParams": "./style.module.css-local11", + "ident": "./style.module.css-ident", + "inLocalGlobalScope": "./style.module.css-in-local-global-scope", + "inSupportScope": "./style.module.css-inSupportScope", + "isWmultiParams": "./style.module.css-local8", + "keyframes": "./style.module.css-localkeyframes", + "keyframesUPPERCASE": "./style.module.css-localkeyframesUPPERCASE", + "local": "./style.module.css-local1 ./style.module.css-local2 ./style.module.css-local3 ./style.module.css-local4", + "local2": "./style.module.css-local5 ./style.module.css-local6", + "localkeyframes2UPPPERCASE": "./style.module.css-localkeyframes2UPPPERCASE", + "matchesWmultiParams": "./style.module.css-local9", + "media": "./style.module.css-wideScreenClass", + "mediaInSupports": "./style.module.css-displayFlexInMediaInSupports", + "mediaWithOperator": "./style.module.css-narrowScreenClass", + "mozAnimationName": "./style.module.css-mozAnimationName", + "mozAnyWmultiParams": "./style.module.css-local15", + "myColor": "--./style.module.css-my-color", + "nested": "./style.module.css-nested1 undefined ./style.module.css-nested3", + "notAValidCssModuleExtension": true, + "notWmultiParams": "./style.module.css-local7", + "paddingLg": "./style.module.css-padding-lg", + "paddingSm": "./style.module.css-padding-sm", + "pastWmultiParams": "./style.module.css-local13", + "supports": "./style.module.css-displayGridInSupports", + "supportsInMedia": "./style.module.css-displayFlexInSupportsInMedia", + "supportsWithOperator": "./style.module.css-floatRightInNegativeSupports", + "vars": "--./style.module.css-local-color ./style.module.css-vars undefined ./style.module.css-globalVars", + "webkitAnyWmultiParams": "./style.module.css-local16", + "whereWmultiParams": "./style.module.css-local10", +} +`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to create css modules: prod 1`] = ` +Object { + "UsedClassName": "my-app-816-sZ", + "VARS": "--my-app-539-KA my-app-539-YL undefined my-app-539-ak", + "animation": "my-app-539-OH", + "animationName": "my-app-539-es", + "class": "my-app-539-SM", + "classInContainer": "my-app-539-SU", + "classLocalScope": "my-app-539-sX", + "cssModuleWithCustomFileExtension": "my-app-248-u", + "currentWmultiParams": "my-app-539-eY", + "deepClassInContainer": "my-app-539-ay", + "displayFlexInSupportsInMediaUpperCase": "my-app-539-Wu", + "futureWmultiParams": "my-app-539-gJ", + "global": undefined, + "hasWmultiParams": "my-app-539-kf", + "ident": "my-app-539-AB", + "inLocalGlobalScope": "my-app-539-_y", + "inSupportScope": "my-app-539-y_", + "isWmultiParams": "my-app-539-yK", + "keyframes": "my-app-539-Yf", + "keyframesUPPERCASE": "my-app-539-ec", + "local": "my-app-539-ry my-app-539-kW my-app-539-rZ my-app-539-yg", + "local2": "my-app-539-rE my-app-539-k2", + "localkeyframes2UPPPERCASE": "my-app-539-mQ", + "matchesWmultiParams": "my-app-539-r8", + "media": "my-app-539-qi", + "mediaInSupports": "my-app-539-s9", + "mediaWithOperator": "my-app-539-mI", + "mozAnimationName": "my-app-539-kl", + "mozAnyWmultiParams": "my-app-539-ol", + "myColor": "--my-app-539-iI", + "nested": "my-app-539-KY undefined my-app-539-c7", + "notAValidCssModuleExtension": true, + "notWmultiParams": "my-app-539-do", + "paddingLg": "my-app-539-sr", + "paddingSm": "my-app-539-Cg", + "pastWmultiParams": "my-app-539-mA", + "supports": "my-app-539-OQ", + "supportsInMedia": "my-app-539-I$", + "supportsWithOperator": "my-app-539-AZ", + "vars": "--my-app-539-S4 my-app-539-ag undefined my-app-539-WW", + "webkitAnyWmultiParams": "my-app-539-sZ", + "whereWmultiParams": "my-app-539-ui", +} +`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to create css modules: prod 2`] = ` +Object { + "UsedClassName": "my-app-816-sZ", + "VARS": "--my-app-539-KA my-app-539-YL undefined my-app-539-ak", + "animation": "my-app-539-OH", + "animationName": "my-app-539-es", + "class": "my-app-539-SM", + "classInContainer": "my-app-539-SU", + "classLocalScope": "my-app-539-sX", + "cssModuleWithCustomFileExtension": "my-app-248-u", + "currentWmultiParams": "my-app-539-eY", + "deepClassInContainer": "my-app-539-ay", + "displayFlexInSupportsInMediaUpperCase": "my-app-539-Wu", + "futureWmultiParams": "my-app-539-gJ", + "global": undefined, + "hasWmultiParams": "my-app-539-kf", + "ident": "my-app-539-AB", + "inLocalGlobalScope": "my-app-539-_y", + "inSupportScope": "my-app-539-y_", + "isWmultiParams": "my-app-539-yK", + "keyframes": "my-app-539-Yf", + "keyframesUPPERCASE": "my-app-539-ec", + "local": "my-app-539-ry my-app-539-kW my-app-539-rZ my-app-539-yg", + "local2": "my-app-539-rE my-app-539-k2", + "localkeyframes2UPPPERCASE": "my-app-539-mQ", + "matchesWmultiParams": "my-app-539-r8", + "media": "my-app-539-qi", + "mediaInSupports": "my-app-539-s9", + "mediaWithOperator": "my-app-539-mI", + "mozAnimationName": "my-app-539-kl", + "mozAnyWmultiParams": "my-app-539-ol", + "myColor": "--my-app-539-iI", + "nested": "my-app-539-KY undefined my-app-539-c7", + "notAValidCssModuleExtension": true, + "notWmultiParams": "my-app-539-do", + "paddingLg": "my-app-539-sr", + "paddingSm": "my-app-539-Cg", + "pastWmultiParams": "my-app-539-mA", + "supports": "my-app-539-OQ", + "supportsInMedia": "my-app-539-I$", + "supportsWithOperator": "my-app-539-AZ", + "vars": "--my-app-539-S4 my-app-539-ag undefined my-app-539-WW", + "webkitAnyWmultiParams": "my-app-539-sZ", + "whereWmultiParams": "my-app-539-ui", +} +`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: class-dev 1`] = `"./style.module.css-class"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: class-prod 1`] = `"my-app-539-SM"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: class-prod 2`] = `"my-app-539-SM"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: local1-dev 1`] = `"./style.module.css-local1"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: local1-prod 1`] = `"my-app-539-ry"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: local1-prod 2`] = `"my-app-539-ry"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: local2-dev 1`] = `"./style.module.css-local2"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: local2-prod 1`] = `"my-app-539-kW"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: local2-prod 2`] = `"my-app-539-kW"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: local3-dev 1`] = `"./style.module.css-local3"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: local3-prod 1`] = `"my-app-539-rZ"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: local3-prod 2`] = `"my-app-539-rZ"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: local4-dev 1`] = `"./style.module.css-local4"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: local4-prod 1`] = `"my-app-539-yg"`; + +exports[`ConfigCacheTestCases css css-modules-in-node exported tests should allow to import css modules: local4-prod 2`] = `"my-app-539-yg"`; + +exports[`ConfigCacheTestCases css large exported tests should allow to create css modules: dev 1`] = ` +Object { + "placeholder": "my-app-./tailwind.module.css-placeholder-gray-700", +} +`; + +exports[`ConfigCacheTestCases css large exported tests should allow to create css modules: prod 1`] = ` +Object { + "placeholder": "512-UB7V", +} `; exports[`ConfigCacheTestCases css pure-css exported tests should compile 1`] = ` @@ -3505,27 +3788,27 @@ exports[`ConfigCacheTestCases records issue-2991 exported tests should write rel "{ \\"chunks\\": { \\"byName\\": { - \\"main\\": 179 + \\"main\\": 590 }, \\"bySource\\": { - \\"0 main\\": 179 + \\"0 main\\": 590 }, \\"usedIds\\": [ - 179 + 590 ] }, \\"modules\\": { \\"byIdentifier\\": { - \\"./test.js\\": 393, - \\"external node-commonjs \\\\\\"fs\\\\\\"\\": 147, - \\"external node-commonjs \\\\\\"path\\\\\\"\\": 17, - \\"ignored|./.|pkgs/somepackage/foo\\": 802 + \\"./test.js\\": 844, + \\"external node-commonjs \\\\\\"fs\\\\\\"\\": 58, + \\"external node-commonjs \\\\\\"path\\\\\\"\\": 72, + \\"ignored|./.|pkgs/somepackage/foo\\": 128 }, \\"usedIds\\": [ - 17, - 147, - 393, - 802 + 58, + 72, + 128, + 844 ] } }" @@ -3535,31 +3818,31 @@ exports[`ConfigCacheTestCases records issue-7339 exported tests should write rel "{ \\"chunks\\": { \\"byName\\": { - \\"main\\": 179 + \\"main\\": 590 }, \\"bySource\\": { - \\"0 main\\": 179 + \\"0 main\\": 590 }, \\"usedIds\\": [ - 179 + 590 ] }, \\"modules\\": { \\"byIdentifier\\": { - \\"./dependencies/bar.js\\": 379, - \\"./dependencies/foo.js\\": 117, - \\"./dependencies|sync|/^\\\\\\\\.\\\\\\\\/.*$/\\": 412, - \\"./test.js\\": 393, - \\"external node-commonjs \\\\\\"fs\\\\\\"\\": 147, - \\"external node-commonjs \\\\\\"path\\\\\\"\\": 17 + \\"./dependencies/bar.js\\": 664, + \\"./dependencies/foo.js\\": 396, + \\"./dependencies|sync|/^\\\\\\\\.\\\\\\\\/.*$/\\": 660, + \\"./test.js\\": 844, + \\"external node-commonjs \\\\\\"fs\\\\\\"\\": 58, + \\"external node-commonjs \\\\\\"path\\\\\\"\\": 72 }, \\"usedIds\\": [ - 17, - 117, - 147, - 379, - 393, - 412 + 58, + 72, + 396, + 660, + 664, + 844 ] } }" diff --git a/test/__snapshots__/ConfigTestCases.basictest.js.snap b/test/__snapshots__/ConfigTestCases.basictest.js.snap index d28fbeef1fb..af8d41a3f4c 100644 --- a/test/__snapshots__/ConfigTestCases.basictest.js.snap +++ b/test/__snapshots__/ConfigTestCases.basictest.js.snap @@ -1901,29 +1901,29 @@ head{--webpack-use-style_js:class/local1/local2/local3/local4/local5/local6/loca `; exports[`ConfigTestCases css css-modules exported tests should allow to create css modules 2`] = ` -".my-app-274-S { +".my-app-539-SM { color: red; } -.my-app-274-Zw, -.my-app-274-yl .global, -.my-app-274-J_ { +.my-app-539-ry, +.my-app-539-kW .global, +.my-app-539-rZ { color: green; } -.global .my-app-274-gc { +.global .my-app-539-yg { color: yellow; } -.my-app-274-Xg.global.my-app-274-AY { +.my-app-539-rE.global.my-app-539-k2 { color: blue; } -.my-app-274-Kw div:not(.disabled, .mButtonDisabled, .tipOnly) { +.my-app-539-do div:not(.disabled, .mButtonDisabled, .tipOnly) { pointer-events: initial !important; } -.my-app-274-rw :is(div.parent1.child1.vertical-tiny, +.my-app-539-yK :is(div.parent1.child1.vertical-tiny, div.parent1.child1.vertical-small, div.otherDiv.horizontal-tiny, div.otherDiv.horizontal-small div.description) { @@ -1932,7 +1932,7 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c overflow: hidden; } -.my-app-274-\\\\$Y :matches(div.parent1.child1.vertical-tiny, +.my-app-539-r8 :matches(div.parent1.child1.vertical-tiny, div.parent1.child1.vertical-small, div.otherDiv.horizontal-tiny, div.otherDiv.horizontal-small div.description) { @@ -1941,7 +1941,7 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c overflow: hidden; } -.my-app-274-ie :where(div.parent1.child1.vertical-tiny, +.my-app-539-ui :where(div.parent1.child1.vertical-tiny, div.parent1.child1.vertical-small, div.otherDiv.horizontal-tiny, div.otherDiv.horizontal-small div.description) { @@ -1950,31 +1950,31 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c overflow: hidden; } -.my-app-274-PK div:has(.disabled, .mButtonDisabled, .tipOnly) { +.my-app-539-kf div:has(.disabled, .mButtonDisabled, .tipOnly) { pointer-events: initial !important; } -.my-app-274-yK div:current(p, span) { +.my-app-539-eY div:current(p, span) { background-color: yellow; } -.my-app-274-P_ div:past(p, span) { +.my-app-539-mA div:past(p, span) { display: none; } -.my-app-274-Y4 div:future(p, span) { +.my-app-539-gJ div:future(p, span) { background-color: yellow; } -.my-app-274-TT div:-moz-any(ol, ul, menu, dir) { +.my-app-539-ol div:-moz-any(ol, ul, menu, dir) { list-style-type: square; } -.my-app-274-rT li:-webkit-any(:first-child, :last-child) { +.my-app-539-sZ li:-webkit-any(:first-child, :last-child) { background-color: aquamarine; } -.my-app-274-\\\\$Y :matches(div.parent1.child1.vertical-tiny, +.my-app-539-r8 :matches(div.parent1.child1.vertical-tiny, div.parent1.child1.vertical-small, div.otherDiv.horizontal-tiny, div.otherDiv.horizontal-small div.description) { @@ -1983,28 +1983,28 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c overflow: hidden; } -.my-app-274-RX.nested2.my-app-274-X2 { +.my-app-539-KY.nested2.my-app-539-c7 { color: pink; } -#my-app-274-yR { +#my-app-539-AB { color: purple; } -@keyframes my-app-274-y3{ +@keyframes my-app-539-Yf{ 0% { - left: var(--my-app-274-Gx); - top: var(--my-app-274-\\\\$s); + left: var(--my-app-539-Gw); + top: var(--my-app-539-uc); color: var(--theme-color1); } 100% { - left: var(--my-app-274-MX); - top: var(--my-app-274-nj); + left: var(--my-app-539-cP); + top: var(--my-app-539-EP); color: var(--theme-color2); } } -@keyframes my-app-274-JJ{ +@keyframes my-app-539-kB{ 0% { left: 0; } @@ -2013,13 +2013,13 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c } } -.my-app-274-oQ { - animation-name: my-app-274-y3; - animation: 3s ease-in 1s 2 reverse both paused my-app-274-y3, my-app-274-JJ; - --my-app-274-Gx: 0px; - --my-app-274-\\\\$s: 0px; - --my-app-274-MX: 10px; - --my-app-274-nj: 20px; +.my-app-539-OH { + animation-name: my-app-539-Yf; + animation: 3s ease-in 1s 2 reverse both paused my-app-539-Yf, my-app-539-kB; + --my-app-539-Gw: 0px; + --my-app-539-uc: 0px; + --my-app-539-cP: 10px; + --my-app-539-EP: 20px; } /* .composed { @@ -2027,45 +2027,45 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c composes: local2; } */ -.my-app-274-gR { - color: var(--my-app-274-y4); - --my-app-274-y4: red; +.my-app-539-ag { + color: var(--my-app-539-S4); + --my-app-539-S4: red; } -.my-app-274-xk { +.my-app-539-WW { color: var(--global-color); --global-color: red; } @media (min-width: 1600px) { - .my-app-274-w7 { - color: var(--my-app-274-y4); - --my-app-274-y4: green; + .my-app-539-qi { + color: var(--my-app-539-S4); + --my-app-539-S4: green; } } @media screen and (max-width: 600px) { - .my-app-274-J { - color: var(--my-app-274-y4); - --my-app-274-y4: purple; + .my-app-539-mI { + color: var(--my-app-539-S4); + --my-app-539-S4: purple; } } @supports (display: grid) { - .my-app-274-T\\\\$ { + .my-app-539-OQ { display: grid; } } @supports not (display: grid) { - .my-app-274-zz { + .my-app-539-AZ { float: right; } } @supports (display: flex) { @media screen and (min-width: 900px) { - .my-app-274-Kr { + .my-app-539-s9 { display: flex; } } @@ -2073,7 +2073,7 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c @media screen and (min-width: 900px) { @supports (display: flex) { - .my-app-274-SQ { + .my-app-539-I\\\\$ { display: flex; } } @@ -2081,35 +2081,35 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c @MEDIA screen and (min-width: 900px) { @SUPPORTS (display: flex) { - .my-app-274-XM { + .my-app-539-Wu { display: flex; } } } .animationUpperCase { - ANIMATION-NAME: my-app-274-T4; - ANIMATION: 3s ease-in 1s 2 reverse both paused my-app-274-T4, my-app-274-Xi; - --my-app-274-Gx: 0px; - --my-app-274-\\\\$s: 0px; - --my-app-274-MX: 10px; - --my-app-274-nj: 20px; + ANIMATION-NAME: my-app-539-ec; + ANIMATION: 3s ease-in 1s 2 reverse both paused my-app-539-ec, my-app-539-mQ; + --my-app-539-Gw: 0px; + --my-app-539-uc: 0px; + --my-app-539-cP: 10px; + --my-app-539-EP: 20px; } -@KEYFRAMES my-app-274-T4{ +@KEYFRAMES my-app-539-ec{ 0% { - left: VAR(--my-app-274-Gx); - top: VAR(--my-app-274-\\\\$s); + left: VAR(--my-app-539-Gw); + top: VAR(--my-app-539-uc); color: VAR(--theme-color1); } 100% { - left: VAR(--my-app-274-MX); - top: VAR(--my-app-274-nj); + left: VAR(--my-app-539-cP); + top: VAR(--my-app-539-EP); color: VAR(--theme-color2); } } -@KEYframes my-app-274-Xi{ +@KEYframes my-app-539-mQ{ 0% { left: 0; } @@ -2122,42 +2122,42 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c color: yellow; } -.my-app-274-ms { - color: VAR(--my-app-274-DJ); - --my-app-274-DJ: red; +.my-app-539-YL { + color: VAR(--my-app-539-KA); + --my-app-539-KA: red; } -.my-app-274-cU { +.my-app-539-ak { COLOR: VAR(--GLOBAR-COLOR); --GLOBAR-COLOR: red; } @supports (top: env(safe-area-inset-top, 0)) { - .my-app-274-FO { + .my-app-539-y_ { color: red; } } .a { - animation: 3s my-app-274-w3; - -webkit-animation: 3s my-app-274-w3; + animation: 3s my-app-539-es; + -webkit-animation: 3s my-app-539-es; } .b { - animation: my-app-274-w3 3s; - -webkit-animation: my-app-274-w3 3s; + animation: my-app-539-es 3s; + -webkit-animation: my-app-539-es 3s; } .c { - animation-name: my-app-274-w3; - -webkit-animation-name: my-app-274-w3; + animation-name: my-app-539-es; + -webkit-animation-name: my-app-539-es; } .d { - --my-app-274-VQ: animationName; + --my-app-539-mW: animationName; } -@keyframes my-app-274-w3{ +@keyframes my-app-539-es{ 0% { background: white; } @@ -2166,7 +2166,7 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c } } -@-webkit-keyframes my-app-274-w3{ +@-webkit-keyframes my-app-539-es{ 0% { background: white; } @@ -2175,7 +2175,7 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c } } -@-moz-keyframes my-app-274-t6{ +@-moz-keyframes my-app-539-kl{ 0% { background: white; } @@ -2203,27 +2203,27 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c } } -@property --my-app-274-lC{ +@property --my-app-539-iI{ syntax: \\"\\"; inherits: false; initial-value: #c0ffee; } -.my-app-274-S { - color: var(--my-app-274-lC); +.my-app-539-SM { + color: var(--my-app-539-iI); } @layer utilities { - .my-app-274-zE { + .my-app-539-Cg { padding: 0.5rem; } - .my-app-274-FP { + .my-app-539-sr { padding: 0.8rem; } } -.my-app-274-S { +.my-app-539-SM { color: red; .nested-pure { @@ -2284,7 +2284,7 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c .nested-var { .again { - color: var(--my-app-274-y4); + color: var(--my-app-539-S4); } } @@ -2329,7 +2329,7 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c } .nested-parens { - .my-app-274-\\\\$Y div:has(.vertical-tiny, .vertical-small) { + .my-app-539-r8 div:has(.vertical-tiny, .vertical-small) { max-height: 0; margin: 0; overflow: hidden; @@ -2354,21 +2354,21 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c } } -.class .my-app-274-Zv, -.class .my-app-274-Zv, -.my-app-274-gz .in-local-global-scope { +.class .my-app-539-_y, +.class .my-app-539-_y, +.my-app-539-sX .in-local-global-scope { color: red; } @container (width > 400px) { - .my-app-274-Gp { + .my-app-539-SU { font-size: 1.5em; } } @container summary (min-width: 400px) { @container (width > 400px) { - .my-app-274-rn { + .my-app-539-ay { font-size: 1.5em; } } @@ -2379,32 +2379,32 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c } .placeholder-gray-700:-ms-input-placeholder { - --my-app-274-xs: 1; + --my-app-539-qe: 1; color: #4a5568; - color: rgba(74, 85, 104, var(--my-app-274-xs)); + color: rgba(74, 85, 104, var(--my-app-539-qe)); } .placeholder-gray-700::-ms-input-placeholder { - --my-app-274-xs: 1; + --my-app-539-qe: 1; color: #4a5568; - color: rgba(74, 85, 104, var(--my-app-274-xs)); + color: rgba(74, 85, 104, var(--my-app-539-qe)); } .placeholder-gray-700::placeholder { - --my-app-274-xs: 1; + --my-app-539-qe: 1; color: #4a5568; - color: rgba(74, 85, 104, var(--my-app-274-xs)); + color: rgba(74, 85, 104, var(--my-app-539-qe)); } :root { - --my-app-274-Bu: dark; + --my-app-539-GM: dark; } -@media screen and (prefers-color-scheme: var(--my-app-274-Bu)) { - .my-app-274-Wx { +@media screen and (prefers-color-scheme: var(--my-app-539-GM)) { + .my-app-539-qE { color: white; } } -@keyframes my-app-274-Y8{ +@keyframes my-app-539-S0{ from { margin-left: 100%; width: 300%; @@ -2416,20 +2416,20 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c } } -.my-app-274-S { +.my-app-539-SM { animation: - foo var(--my-app-274-VQ) 3s, - var(--my-app-274-VQ) 3s, - 3s linear 1s infinite running my-app-274-Y8, - 3s linear env(foo, var(--my-app-274-Wx)) infinite running my-app-274-Y8; + foo var(--my-app-539-mW) 3s, + var(--my-app-539-mW) 3s, + 3s linear 1s infinite running my-app-539-S0, + 3s linear env(foo, var(--my-app-539-qE)) infinite running my-app-539-S0; } :root { - --my-app-274-Wx: 10px; + --my-app-539-qE: 10px; } -.my-app-274-S { - bar: env(foo, var(--my-app-274-Wx)); +.my-app-539-SM { + bar: env(foo, var(--my-app-539-qE)); } .global-foo, .bar { @@ -2484,12 +2484,12 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c .again-again-global { animation: slidein 3s; - .again-again-global, .my-app-274-S, .my-app-274-RX.nested2.my-app-274-X2 { - animation: my-app-274-Y8 3s; + .again-again-global, .my-app-539-SM, .my-app-539-KY.nested2.my-app-539-c7 { + animation: my-app-539-S0 3s; } - .my-app-274-yl .global, - .my-app-274-J_ { + .my-app-539-kW .global, + .my-app-539-rZ { color: red; } } @@ -2498,38 +2498,38 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c color: red; } -.my-app-274-S { - .my-app-274-S { - .my-app-274-S { - .my-app-274-S {} +.my-app-539-SM { + .my-app-539-SM { + .my-app-539-SM { + .my-app-539-SM {} } } } -.my-app-274-S { - .my-app-274-S { - .my-app-274-S { - .my-app-274-S { - animation: my-app-274-Y8 3s; +.my-app-539-SM { + .my-app-539-SM { + .my-app-539-SM { + .my-app-539-SM { + animation: my-app-539-S0 3s; } } } } -.my-app-274-S { - animation: my-app-274-Y8 3s; - .my-app-274-S { - animation: my-app-274-Y8 3s; - .my-app-274-S { - animation: my-app-274-Y8 3s; - .my-app-274-S { - animation: my-app-274-Y8 3s; +.my-app-539-SM { + animation: my-app-539-S0 3s; + .my-app-539-SM { + animation: my-app-539-S0 3s; + .my-app-539-SM { + animation: my-app-539-S0 3s; + .my-app-539-SM { + animation: my-app-539-S0 3s; } } } } -.my-app-444-s { +.my-app-248-u { color: red; } @@ -2539,17 +2539,300 @@ exports[`ConfigTestCases css css-modules exported tests should allow to create c .UnusedClassName{ color: red; - padding: var(--my-app-627-Wc); - --my-app-627-Wc: 10px; + padding: var(--my-app-816-or); + --my-app-816-or: 10px; } -.my-app-627-Q3 { +.my-app-816-sZ { color: green; - padding: var(--my-app-627-PB); - --my-app-627-PB: 10px; + padding: var(--my-app-816-cP); + --my-app-816-cP: 10px; } -head{--webpack-my-app-249:S/Zw/yl/J_/gc/Xg/AY/Kw/rw/\\\\$Y/ie/PK/yK/P_/Y4/TT/rT/RX/X2/yR/y3/Gx%\\\\$s%MX%nj%JJ/oQ/gR/y4%xk/w7/J/T\\\\$/zz/Kr/SQ/XM/T4/Xi/ms/DJ%cU/FO/w3/VQ%t6/lC%zE/FP/Zv/gz/Gp/rn/xs%Bu%Wx%Y8/_274,s/_444,_438,Wc%Q3/PB%_627;}" +head{--webpack-my-app-848:SM/ry/kW/rZ/yg/rE/k2/do/yK/r8/ui/kf/eY/mA/gJ/ol/sZ/KY/c7/AB/Yf/Gw%uc%cP%EP%kB/OH/ag/S4%WW/qi/mI/OQ/AZ/s9/I\\\\$/Wu/ec/mQ/YL/KA%ak/y_/es/mW%kl/iI%Cg/sr/__y/sX/SU/ay/qe%GM%qE%S0/_539,u/_248,_535,or%sZ/cP%_816;}" +`; + +exports[`ConfigTestCases css css-modules exported tests should allow to create css modules: dev 1`] = ` +Object { + "UsedClassName": "./identifiers.module.css-UsedClassName", + "VARS": "--./style.module.css-LOCAL-COLOR ./style.module.css-VARS undefined ./style.module.css-globalVarsUpperCase", + "animation": "./style.module.css-animation", + "animationName": "./style.module.css-animationName", + "class": "./style.module.css-class", + "classInContainer": "./style.module.css-class-in-container", + "classLocalScope": "./style.module.css-class-local-scope", + "cssModuleWithCustomFileExtension": "./style.module.my-css-myCssClass", + "currentWmultiParams": "./style.module.css-local12", + "deepClassInContainer": "./style.module.css-deep-class-in-container", + "displayFlexInSupportsInMediaUpperCase": "./style.module.css-displayFlexInSupportsInMediaUpperCase", + "futureWmultiParams": "./style.module.css-local14", + "global": undefined, + "hasWmultiParams": "./style.module.css-local11", + "ident": "./style.module.css-ident", + "inLocalGlobalScope": "./style.module.css-in-local-global-scope", + "inSupportScope": "./style.module.css-inSupportScope", + "isWmultiParams": "./style.module.css-local8", + "keyframes": "./style.module.css-localkeyframes", + "keyframesUPPERCASE": "./style.module.css-localkeyframesUPPERCASE", + "local": "./style.module.css-local1 ./style.module.css-local2 ./style.module.css-local3 ./style.module.css-local4", + "local2": "./style.module.css-local5 ./style.module.css-local6", + "localkeyframes2UPPPERCASE": "./style.module.css-localkeyframes2UPPPERCASE", + "matchesWmultiParams": "./style.module.css-local9", + "media": "./style.module.css-wideScreenClass", + "mediaInSupports": "./style.module.css-displayFlexInMediaInSupports", + "mediaWithOperator": "./style.module.css-narrowScreenClass", + "mozAnimationName": "./style.module.css-mozAnimationName", + "mozAnyWmultiParams": "./style.module.css-local15", + "myColor": "--./style.module.css-my-color", + "nested": "./style.module.css-nested1 undefined ./style.module.css-nested3", + "notAValidCssModuleExtension": true, + "notWmultiParams": "./style.module.css-local7", + "paddingLg": "./style.module.css-padding-lg", + "paddingSm": "./style.module.css-padding-sm", + "pastWmultiParams": "./style.module.css-local13", + "supports": "./style.module.css-displayGridInSupports", + "supportsInMedia": "./style.module.css-displayFlexInSupportsInMedia", + "supportsWithOperator": "./style.module.css-floatRightInNegativeSupports", + "vars": "--./style.module.css-local-color ./style.module.css-vars undefined ./style.module.css-globalVars", + "webkitAnyWmultiParams": "./style.module.css-local16", + "whereWmultiParams": "./style.module.css-local10", +} +`; + +exports[`ConfigTestCases css css-modules exported tests should allow to create css modules: prod 1`] = ` +Object { + "UsedClassName": "my-app-816-sZ", + "VARS": "--my-app-539-KA my-app-539-YL undefined my-app-539-ak", + "animation": "my-app-539-OH", + "animationName": "my-app-539-es", + "class": "my-app-539-SM", + "classInContainer": "my-app-539-SU", + "classLocalScope": "my-app-539-sX", + "cssModuleWithCustomFileExtension": "my-app-248-u", + "currentWmultiParams": "my-app-539-eY", + "deepClassInContainer": "my-app-539-ay", + "displayFlexInSupportsInMediaUpperCase": "my-app-539-Wu", + "futureWmultiParams": "my-app-539-gJ", + "global": undefined, + "hasWmultiParams": "my-app-539-kf", + "ident": "my-app-539-AB", + "inLocalGlobalScope": "my-app-539-_y", + "inSupportScope": "my-app-539-y_", + "isWmultiParams": "my-app-539-yK", + "keyframes": "my-app-539-Yf", + "keyframesUPPERCASE": "my-app-539-ec", + "local": "my-app-539-ry my-app-539-kW my-app-539-rZ my-app-539-yg", + "local2": "my-app-539-rE my-app-539-k2", + "localkeyframes2UPPPERCASE": "my-app-539-mQ", + "matchesWmultiParams": "my-app-539-r8", + "media": "my-app-539-qi", + "mediaInSupports": "my-app-539-s9", + "mediaWithOperator": "my-app-539-mI", + "mozAnimationName": "my-app-539-kl", + "mozAnyWmultiParams": "my-app-539-ol", + "myColor": "--my-app-539-iI", + "nested": "my-app-539-KY undefined my-app-539-c7", + "notAValidCssModuleExtension": true, + "notWmultiParams": "my-app-539-do", + "paddingLg": "my-app-539-sr", + "paddingSm": "my-app-539-Cg", + "pastWmultiParams": "my-app-539-mA", + "supports": "my-app-539-OQ", + "supportsInMedia": "my-app-539-I$", + "supportsWithOperator": "my-app-539-AZ", + "vars": "--my-app-539-S4 my-app-539-ag undefined my-app-539-WW", + "webkitAnyWmultiParams": "my-app-539-sZ", + "whereWmultiParams": "my-app-539-ui", +} +`; + +exports[`ConfigTestCases css css-modules-broken-keyframes exported tests should allow to create css modules: prod 1`] = ` +Object { + "class": "my-app-539-S", +} +`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to create css modules: dev 1`] = ` +Object { + "UsedClassName": "./identifiers.module.css-UsedClassName", + "VARS": "--./style.module.css-LOCAL-COLOR ./style.module.css-VARS undefined ./style.module.css-globalVarsUpperCase", + "animation": "./style.module.css-animation", + "animationName": "./style.module.css-animationName", + "class": "./style.module.css-class", + "classInContainer": "./style.module.css-class-in-container", + "classLocalScope": "./style.module.css-class-local-scope", + "cssModuleWithCustomFileExtension": "./style.module.my-css-myCssClass", + "currentWmultiParams": "./style.module.css-local12", + "deepClassInContainer": "./style.module.css-deep-class-in-container", + "displayFlexInSupportsInMediaUpperCase": "./style.module.css-displayFlexInSupportsInMediaUpperCase", + "futureWmultiParams": "./style.module.css-local14", + "global": undefined, + "hasWmultiParams": "./style.module.css-local11", + "ident": "./style.module.css-ident", + "inLocalGlobalScope": "./style.module.css-in-local-global-scope", + "inSupportScope": "./style.module.css-inSupportScope", + "isWmultiParams": "./style.module.css-local8", + "keyframes": "./style.module.css-localkeyframes", + "keyframesUPPERCASE": "./style.module.css-localkeyframesUPPERCASE", + "local": "./style.module.css-local1 ./style.module.css-local2 ./style.module.css-local3 ./style.module.css-local4", + "local2": "./style.module.css-local5 ./style.module.css-local6", + "localkeyframes2UPPPERCASE": "./style.module.css-localkeyframes2UPPPERCASE", + "matchesWmultiParams": "./style.module.css-local9", + "media": "./style.module.css-wideScreenClass", + "mediaInSupports": "./style.module.css-displayFlexInMediaInSupports", + "mediaWithOperator": "./style.module.css-narrowScreenClass", + "mozAnimationName": "./style.module.css-mozAnimationName", + "mozAnyWmultiParams": "./style.module.css-local15", + "myColor": "--./style.module.css-my-color", + "nested": "./style.module.css-nested1 undefined ./style.module.css-nested3", + "notAValidCssModuleExtension": true, + "notWmultiParams": "./style.module.css-local7", + "paddingLg": "./style.module.css-padding-lg", + "paddingSm": "./style.module.css-padding-sm", + "pastWmultiParams": "./style.module.css-local13", + "supports": "./style.module.css-displayGridInSupports", + "supportsInMedia": "./style.module.css-displayFlexInSupportsInMedia", + "supportsWithOperator": "./style.module.css-floatRightInNegativeSupports", + "vars": "--./style.module.css-local-color ./style.module.css-vars undefined ./style.module.css-globalVars", + "webkitAnyWmultiParams": "./style.module.css-local16", + "whereWmultiParams": "./style.module.css-local10", +} +`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to create css modules: prod 1`] = ` +Object { + "UsedClassName": "my-app-816-sZ", + "VARS": "--my-app-539-KA my-app-539-YL undefined my-app-539-ak", + "animation": "my-app-539-OH", + "animationName": "my-app-539-es", + "class": "my-app-539-SM", + "classInContainer": "my-app-539-SU", + "classLocalScope": "my-app-539-sX", + "cssModuleWithCustomFileExtension": "my-app-248-u", + "currentWmultiParams": "my-app-539-eY", + "deepClassInContainer": "my-app-539-ay", + "displayFlexInSupportsInMediaUpperCase": "my-app-539-Wu", + "futureWmultiParams": "my-app-539-gJ", + "global": undefined, + "hasWmultiParams": "my-app-539-kf", + "ident": "my-app-539-AB", + "inLocalGlobalScope": "my-app-539-_y", + "inSupportScope": "my-app-539-y_", + "isWmultiParams": "my-app-539-yK", + "keyframes": "my-app-539-Yf", + "keyframesUPPERCASE": "my-app-539-ec", + "local": "my-app-539-ry my-app-539-kW my-app-539-rZ my-app-539-yg", + "local2": "my-app-539-rE my-app-539-k2", + "localkeyframes2UPPPERCASE": "my-app-539-mQ", + "matchesWmultiParams": "my-app-539-r8", + "media": "my-app-539-qi", + "mediaInSupports": "my-app-539-s9", + "mediaWithOperator": "my-app-539-mI", + "mozAnimationName": "my-app-539-kl", + "mozAnyWmultiParams": "my-app-539-ol", + "myColor": "--my-app-539-iI", + "nested": "my-app-539-KY undefined my-app-539-c7", + "notAValidCssModuleExtension": true, + "notWmultiParams": "my-app-539-do", + "paddingLg": "my-app-539-sr", + "paddingSm": "my-app-539-Cg", + "pastWmultiParams": "my-app-539-mA", + "supports": "my-app-539-OQ", + "supportsInMedia": "my-app-539-I$", + "supportsWithOperator": "my-app-539-AZ", + "vars": "--my-app-539-S4 my-app-539-ag undefined my-app-539-WW", + "webkitAnyWmultiParams": "my-app-539-sZ", + "whereWmultiParams": "my-app-539-ui", +} +`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to create css modules: prod 2`] = ` +Object { + "UsedClassName": "my-app-816-sZ", + "VARS": "--my-app-539-KA my-app-539-YL undefined my-app-539-ak", + "animation": "my-app-539-OH", + "animationName": "my-app-539-es", + "class": "my-app-539-SM", + "classInContainer": "my-app-539-SU", + "classLocalScope": "my-app-539-sX", + "cssModuleWithCustomFileExtension": "my-app-248-u", + "currentWmultiParams": "my-app-539-eY", + "deepClassInContainer": "my-app-539-ay", + "displayFlexInSupportsInMediaUpperCase": "my-app-539-Wu", + "futureWmultiParams": "my-app-539-gJ", + "global": undefined, + "hasWmultiParams": "my-app-539-kf", + "ident": "my-app-539-AB", + "inLocalGlobalScope": "my-app-539-_y", + "inSupportScope": "my-app-539-y_", + "isWmultiParams": "my-app-539-yK", + "keyframes": "my-app-539-Yf", + "keyframesUPPERCASE": "my-app-539-ec", + "local": "my-app-539-ry my-app-539-kW my-app-539-rZ my-app-539-yg", + "local2": "my-app-539-rE my-app-539-k2", + "localkeyframes2UPPPERCASE": "my-app-539-mQ", + "matchesWmultiParams": "my-app-539-r8", + "media": "my-app-539-qi", + "mediaInSupports": "my-app-539-s9", + "mediaWithOperator": "my-app-539-mI", + "mozAnimationName": "my-app-539-kl", + "mozAnyWmultiParams": "my-app-539-ol", + "myColor": "--my-app-539-iI", + "nested": "my-app-539-KY undefined my-app-539-c7", + "notAValidCssModuleExtension": true, + "notWmultiParams": "my-app-539-do", + "paddingLg": "my-app-539-sr", + "paddingSm": "my-app-539-Cg", + "pastWmultiParams": "my-app-539-mA", + "supports": "my-app-539-OQ", + "supportsInMedia": "my-app-539-I$", + "supportsWithOperator": "my-app-539-AZ", + "vars": "--my-app-539-S4 my-app-539-ag undefined my-app-539-WW", + "webkitAnyWmultiParams": "my-app-539-sZ", + "whereWmultiParams": "my-app-539-ui", +} +`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: class-dev 1`] = `"./style.module.css-class"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: class-prod 1`] = `"my-app-539-SM"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: class-prod 2`] = `"my-app-539-SM"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: local1-dev 1`] = `"./style.module.css-local1"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: local1-prod 1`] = `"my-app-539-ry"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: local1-prod 2`] = `"my-app-539-ry"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: local2-dev 1`] = `"./style.module.css-local2"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: local2-prod 1`] = `"my-app-539-kW"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: local2-prod 2`] = `"my-app-539-kW"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: local3-dev 1`] = `"./style.module.css-local3"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: local3-prod 1`] = `"my-app-539-rZ"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: local3-prod 2`] = `"my-app-539-rZ"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: local4-dev 1`] = `"./style.module.css-local4"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: local4-prod 1`] = `"my-app-539-yg"`; + +exports[`ConfigTestCases css css-modules-in-node exported tests should allow to import css modules: local4-prod 2`] = `"my-app-539-yg"`; + +exports[`ConfigTestCases css large exported tests should allow to create css modules: dev 1`] = ` +Object { + "placeholder": "my-app-./tailwind.module.css-placeholder-gray-700", +} +`; + +exports[`ConfigTestCases css large exported tests should allow to create css modules: prod 1`] = ` +Object { + "placeholder": "512-UB7V", +} `; exports[`ConfigTestCases css pure-css exported tests should compile 1`] = ` @@ -3505,27 +3788,27 @@ exports[`ConfigTestCases records issue-2991 exported tests should write relative "{ \\"chunks\\": { \\"byName\\": { - \\"main\\": 179 + \\"main\\": 590 }, \\"bySource\\": { - \\"0 main\\": 179 + \\"0 main\\": 590 }, \\"usedIds\\": [ - 179 + 590 ] }, \\"modules\\": { \\"byIdentifier\\": { - \\"./test.js\\": 393, - \\"external node-commonjs \\\\\\"fs\\\\\\"\\": 147, - \\"external node-commonjs \\\\\\"path\\\\\\"\\": 17, - \\"ignored|./.|pkgs/somepackage/foo\\": 802 + \\"./test.js\\": 844, + \\"external node-commonjs \\\\\\"fs\\\\\\"\\": 58, + \\"external node-commonjs \\\\\\"path\\\\\\"\\": 72, + \\"ignored|./.|pkgs/somepackage/foo\\": 128 }, \\"usedIds\\": [ - 17, - 147, - 393, - 802 + 58, + 72, + 128, + 844 ] } }" @@ -3535,31 +3818,31 @@ exports[`ConfigTestCases records issue-7339 exported tests should write relative "{ \\"chunks\\": { \\"byName\\": { - \\"main\\": 179 + \\"main\\": 590 }, \\"bySource\\": { - \\"0 main\\": 179 + \\"0 main\\": 590 }, \\"usedIds\\": [ - 179 + 590 ] }, \\"modules\\": { \\"byIdentifier\\": { - \\"./dependencies/bar.js\\": 379, - \\"./dependencies/foo.js\\": 117, - \\"./dependencies|sync|/^\\\\\\\\.\\\\\\\\/.*$/\\": 412, - \\"./test.js\\": 393, - \\"external node-commonjs \\\\\\"fs\\\\\\"\\": 147, - \\"external node-commonjs \\\\\\"path\\\\\\"\\": 17 + \\"./dependencies/bar.js\\": 664, + \\"./dependencies/foo.js\\": 396, + \\"./dependencies|sync|/^\\\\\\\\.\\\\\\\\/.*$/\\": 660, + \\"./test.js\\": 844, + \\"external node-commonjs \\\\\\"fs\\\\\\"\\": 58, + \\"external node-commonjs \\\\\\"path\\\\\\"\\": 72 }, \\"usedIds\\": [ - 17, - 117, - 147, - 379, - 393, - 412 + 58, + 72, + 396, + 660, + 664, + 844 ] } }" diff --git a/test/__snapshots__/StatsTestCases.basictest.js.snap b/test/__snapshots__/StatsTestCases.basictest.js.snap index f40ca5f634b..221debc9a3d 100644 --- a/test/__snapshots__/StatsTestCases.basictest.js.snap +++ b/test/__snapshots__/StatsTestCases.basictest.js.snap @@ -3,54 +3,54 @@ exports[`StatsTestCases should print correct stats for aggressive-splitting-entry 1`] = ` "fitting: PublicPath: auto - asset fitting-801f5840b67f0f13ee03.js 16.2 KiB [emitted] [immutable] - asset fitting-50595d23e8f97d7ccd2a.js 1.9 KiB [emitted] [immutable] - asset fitting-5bc77880fdc9e2bf09ee.js 1.9 KiB [emitted] [immutable] - asset fitting-72afdc913f6cf884b457.js 1.08 KiB [emitted] [immutable] - Entrypoint main 20 KiB = fitting-50595d23e8f97d7ccd2a.js 1.9 KiB fitting-5bc77880fdc9e2bf09ee.js 1.9 KiB fitting-801f5840b67f0f13ee03.js 16.2 KiB - chunk (runtime: main) fitting-801f5840b67f0f13ee03.js 1.87 KiB (javascript) 8.67 KiB (runtime) [entry] [rendered] + asset fitting-3b78c68321bf412aed86.js 16.1 KiB [emitted] [immutable] + asset fitting-1bdd45b6b0cd79821d9f.js 1.9 KiB [emitted] [immutable] + asset fitting-a683ff01042aa0fe4264.js 1.9 KiB [emitted] [immutable] + asset fitting-92c9ac7e1bce8bcb0401.js 1.08 KiB [emitted] [immutable] + Entrypoint main 20 KiB = fitting-a683ff01042aa0fe4264.js 1.9 KiB fitting-1bdd45b6b0cd79821d9f.js 1.9 KiB fitting-3b78c68321bf412aed86.js 16.1 KiB + chunk (runtime: main) fitting-3b78c68321bf412aed86.js 1.87 KiB (javascript) 8.67 KiB (runtime) [entry] [rendered] > ./index main runtime modules 8.67 KiB 11 modules cacheable modules 1.87 KiB ./e.js 899 bytes [dependent] [built] [code generated] ./f.js 900 bytes [dependent] [built] [code generated] ./index.js 111 bytes [built] [code generated] - chunk (runtime: main) fitting-5bc77880fdc9e2bf09ee.js 1.76 KiB [initial] [rendered] [recorded] aggressive splitted - > ./index main - ./c.js 899 bytes [built] [code generated] - ./d.js 899 bytes [built] [code generated] - chunk (runtime: main) fitting-50595d23e8f97d7ccd2a.js 1.76 KiB [initial] [rendered] [recorded] aggressive splitted + chunk (runtime: main) fitting-a683ff01042aa0fe4264.js 1.76 KiB [initial] [rendered] [recorded] aggressive splitted > ./index main ./a.js 899 bytes [built] [code generated] ./b.js 899 bytes [built] [code generated] - chunk (runtime: main) fitting-72afdc913f6cf884b457.js 916 bytes [rendered] + chunk (runtime: main) fitting-1bdd45b6b0cd79821d9f.js 1.76 KiB [initial] [rendered] [recorded] aggressive splitted + > ./index main + ./c.js 899 bytes [built] [code generated] + ./d.js 899 bytes [built] [code generated] + chunk (runtime: main) fitting-92c9ac7e1bce8bcb0401.js 916 bytes [rendered] > ./g ./index.js 7:0-13 ./g.js 916 bytes [built] [code generated] fitting (webpack x.x.x) compiled successfully in X ms content-change: PublicPath: auto - asset content-change-0b51d1b0fa9b0275258e.js 16.2 KiB [emitted] [immutable] - asset content-change-50595d23e8f97d7ccd2a.js 1.9 KiB [emitted] [immutable] - asset content-change-5bc77880fdc9e2bf09ee.js 1.9 KiB [emitted] [immutable] - asset content-change-72afdc913f6cf884b457.js 1.08 KiB [emitted] [immutable] - Entrypoint main 20 KiB = content-change-50595d23e8f97d7ccd2a.js 1.9 KiB content-change-5bc77880fdc9e2bf09ee.js 1.9 KiB content-change-0b51d1b0fa9b0275258e.js 16.2 KiB - chunk (runtime: main) content-change-0b51d1b0fa9b0275258e.js 1.87 KiB (javascript) 8.68 KiB (runtime) [entry] [rendered] + asset content-change-f6f257a792b670897d94.js 16.2 KiB [emitted] [immutable] + asset content-change-1bdd45b6b0cd79821d9f.js 1.9 KiB [emitted] [immutable] + asset content-change-a683ff01042aa0fe4264.js 1.9 KiB [emitted] [immutable] + asset content-change-92c9ac7e1bce8bcb0401.js 1.08 KiB [emitted] [immutable] + Entrypoint main 20 KiB = content-change-a683ff01042aa0fe4264.js 1.9 KiB content-change-1bdd45b6b0cd79821d9f.js 1.9 KiB content-change-f6f257a792b670897d94.js 16.2 KiB + chunk (runtime: main) content-change-f6f257a792b670897d94.js 1.87 KiB (javascript) 8.68 KiB (runtime) [entry] [rendered] > ./index main runtime modules 8.68 KiB 11 modules cacheable modules 1.87 KiB ./e.js 899 bytes [dependent] [built] [code generated] ./f.js 900 bytes [dependent] [built] [code generated] ./index.js 111 bytes [built] [code generated] - chunk (runtime: main) content-change-5bc77880fdc9e2bf09ee.js 1.76 KiB [initial] [rendered] [recorded] aggressive splitted - > ./index main - ./c.js 899 bytes [built] [code generated] - ./d.js 899 bytes [built] [code generated] - chunk (runtime: main) content-change-50595d23e8f97d7ccd2a.js 1.76 KiB [initial] [rendered] [recorded] aggressive splitted + chunk (runtime: main) content-change-a683ff01042aa0fe4264.js 1.76 KiB [initial] [rendered] [recorded] aggressive splitted > ./index main ./a.js 899 bytes [built] [code generated] ./b.js 899 bytes [built] [code generated] - chunk (runtime: main) content-change-72afdc913f6cf884b457.js 916 bytes [rendered] + chunk (runtime: main) content-change-1bdd45b6b0cd79821d9f.js 1.76 KiB [initial] [rendered] [recorded] aggressive splitted + > ./index main + ./c.js 899 bytes [built] [code generated] + ./d.js 899 bytes [built] [code generated] + chunk (runtime: main) content-change-92c9ac7e1bce8bcb0401.js 916 bytes [rendered] > ./g ./index.js 7:0-13 ./g.js 916 bytes [built] [code generated] content-change (webpack x.x.x) compiled successfully in X ms" @@ -58,68 +58,68 @@ content-change: exports[`StatsTestCases should print correct stats for aggressive-splitting-on-demand 1`] = ` "PublicPath: auto -asset eff9501b36393dee5606.js 11.7 KiB [emitted] [immutable] (name: main) -asset 3fc6535262efa7e4fa3b.js 1.91 KiB [emitted] [immutable] -asset 56815935c535fbc0e462.js 1.91 KiB [emitted] [immutable] -asset 2b8c8882bd4326b27013.js 1.9 KiB [emitted] [immutable] -asset 7fcee6253a8c1f9fd714.js 1.9 KiB [emitted] [immutable] -asset 5bc77880fdc9e2bf09ee.js 1.9 KiB [emitted] [immutable] -asset abdab88d0dc9ea1a41ab.js 1.9 KiB [emitted] [immutable] -asset d0fbb9e0f5d00615a52e.js 1.9 KiB [emitted] [immutable] -asset f79c60cc3faba968a476.js 1.9 KiB [emitted] [immutable] -asset 7294786e49319a98f5af.js 1010 bytes [emitted] [immutable] -asset c5861419d7f3f6ea6c19.js 1010 bytes [emitted] [immutable] -asset f897ac9956540163d002.js 1010 bytes [emitted] [immutable] -Entrypoint main 11.7 KiB = eff9501b36393dee5606.js -chunk (runtime: main) 5bc77880fdc9e2bf09ee.js 1.76 KiB [rendered] [recorded] aggressive splitted - > ./c ./d ./e ./index.js 3:0-30 - ./c.js 899 bytes [built] [code generated] - ./d.js 899 bytes [built] [code generated] -chunk (runtime: main) eff9501b36393dee5606.js (main) 248 bytes (javascript) 6.33 KiB (runtime) [entry] [rendered] - > ./index main - runtime modules 6.33 KiB 7 modules - ./index.js 248 bytes [built] [code generated] -chunk (runtime: main) 3fc6535262efa7e4fa3b.js 1.76 KiB [rendered] - > ./f ./g ./h ./i ./j ./k ./index.js 4:0-51 - ./j.js 901 bytes [built] [code generated] - ./k.js 899 bytes [built] [code generated] -chunk (runtime: main) f897ac9956540163d002.js 899 bytes [rendered] - > ./c ./d ./e ./index.js 3:0-30 - > ./b ./d ./e ./f ./g ./index.js 5:0-44 - ./e.js 899 bytes [built] [code generated] -chunk (runtime: main) 7fcee6253a8c1f9fd714.js 1.76 KiB [rendered] [recorded] aggressive splitted +asset 16ca32384a212bc3b465.js 11.7 KiB [emitted] [immutable] (name: main) +asset 71ad3f62ab9a64895d10.js 1.91 KiB [emitted] [immutable] +asset f9e1f6de2d4ac490beb1.js 1.91 KiB [emitted] [immutable] +asset 6c733908f765f3741821.js 1.9 KiB [emitted] [immutable] +asset 6134764dd7848a594803.js 1.9 KiB [emitted] [immutable] +asset 1bdd45b6b0cd79821d9f.js 1.9 KiB [emitted] [immutable] +asset 8ba565b2a3e2152cd4b5.js 1.9 KiB [emitted] [immutable] +asset bb51a622bc5553a0c0f2.js 1.9 KiB [emitted] [immutable] +asset d1cf17096ddb15afa9cb.js 1.9 KiB [emitted] [immutable] +asset 29dce45a2156f57119f4.js 1010 bytes [emitted] [immutable] +asset c4d308d93346ba777236.js 1010 bytes [emitted] [immutable] +asset 335a14a5066e3135ba0f.js 1010 bytes [emitted] [immutable] +Entrypoint main 11.7 KiB = 16ca32384a212bc3b465.js +chunk (runtime: main) 6134764dd7848a594803.js 1.76 KiB [rendered] [recorded] aggressive splitted > ./b ./d ./e ./f ./g ./h ./i ./j ./k ./index.js 6:0-72 ./i.js 899 bytes [built] [code generated] ./j.js 901 bytes [built] [code generated] -chunk (runtime: main) 56815935c535fbc0e462.js 1.76 KiB [rendered] [recorded] aggressive splitted +chunk (runtime: main) 335a14a5066e3135ba0f.js 899 bytes [rendered] + > ./a ./index.js 1:0-16 + ./a.js 899 bytes [built] [code generated] +chunk (runtime: main) bb51a622bc5553a0c0f2.js 1.76 KiB [rendered] [recorded] aggressive splitted + > ./b ./d ./e ./f ./g ./index.js 5:0-44 > ./b ./d ./e ./f ./g ./h ./i ./j ./k ./index.js 6:0-72 - ./e.js 899 bytes [built] [code generated] - ./h.js 899 bytes [built] [code generated] -chunk (runtime: main) d0fbb9e0f5d00615a52e.js 1.76 KiB [rendered] - > ./b ./c ./index.js 2:0-23 ./b.js 899 bytes [built] [code generated] - ./c.js 899 bytes [built] [code generated] -chunk (runtime: main) f79c60cc3faba968a476.js 1.76 KiB [rendered] [recorded] aggressive splitted - > ./f ./g ./h ./i ./j ./k ./index.js 4:0-51 - ./h.js 899 bytes [built] [code generated] - ./i.js 899 bytes [built] [code generated] -chunk (runtime: main) 2b8c8882bd4326b27013.js 1.76 KiB [rendered] [recorded] aggressive splitted + ./d.js 899 bytes [built] [code generated] +chunk (runtime: main) 6c733908f765f3741821.js 1.76 KiB [rendered] [recorded] aggressive splitted > ./f ./g ./h ./i ./j ./k ./index.js 4:0-51 > ./b ./d ./e ./f ./g ./index.js 5:0-44 > ./b ./d ./e ./f ./g ./h ./i ./j ./k ./index.js 6:0-72 ./f.js 899 bytes [built] [code generated] ./g.js 901 bytes [built] [code generated] -chunk (runtime: main) 7294786e49319a98f5af.js 899 bytes [rendered] +chunk (runtime: main) c4d308d93346ba777236.js 899 bytes [rendered] > ./b ./d ./e ./f ./g ./h ./i ./j ./k ./index.js 6:0-72 ./k.js 899 bytes [built] [code generated] -chunk (runtime: main) abdab88d0dc9ea1a41ab.js 1.76 KiB [rendered] [recorded] aggressive splitted - > ./b ./d ./e ./f ./g ./index.js 5:0-44 - > ./b ./d ./e ./f ./g ./h ./i ./j ./k ./index.js 6:0-72 +chunk (runtime: main) d1cf17096ddb15afa9cb.js 1.76 KiB [rendered] + > ./b ./c ./index.js 2:0-23 ./b.js 899 bytes [built] [code generated] + ./c.js 899 bytes [built] [code generated] +chunk (runtime: main) f9e1f6de2d4ac490beb1.js 1.76 KiB [rendered] [recorded] aggressive splitted + > ./b ./d ./e ./f ./g ./h ./i ./j ./k ./index.js 6:0-72 + ./e.js 899 bytes [built] [code generated] + ./h.js 899 bytes [built] [code generated] +chunk (runtime: main) 1bdd45b6b0cd79821d9f.js 1.76 KiB [rendered] [recorded] aggressive splitted + > ./c ./d ./e ./index.js 3:0-30 + ./c.js 899 bytes [built] [code generated] ./d.js 899 bytes [built] [code generated] -chunk (runtime: main) c5861419d7f3f6ea6c19.js 899 bytes [rendered] - > ./a ./index.js 1:0-16 - ./a.js 899 bytes [built] [code generated] +chunk (runtime: main) 16ca32384a212bc3b465.js (main) 248 bytes (javascript) 6.33 KiB (runtime) [entry] [rendered] + > ./index main + runtime modules 6.33 KiB 7 modules + ./index.js 248 bytes [built] [code generated] +chunk (runtime: main) 71ad3f62ab9a64895d10.js 1.76 KiB [rendered] + > ./f ./g ./h ./i ./j ./k ./index.js 4:0-51 + ./j.js 901 bytes [built] [code generated] + ./k.js 899 bytes [built] [code generated] +chunk (runtime: main) 8ba565b2a3e2152cd4b5.js 1.76 KiB [rendered] [recorded] aggressive splitted + > ./f ./g ./h ./i ./j ./k ./index.js 4:0-51 + ./h.js 899 bytes [built] [code generated] + ./i.js 899 bytes [built] [code generated] +chunk (runtime: main) 29dce45a2156f57119f4.js 899 bytes [rendered] + > ./c ./d ./e ./index.js 3:0-30 + > ./b ./d ./e ./f ./g ./index.js 5:0-44 + ./e.js 899 bytes [built] [code generated] webpack x.x.x compiled successfully in X ms" `; @@ -191,39 +191,35 @@ webpack x.x.x compiled successfully in X ms" `; exports[`StatsTestCases should print correct stats for async-commons-chunk 1`] = ` -"chunk (runtime: main) main.js (main) 515 bytes (javascript) 6.02 KiB (runtime) >{460}< >{847}< >{996}< [entry] [rendered] - > ./ main - runtime modules 6.02 KiB 7 modules - ./index.js 515 bytes [built] [code generated] -chunk (runtime: main) 460.js 21 bytes <{179}> ={847}= [rendered] - > ./index.js 17:1-21:3 - ./c.js 21 bytes [built] [code generated] -chunk (runtime: main) 847.js 21 bytes <{179}> ={460}= ={996}= [rendered] reused as split chunk (cache group: default) +"chunk (runtime: main) 80.js 21 bytes <{590}> ={636}= ={720}= [rendered] reused as split chunk (cache group: default) > ./index.js 17:1-21:3 > ./index.js 2:1-5:3 > ./a ./b ./index.js 9:1-13:3 ./a.js 21 bytes [built] [code generated] -chunk (runtime: main) 996.js 21 bytes <{179}> ={847}= [rendered] +chunk (runtime: main) main.js (main) 515 bytes (javascript) 6.02 KiB (runtime) >{80}< >{636}< >{720}< [entry] [rendered] + > ./ main + runtime modules 6.02 KiB 7 modules + ./index.js 515 bytes [built] [code generated] +chunk (runtime: main) 636.js 21 bytes <{590}> ={80}= [rendered] > ./a ./b ./index.js 9:1-13:3 ./b.js 21 bytes [built] [code generated] +chunk (runtime: main) 720.js 21 bytes <{590}> ={80}= [rendered] + > ./index.js 17:1-21:3 + ./c.js 21 bytes [built] [code generated] webpack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for async-commons-chunk-auto 1`] = ` "disabled: - chunk (runtime: b) disabled/b.js (b) 196 bytes (javascript) 396 bytes (runtime) [entry] [rendered] - > ./b b - dependent modules 80 bytes [dependent] 4 modules - runtime modules 396 bytes 2 modules - ./b.js 116 bytes [built] [code generated] chunk (runtime: a, main) disabled/async-g.js (async-g) 65 bytes [rendered] > ./g ./a.js 6:0-47 dependent modules 20 bytes [dependent] 1 module ./g.js 45 bytes [built] [code generated] - chunk (runtime: main) disabled/main.js (main) 147 bytes (javascript) 6.67 KiB (runtime) [entry] [rendered] - > ./ main - runtime modules 6.67 KiB 9 modules - ./index.js 147 bytes [built] [code generated] + chunk (runtime: c) disabled/c.js (c) 196 bytes (javascript) 396 bytes (runtime) [entry] [rendered] + > ./c c + dependent modules 60 bytes [dependent] 3 modules + runtime modules 396 bytes 2 modules + ./c.js + 1 modules 136 bytes [built] [code generated] chunk (runtime: main) disabled/async-b.js (async-b) 196 bytes [rendered] > ./b ./index.js 2:0-47 dependent modules 80 bytes [dependent] 4 modules @@ -232,76 +228,80 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk-auto > ./c ./index.js 3:0-47 dependent modules 60 bytes [dependent] 3 modules ./c.js + 1 modules 136 bytes [built] [code generated] - chunk (runtime: c) disabled/c.js (c) 196 bytes (javascript) 396 bytes (runtime) [entry] [rendered] - > ./c c + chunk (runtime: main) disabled/async-a.js (async-a) 245 bytes [rendered] + > ./a ./index.js 1:0-47 dependent modules 60 bytes [dependent] 3 modules + ./a.js + 1 modules 185 bytes [built] [code generated] + chunk (runtime: b) disabled/b.js (b) 196 bytes (javascript) 396 bytes (runtime) [entry] [rendered] + > ./b b + dependent modules 80 bytes [dependent] 4 modules runtime modules 396 bytes 2 modules - ./c.js + 1 modules 136 bytes [built] [code generated] + ./b.js 116 bytes [built] [code generated] + chunk (runtime: main) disabled/main.js (main) 147 bytes (javascript) 6.67 KiB (runtime) [entry] [rendered] + > ./ main + runtime modules 6.67 KiB 9 modules + ./index.js 147 bytes [built] [code generated] chunk (runtime: a) disabled/a.js (a) 245 bytes (javascript) 6.61 KiB (runtime) [entry] [rendered] > ./a a runtime modules 6.61 KiB 9 modules dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [built] [code generated] - chunk (runtime: main) disabled/async-a.js (async-a) 245 bytes [rendered] - > ./a ./index.js 1:0-47 - dependent modules 60 bytes [dependent] 3 modules - ./a.js + 1 modules 185 bytes [built] [code generated] disabled (webpack x.x.x) compiled successfully default: - chunk (runtime: b) default/b.js (b) 196 bytes (javascript) 396 bytes (runtime) [entry] [rendered] - > ./b b - dependent modules 80 bytes [dependent] 4 modules - runtime modules 396 bytes 2 modules - ./b.js 116 bytes [built] [code generated] chunk (runtime: a, main) default/async-g.js (async-g) 45 bytes [rendered] > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] - chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 6.68 KiB (runtime) [entry] [rendered] - > ./ main - runtime modules 6.68 KiB 9 modules - ./index.js 147 bytes [built] [code generated] - chunk (runtime: main) default/282.js (id hint: vendors) 20 bytes [rendered] split chunk (cache group: defaultVendors) - > ./a ./index.js 1:0-47 + chunk (runtime: a, main) default/144.js 20 bytes [rendered] split chunk (cache group: default) > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 - ./node_modules/x.js 20 bytes [built] [code generated] + > ./g ./a.js 6:0-47 + ./f.js 20 bytes [built] [code generated] + chunk (runtime: c) default/c.js (c) 196 bytes (javascript) 396 bytes (runtime) [entry] [rendered] + > ./c c + dependent modules 80 bytes [dependent] 4 modules + runtime modules 396 bytes 2 modules + ./c.js 116 bytes [built] [code generated] chunk (runtime: main) default/async-b.js (async-b) 116 bytes [rendered] > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] chunk (runtime: main) default/async-c.js (async-c) 116 bytes [rendered] > ./c ./index.js 3:0-47 ./c.js 116 bytes [built] [code generated] - chunk (runtime: c) default/c.js (c) 196 bytes (javascript) 396 bytes (runtime) [entry] [rendered] - > ./c c + chunk (runtime: main) default/388.js (id hint: vendors) 20 bytes [rendered] split chunk (cache group: defaultVendors) + > ./c ./index.js 3:0-47 + ./node_modules/z.js 20 bytes [built] [code generated] + chunk (runtime: main) default/async-a.js (async-a) 185 bytes [rendered] + > ./a ./index.js 1:0-47 + ./a.js + 1 modules 185 bytes [built] [code generated] + chunk (runtime: main) default/472.js (id hint: vendors) 20 bytes [rendered] split chunk (cache group: defaultVendors) + > ./a ./index.js 1:0-47 + > ./b ./index.js 2:0-47 + > ./c ./index.js 3:0-47 + ./node_modules/x.js 20 bytes [built] [code generated] + chunk (runtime: b) default/b.js (b) 196 bytes (javascript) 396 bytes (runtime) [entry] [rendered] + > ./b b dependent modules 80 bytes [dependent] 4 modules runtime modules 396 bytes 2 modules - ./c.js 116 bytes [built] [code generated] - chunk (runtime: a, main) default/568.js 20 bytes [rendered] split chunk (cache group: default) + ./b.js 116 bytes [built] [code generated] + chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 6.68 KiB (runtime) [entry] [rendered] + > ./ main + runtime modules 6.68 KiB 9 modules + ./index.js 147 bytes [built] [code generated] + chunk (runtime: main) default/616.js (id hint: vendors) 20 bytes [rendered] split chunk (cache group: defaultVendors) + > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 - > ./c ./index.js 3:0-47 - > ./g ./a.js 6:0-47 - ./f.js 20 bytes [built] [code generated] - chunk (runtime: main) default/767.js 20 bytes [rendered] split chunk (cache group: default) + ./node_modules/y.js 20 bytes [built] [code generated] + chunk (runtime: main) default/744.js 20 bytes [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 ./d.js 20 bytes [built] [code generated] - chunk (runtime: main) default/769.js (id hint: vendors) 20 bytes [rendered] split chunk (cache group: defaultVendors) - > ./c ./index.js 3:0-47 - ./node_modules/z.js 20 bytes [built] [code generated] chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 6.67 KiB (runtime) [entry] [rendered] > ./a a runtime modules 6.67 KiB 9 modules dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [built] [code generated] - chunk (runtime: main) default/async-a.js (async-a) 185 bytes [rendered] - > ./a ./index.js 1:0-47 - ./a.js + 1 modules 185 bytes [built] [code generated] - chunk (runtime: main) default/954.js (id hint: vendors) 20 bytes [rendered] split chunk (cache group: defaultVendors) - > ./a ./index.js 1:0-47 - > ./b ./index.js 2:0-47 - ./node_modules/y.js 20 bytes [built] [code generated] default (webpack x.x.x) compiled successfully vendors: @@ -309,19 +309,19 @@ vendors: Entrypoint a 14.5 KiB = vendors/vendors.js 1.04 KiB vendors/a.js 13.5 KiB Entrypoint b 8.17 KiB = vendors/vendors.js 1.04 KiB vendors/b.js 7.13 KiB Entrypoint c 8.17 KiB = vendors/vendors.js 1.04 KiB vendors/c.js 7.13 KiB - chunk (runtime: b) vendors/b.js (b) 156 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] - > ./b b - runtime modules 2.75 KiB 4 modules - dependent modules 40 bytes [dependent] 2 modules - ./b.js 116 bytes [built] [code generated] chunk (runtime: a, main) vendors/async-g.js (async-g) 65 bytes [rendered] > ./g ./a.js 6:0-47 dependent modules 20 bytes [dependent] 1 module ./g.js 45 bytes [built] [code generated] - chunk (runtime: main) vendors/main.js (main) 147 bytes (javascript) 6.67 KiB (runtime) [entry] [rendered] - > ./ main - runtime modules 6.67 KiB 9 modules - ./index.js 147 bytes [built] [code generated] + chunk (runtime: c) vendors/c.js (c) 156 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] + > ./c c + runtime modules 2.75 KiB 4 modules + dependent modules 40 bytes [dependent] 2 modules + ./c.js 116 bytes [built] [code generated] + chunk (runtime: main) vendors/async-b.js (async-b) 196 bytes [rendered] + > ./b ./index.js 2:0-47 + dependent modules 80 bytes [dependent] 4 modules + ./b.js 116 bytes [built] [code generated] chunk (runtime: a, b, c) vendors/vendors.js (vendors) (id hint: vendors) 60 bytes [initial] [rendered] split chunk (cache group: vendors) (name: vendors) > ./a a > ./b b @@ -329,76 +329,77 @@ vendors: ./node_modules/x.js 20 bytes [built] [code generated] ./node_modules/y.js 20 bytes [built] [code generated] ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: main) vendors/async-b.js (async-b) 196 bytes [rendered] - > ./b ./index.js 2:0-47 - dependent modules 80 bytes [dependent] 4 modules - ./b.js 116 bytes [built] [code generated] chunk (runtime: main) vendors/async-c.js (async-c) 196 bytes [rendered] > ./c ./index.js 3:0-47 dependent modules 80 bytes [dependent] 4 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: c) vendors/c.js (c) 156 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] - > ./c c + chunk (runtime: main) vendors/async-a.js (async-a) 245 bytes [rendered] + > ./a ./index.js 1:0-47 + dependent modules 60 bytes [dependent] 3 modules + ./a.js + 1 modules 185 bytes [built] [code generated] + chunk (runtime: b) vendors/b.js (b) 156 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] + > ./b b runtime modules 2.75 KiB 4 modules dependent modules 40 bytes [dependent] 2 modules - ./c.js 116 bytes [built] [code generated] + ./b.js 116 bytes [built] [code generated] + chunk (runtime: main) vendors/main.js (main) 147 bytes (javascript) 6.66 KiB (runtime) [entry] [rendered] + > ./ main + runtime modules 6.66 KiB 9 modules + ./index.js 147 bytes [built] [code generated] chunk (runtime: a) vendors/a.js (a) 205 bytes (javascript) 7.55 KiB (runtime) [entry] [rendered] > ./a a runtime modules 7.55 KiB 10 modules dependent modules 20 bytes [dependent] 1 module ./a.js + 1 modules 185 bytes [built] [code generated] - chunk (runtime: main) vendors/async-a.js (async-a) 245 bytes [rendered] - > ./a ./index.js 1:0-47 - dependent modules 60 bytes [dependent] 3 modules - ./a.js + 1 modules 185 bytes [built] [code generated] vendors (webpack x.x.x) compiled successfully multiple-vendors: - Entrypoint main 11.6 KiB = multiple-vendors/main.js - Entrypoint a 15 KiB = multiple-vendors/libs-x.js 412 bytes multiple-vendors/954.js 412 bytes multiple-vendors/767.js 412 bytes multiple-vendors/390.js 412 bytes multiple-vendors/a.js 13.4 KiB - Entrypoint b 8.13 KiB = multiple-vendors/libs-x.js 412 bytes multiple-vendors/954.js 412 bytes multiple-vendors/767.js 412 bytes multiple-vendors/568.js 412 bytes multiple-vendors/b.js 6.52 KiB - Entrypoint c 8.13 KiB = multiple-vendors/libs-x.js 412 bytes multiple-vendors/769.js 412 bytes multiple-vendors/767.js 412 bytes multiple-vendors/568.js 412 bytes multiple-vendors/c.js 6.52 KiB - chunk (runtime: a, b, c, main) multiple-vendors/libs-x.js (libs-x) (id hint: libs) 20 bytes [initial] [rendered] split chunk (cache group: libs) (name: libs-x) - > ./a ./index.js 1:0-47 + Entrypoint main 11.5 KiB = multiple-vendors/main.js + Entrypoint a 15 KiB = multiple-vendors/libs-x.js 412 bytes multiple-vendors/616.js 412 bytes multiple-vendors/744.js 412 bytes multiple-vendors/928.js 412 bytes multiple-vendors/a.js 13.4 KiB + Entrypoint b 8.13 KiB = multiple-vendors/libs-x.js 412 bytes multiple-vendors/616.js 412 bytes multiple-vendors/744.js 412 bytes multiple-vendors/144.js 412 bytes multiple-vendors/b.js 6.52 KiB + Entrypoint c 8.13 KiB = multiple-vendors/libs-x.js 412 bytes multiple-vendors/388.js 412 bytes multiple-vendors/744.js 412 bytes multiple-vendors/144.js 412 bytes multiple-vendors/c.js 6.52 KiB + chunk (runtime: a, main) multiple-vendors/async-g.js (async-g) 45 bytes [rendered] + > ./g ./a.js 6:0-47 + ./g.js 45 bytes [built] [code generated] + chunk (runtime: a, b, c, main) multiple-vendors/144.js 20 bytes [initial] [rendered] split chunk (cache group: default) > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 - > ./a a + > ./g ./a.js 6:0-47 > ./b b > ./c c - ./node_modules/x.js 20 bytes [built] [code generated] - chunk (runtime: b) multiple-vendors/b.js (b) 116 bytes (javascript) 2.76 KiB (runtime) [entry] [rendered] - > ./b b + ./f.js 20 bytes [built] [code generated] + chunk (runtime: c) multiple-vendors/c.js (c) 116 bytes (javascript) 2.76 KiB (runtime) [entry] [rendered] + > ./c c runtime modules 2.76 KiB 4 modules - ./b.js 116 bytes [built] [code generated] - chunk (runtime: a, main) multiple-vendors/async-g.js (async-g) 45 bytes [rendered] - > ./g ./a.js 6:0-47 - ./g.js 45 bytes [built] [code generated] - chunk (runtime: main) multiple-vendors/main.js (main) 147 bytes (javascript) 6.7 KiB (runtime) [entry] [rendered] - > ./ main - runtime modules 6.7 KiB 9 modules - ./index.js 147 bytes [built] [code generated] + ./c.js 116 bytes [built] [code generated] chunk (runtime: main) multiple-vendors/async-b.js (async-b) 116 bytes [rendered] > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] chunk (runtime: main) multiple-vendors/async-c.js (async-c) 116 bytes [rendered] > ./c ./index.js 3:0-47 ./c.js 116 bytes [built] [code generated] - chunk (runtime: a, main) multiple-vendors/390.js 20 bytes [initial] [rendered] split chunk (cache group: default) - > ./a ./index.js 1:0-47 - > ./a a - ./e.js 20 bytes [built] [code generated] - chunk (runtime: c) multiple-vendors/c.js (c) 116 bytes (javascript) 2.76 KiB (runtime) [entry] [rendered] + chunk (runtime: c, main) multiple-vendors/388.js (id hint: vendors) 20 bytes [initial] [rendered] split chunk (cache group: vendors) + > ./c ./index.js 3:0-47 > ./c c + ./node_modules/z.js 20 bytes [built] [code generated] + chunk (runtime: main) multiple-vendors/async-a.js (async-a) 165 bytes [rendered] + > ./a ./index.js 1:0-47 + ./a.js 165 bytes [built] [code generated] + chunk (runtime: b) multiple-vendors/b.js (b) 116 bytes (javascript) 2.76 KiB (runtime) [entry] [rendered] + > ./b b runtime modules 2.76 KiB 4 modules - ./c.js 116 bytes [built] [code generated] - chunk (runtime: a, b, c, main) multiple-vendors/568.js 20 bytes [initial] [rendered] split chunk (cache group: default) + ./b.js 116 bytes [built] [code generated] + chunk (runtime: main) multiple-vendors/main.js (main) 147 bytes (javascript) 6.7 KiB (runtime) [entry] [rendered] + > ./ main + runtime modules 6.7 KiB 9 modules + ./index.js 147 bytes [built] [code generated] + chunk (runtime: a, b, main) multiple-vendors/616.js (id hint: vendors) 20 bytes [initial] [rendered] split chunk (cache group: vendors) + > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 - > ./c ./index.js 3:0-47 - > ./g ./a.js 6:0-47 + > ./a a > ./b b - > ./c c - ./f.js 20 bytes [built] [code generated] - chunk (runtime: a, b, c, main) multiple-vendors/767.js 20 bytes [initial] [rendered] split chunk (cache group: default) + ./node_modules/y.js 20 bytes [built] [code generated] + chunk (runtime: a, b, c, main) multiple-vendors/744.js 20 bytes [initial] [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 @@ -406,71 +407,79 @@ multiple-vendors: > ./b b > ./c c ./d.js 20 bytes [built] [code generated] - chunk (runtime: c, main) multiple-vendors/769.js (id hint: vendors) 20 bytes [initial] [rendered] split chunk (cache group: vendors) + chunk (runtime: a, main) multiple-vendors/928.js 20 bytes [initial] [rendered] split chunk (cache group: default) + > ./a ./index.js 1:0-47 + > ./a a + ./e.js 20 bytes [built] [code generated] + chunk (runtime: a, b, c, main) multiple-vendors/libs-x.js (libs-x) (id hint: libs) 20 bytes [initial] [rendered] split chunk (cache group: libs) (name: libs-x) + > ./a ./index.js 1:0-47 + > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 + > ./a a + > ./b b > ./c c - ./node_modules/z.js 20 bytes [built] [code generated] + ./node_modules/x.js 20 bytes [built] [code generated] chunk (runtime: a) multiple-vendors/a.js (a) 165 bytes (javascript) 7.6 KiB (runtime) [entry] [rendered] > ./a a runtime modules 7.6 KiB 10 modules ./a.js 165 bytes [built] [code generated] - chunk (runtime: main) multiple-vendors/async-a.js (async-a) 165 bytes [rendered] - > ./a ./index.js 1:0-47 - ./a.js 165 bytes [built] [code generated] - chunk (runtime: a, b, main) multiple-vendors/954.js (id hint: vendors) 20 bytes [initial] [rendered] split chunk (cache group: vendors) - > ./a ./index.js 1:0-47 - > ./b ./index.js 2:0-47 - > ./a a - > ./b b - ./node_modules/y.js 20 bytes [built] [code generated] multiple-vendors (webpack x.x.x) compiled successfully all: Entrypoint main 11.5 KiB = all/main.js - Entrypoint a 15 KiB = all/282.js 412 bytes all/954.js 412 bytes all/767.js 412 bytes all/390.js 412 bytes all/a.js 13.4 KiB - Entrypoint b 8.13 KiB = all/282.js 412 bytes all/954.js 412 bytes all/767.js 412 bytes all/568.js 412 bytes all/b.js 6.52 KiB - Entrypoint c 8.13 KiB = all/282.js 412 bytes all/769.js 412 bytes all/767.js 412 bytes all/568.js 412 bytes all/c.js 6.52 KiB - chunk (runtime: b) all/b.js (b) 116 bytes (javascript) 2.76 KiB (runtime) [entry] [rendered] - > ./b b - runtime modules 2.76 KiB 4 modules - ./b.js 116 bytes [built] [code generated] + Entrypoint a 15 KiB = all/472.js 412 bytes all/616.js 412 bytes all/744.js 412 bytes all/928.js 412 bytes all/a.js 13.4 KiB + Entrypoint b 8.13 KiB = all/472.js 412 bytes all/616.js 412 bytes all/744.js 412 bytes all/144.js 412 bytes all/b.js 6.52 KiB + Entrypoint c 8.13 KiB = all/472.js 412 bytes all/388.js 412 bytes all/744.js 412 bytes all/144.js 412 bytes all/c.js 6.52 KiB chunk (runtime: a, main) all/async-g.js (async-g) 45 bytes [rendered] > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] - chunk (runtime: main) all/main.js (main) 147 bytes (javascript) 6.67 KiB (runtime) [entry] [rendered] - > ./ main - runtime modules 6.67 KiB 9 modules - ./index.js 147 bytes [built] [code generated] - chunk (runtime: a, b, c, main) all/282.js (id hint: vendors) 20 bytes [initial] [rendered] split chunk (cache group: vendors) - > ./a ./index.js 1:0-47 + chunk (runtime: a, b, c, main) all/144.js 20 bytes [initial] [rendered] split chunk (cache group: default) > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 - > ./a a + > ./g ./a.js 6:0-47 > ./b b > ./c c - ./node_modules/x.js 20 bytes [built] [code generated] + ./f.js 20 bytes [built] [code generated] + chunk (runtime: c) all/c.js (c) 116 bytes (javascript) 2.76 KiB (runtime) [entry] [rendered] + > ./c c + runtime modules 2.76 KiB 4 modules + ./c.js 116 bytes [built] [code generated] chunk (runtime: main) all/async-b.js (async-b) 116 bytes [rendered] > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] chunk (runtime: main) all/async-c.js (async-c) 116 bytes [rendered] > ./c ./index.js 3:0-47 ./c.js 116 bytes [built] [code generated] - chunk (runtime: a, main) all/390.js 20 bytes [initial] [rendered] split chunk (cache group: default) + chunk (runtime: c, main) all/388.js (id hint: vendors) 20 bytes [initial] [rendered] split chunk (cache group: vendors) + > ./c ./index.js 3:0-47 + > ./c c + ./node_modules/z.js 20 bytes [built] [code generated] + chunk (runtime: main) all/async-a.js (async-a) 165 bytes [rendered] + > ./a ./index.js 1:0-47 + ./a.js 165 bytes [built] [code generated] + chunk (runtime: a, b, c, main) all/472.js (id hint: vendors) 20 bytes [initial] [rendered] split chunk (cache group: vendors) > ./a ./index.js 1:0-47 + > ./b ./index.js 2:0-47 + > ./c ./index.js 3:0-47 > ./a a - ./e.js 20 bytes [built] [code generated] - chunk (runtime: c) all/c.js (c) 116 bytes (javascript) 2.76 KiB (runtime) [entry] [rendered] + > ./b b > ./c c + ./node_modules/x.js 20 bytes [built] [code generated] + chunk (runtime: b) all/b.js (b) 116 bytes (javascript) 2.76 KiB (runtime) [entry] [rendered] + > ./b b runtime modules 2.76 KiB 4 modules - ./c.js 116 bytes [built] [code generated] - chunk (runtime: a, b, c, main) all/568.js 20 bytes [initial] [rendered] split chunk (cache group: default) + ./b.js 116 bytes [built] [code generated] + chunk (runtime: main) all/main.js (main) 147 bytes (javascript) 6.67 KiB (runtime) [entry] [rendered] + > ./ main + runtime modules 6.67 KiB 9 modules + ./index.js 147 bytes [built] [code generated] + chunk (runtime: a, b, main) all/616.js (id hint: vendors) 20 bytes [initial] [rendered] split chunk (cache group: vendors) + > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 - > ./c ./index.js 3:0-47 - > ./g ./a.js 6:0-47 + > ./a a > ./b b - > ./c c - ./f.js 20 bytes [built] [code generated] - chunk (runtime: a, b, c, main) all/767.js 20 bytes [initial] [rendered] split chunk (cache group: default) + ./node_modules/y.js 20 bytes [built] [code generated] + chunk (runtime: a, b, c, main) all/744.js 20 bytes [initial] [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 @@ -478,23 +487,14 @@ all: > ./b b > ./c c ./d.js 20 bytes [built] [code generated] - chunk (runtime: c, main) all/769.js (id hint: vendors) 20 bytes [initial] [rendered] split chunk (cache group: vendors) - > ./c ./index.js 3:0-47 - > ./c c - ./node_modules/z.js 20 bytes [built] [code generated] + chunk (runtime: a, main) all/928.js 20 bytes [initial] [rendered] split chunk (cache group: default) + > ./a ./index.js 1:0-47 + > ./a a + ./e.js 20 bytes [built] [code generated] chunk (runtime: a) all/a.js (a) 165 bytes (javascript) 7.59 KiB (runtime) [entry] [rendered] > ./a a runtime modules 7.59 KiB 10 modules ./a.js 165 bytes [built] [code generated] - chunk (runtime: main) all/async-a.js (async-a) 165 bytes [rendered] - > ./a ./index.js 1:0-47 - ./a.js 165 bytes [built] [code generated] - chunk (runtime: a, b, main) all/954.js (id hint: vendors) 20 bytes [initial] [rendered] split chunk (cache group: vendors) - > ./a ./index.js 1:0-47 - > ./b ./index.js 2:0-47 - > ./a a - > ./b b - ./node_modules/y.js 20 bytes [built] [code generated] all (webpack x.x.x) compiled successfully" `; @@ -547,10 +547,10 @@ webpack x.x.x compiled successfully in X ms" exports[`StatsTestCases should print correct stats for chunks 1`] = ` "PublicPath: auto asset bundle.js 10.3 KiB [emitted] (name: main) -asset 460.bundle.js 323 bytes [emitted] -asset 524.bundle.js 206 bytes [emitted] -asset 996.bundle.js 138 bytes [emitted] -chunk (runtime: main) bundle.js (main) 73 bytes (javascript) 6.02 KiB (runtime) >{460}< >{996}< [entry] [rendered] +asset 720.bundle.js 323 bytes [emitted] +asset 804.bundle.js 206 bytes [emitted] +asset 636.bundle.js 138 bytes [emitted] +chunk (runtime: main) bundle.js (main) 73 bytes (javascript) 6.02 KiB (runtime) >{636}< >{720}< [entry] [rendered] > ./index main runtime modules 6.02 KiB 7 modules cacheable modules 73 bytes @@ -562,13 +562,20 @@ chunk (runtime: main) bundle.js (main) 73 bytes (javascript) 6.02 KiB (runtime) ./index.js 51 bytes [built] [code generated] entry ./index main X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) -chunk (runtime: main) 460.bundle.js 54 bytes <{179}> >{524}< [rendered] +chunk (runtime: main) 636.bundle.js 22 bytes <{590}> [rendered] + > ./b ./index.js 2:0-16 + ./b.js 22 bytes [built] [code generated] + cjs self exports reference ./b.js 1:0-14 + amd require ./b ./index.js 2:0-16 + X ms -> + X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) +chunk (runtime: main) 720.bundle.js 54 bytes <{590}> >{804}< [rendered] > ./c ./index.js 3:0-16 ./c.js 54 bytes [built] [code generated] amd require ./c ./index.js 3:0-16 X ms -> X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) -chunk (runtime: main) 524.bundle.js 44 bytes <{460}> [rendered] +chunk (runtime: main) 804.bundle.js 44 bytes <{720}> [rendered] > ./c.js 1:0-52 ./d.js 22 bytes [built] [code generated] require.ensure item ./d ./c.js 1:0-52 @@ -580,13 +587,6 @@ chunk (runtime: main) 524.bundle.js 44 bytes <{460}> [rendered] cjs self exports reference ./e.js 1:0-14 X ms -> X ms -> X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) -chunk (runtime: main) 996.bundle.js 22 bytes <{179}> [rendered] - > ./b ./index.js 2:0-16 - ./b.js 22 bytes [built] [code generated] - cjs self exports reference ./b.js 1:0-14 - amd require ./b ./index.js 2:0-16 - X ms -> - X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) webpack x.x.x compiled successfully in X ms" `; @@ -638,14 +638,14 @@ webpack x.x.x compiled successfully in X ms" `; exports[`StatsTestCases should print correct stats for circular-correctness 1`] = ` -"chunk (runtime: main) 128.bundle.js (b) 49 bytes <{179}> <{459}> >{459}< [rendered] +"chunk (runtime: main) 152.bundle.js (c) 98 bytes <{580}> <{996}> >{580}< >{996}< [rendered] + ./module-c.js 98 bytes [built] [code generated] +chunk (runtime: main) 580.bundle.js (b) 49 bytes <{152}> <{590}> >{152}< [rendered] ./module-b.js 49 bytes [built] [code generated] -chunk (runtime: main) bundle.js (main) 98 bytes (javascript) 7.71 KiB (runtime) >{128}< >{786}< [entry] [rendered] +chunk (runtime: main) bundle.js (main) 98 bytes (javascript) 7.71 KiB (runtime) >{580}< >{996}< [entry] [rendered] runtime modules 7.71 KiB 10 modules ./index.js 98 bytes [built] [code generated] -chunk (runtime: main) 459.bundle.js (c) 98 bytes <{128}> <{786}> >{128}< >{786}< [rendered] - ./module-c.js 98 bytes [built] [code generated] -chunk (runtime: main) 786.bundle.js (a) 49 bytes <{179}> <{459}> >{459}< [rendered] +chunk (runtime: main) 996.bundle.js (a) 49 bytes <{152}> <{590}> >{152}< [rendered] ./module-a.js 49 bytes [built] [code generated] webpack x.x.x compiled successfully" `; @@ -678,8 +678,8 @@ webpack x.x.x compiled successfully in X ms" exports[`StatsTestCases should print correct stats for commons-chunk-min-size-0 1`] = ` "asset entry-1.js 5.7 KiB [emitted] (name: entry-1) -asset 429.js 274 bytes [emitted] (id hint: vendor-1) -Entrypoint entry-1 5.97 KiB = 429.js 274 bytes entry-1.js 5.7 KiB +asset 516.js 273 bytes [emitted] (id hint: vendor-1) +Entrypoint entry-1 5.96 KiB = 516.js 273 bytes entry-1.js 5.7 KiB runtime modules 2.45 KiB 3 modules modules by path ./modules/*.js 132 bytes ./modules/a.js 22 bytes [built] [code generated] @@ -694,8 +694,8 @@ webpack x.x.x compiled successfully in X ms" exports[`StatsTestCases should print correct stats for commons-chunk-min-size-Infinity 1`] = ` "asset entry-1.js 5.7 KiB [emitted] (name: entry-1) -asset vendor-1.js 274 bytes [emitted] (name: vendor-1) (id hint: vendor-1) -Entrypoint entry-1 5.97 KiB = vendor-1.js 274 bytes entry-1.js 5.7 KiB +asset vendor-1.js 273 bytes [emitted] (name: vendor-1) (id hint: vendor-1) +Entrypoint entry-1 5.96 KiB = vendor-1.js 273 bytes entry-1.js 5.7 KiB runtime modules 2.45 KiB 3 modules modules by path ./modules/*.js 132 bytes ./modules/a.js 22 bytes [built] [code generated] @@ -709,9 +709,9 @@ webpack x.x.x compiled successfully in X ms" `; exports[`StatsTestCases should print correct stats for commons-plugin-issue-4980 1`] = ` -"asset app.a304ced30e50efdd246d-1.js 6.24 KiB [emitted] [immutable] (name: app) -asset vendor.e8705eba33f92df1cf62-1.js 611 bytes [emitted] [immutable] (name: vendor) (id hint: vendor) -Entrypoint app 6.83 KiB = vendor.e8705eba33f92df1cf62-1.js 611 bytes app.a304ced30e50efdd246d-1.js 6.24 KiB +"asset app.881ddede50a0f4f1a84d-1.js 6.24 KiB [emitted] [immutable] (name: app) +asset vendor.42497005e3eb0e0885c6-1.js 611 bytes [emitted] [immutable] (name: vendor) (id hint: vendor) +Entrypoint app 6.84 KiB = vendor.42497005e3eb0e0885c6-1.js 611 bytes app.881ddede50a0f4f1a84d-1.js 6.24 KiB runtime modules 2.75 KiB 4 modules orphan modules 118 bytes [orphan] 2 modules cacheable modules 272 bytes @@ -719,9 +719,9 @@ cacheable modules 272 bytes ./constants.js 87 bytes [built] [code generated] webpack x.x.x compiled successfully in X ms -asset app.8f403eca7a1e59a7ce89-2.js 6.25 KiB [emitted] [immutable] (name: app) -asset vendor.e8705eba33f92df1cf62-2.js 611 bytes [emitted] [immutable] (name: vendor) (id hint: vendor) -Entrypoint app 6.85 KiB = vendor.e8705eba33f92df1cf62-2.js 611 bytes app.8f403eca7a1e59a7ce89-2.js 6.25 KiB +asset app.9b0e3b5c1a486885d9e3-2.js 6.25 KiB [emitted] [immutable] (name: app) +asset vendor.42497005e3eb0e0885c6-2.js 611 bytes [emitted] [immutable] (name: vendor) (id hint: vendor) +Entrypoint app 6.85 KiB = vendor.42497005e3eb0e0885c6-2.js 611 bytes app.9b0e3b5c1a486885d9e3-2.js 6.25 KiB runtime modules 2.75 KiB 4 modules orphan modules 125 bytes [orphan] 2 modules cacheable modules 279 bytes @@ -751,10 +751,10 @@ exports[`StatsTestCases should print correct stats for concat-and-sideeffects 1` `; exports[`StatsTestCases should print correct stats for context-independence 1`] = ` -"asset main-ecc9d576a3029cd740b4.js 12.8 KiB [emitted] [immutable] (name: main) - sourceMap main-ecc9d576a3029cd740b4.js.map 11.1 KiB [emitted] [dev] (auxiliary name: main) -asset 401-13c47112ce7932f2d2da.js 455 bytes [emitted] [immutable] - sourceMap 401-13c47112ce7932f2d2da.js.map 347 bytes [emitted] [dev] +"asset main-aad85b6637f75e68879b.js 12.8 KiB [emitted] [immutable] (name: main) + sourceMap main-aad85b6637f75e68879b.js.map 11.1 KiB [emitted] [dev] (auxiliary name: main) +asset 792-7da7e525de513668b46d.js 455 bytes [emitted] [immutable] + sourceMap 792-7da7e525de513668b46d.js.map 347 bytes [emitted] [dev] runtime modules 6.61 KiB 9 modules orphan modules 19 bytes [orphan] 1 module built modules 500 bytes [built] @@ -767,10 +767,10 @@ built modules 500 bytes [built] ./a/cc/b.js (in my-layer) 18 bytes [optional] [built] [code generated] webpack x.x.x compiled successfully in X ms -asset main-ecc9d576a3029cd740b4.js 12.8 KiB [emitted] [immutable] (name: main) - sourceMap main-ecc9d576a3029cd740b4.js.map 11.1 KiB [emitted] [dev] (auxiliary name: main) -asset 401-13c47112ce7932f2d2da.js 455 bytes [emitted] [immutable] - sourceMap 401-13c47112ce7932f2d2da.js.map 347 bytes [emitted] [dev] +asset main-aad85b6637f75e68879b.js 12.8 KiB [emitted] [immutable] (name: main) + sourceMap main-aad85b6637f75e68879b.js.map 11.1 KiB [emitted] [dev] (auxiliary name: main) +asset 792-7da7e525de513668b46d.js 455 bytes [emitted] [immutable] + sourceMap 792-7da7e525de513668b46d.js.map 347 bytes [emitted] [dev] runtime modules 6.61 KiB 9 modules orphan modules 19 bytes [orphan] 1 module built modules 500 bytes [built] @@ -783,8 +783,8 @@ built modules 500 bytes [built] ./b/cc/b.js (in my-layer) 18 bytes [optional] [built] [code generated] webpack x.x.x compiled successfully in X ms -asset main-3758721949997d4d6c27.js 14.9 KiB [emitted] [immutable] (name: main) -asset 401-b6ce7fcc3598f30709fb.js 1.51 KiB [emitted] [immutable] +asset main-d63a8ae46492b244e5ac.js 14.9 KiB [emitted] [immutable] (name: main) +asset 792-a8053be35470e98e3013.js 1.51 KiB [emitted] [immutable] runtime modules 6.61 KiB 9 modules orphan modules 19 bytes [orphan] 1 module built modules 500 bytes [built] @@ -797,8 +797,8 @@ built modules 500 bytes [built] ./a/cc/b.js (in my-layer) 18 bytes [optional] [built] [code generated] webpack x.x.x compiled successfully in X ms -asset main-3758721949997d4d6c27.js 14.9 KiB [emitted] [immutable] (name: main) -asset 401-b6ce7fcc3598f30709fb.js 1.51 KiB [emitted] [immutable] +asset main-d63a8ae46492b244e5ac.js 14.9 KiB [emitted] [immutable] (name: main) +asset 792-a8053be35470e98e3013.js 1.51 KiB [emitted] [immutable] runtime modules 6.61 KiB 9 modules orphan modules 19 bytes [orphan] 1 module built modules 500 bytes [built] @@ -811,8 +811,8 @@ built modules 500 bytes [built] ./b/cc/b.js (in my-layer) 18 bytes [optional] [built] [code generated] webpack x.x.x compiled successfully in X ms -asset main-5863fe93a8f1642e8b5f.js 13.8 KiB [emitted] [immutable] (name: main) -asset 401-663e81b0f603cec214a5.js 1.01 KiB [emitted] [immutable] +asset main-0db27f873118aeb76b22.js 13.8 KiB [emitted] [immutable] (name: main) +asset 792-0ad33733a0e2cc02288f.js 1.01 KiB [emitted] [immutable] runtime modules 6.61 KiB 9 modules orphan modules 19 bytes [orphan] 1 module built modules 500 bytes [built] @@ -825,8 +825,8 @@ built modules 500 bytes [built] ./a/cc/b.js (in my-layer) 18 bytes [optional] [built] [code generated] webpack x.x.x compiled successfully in X ms -asset main-5863fe93a8f1642e8b5f.js 13.8 KiB [emitted] [immutable] (name: main) -asset 401-663e81b0f603cec214a5.js 1.01 KiB [emitted] [immutable] +asset main-0db27f873118aeb76b22.js 13.8 KiB [emitted] [immutable] (name: main) +asset 792-0ad33733a0e2cc02288f.js 1.01 KiB [emitted] [immutable] runtime modules 6.61 KiB 9 modules orphan modules 19 bytes [orphan] 1 module built modules 500 bytes [built] @@ -841,7 +841,7 @@ webpack x.x.x compiled successfully in X ms" `; exports[`StatsTestCases should print correct stats for custom-terser 1`] = ` -"asset bundle.js 586 bytes [emitted] [minimized] (name: main) +"asset bundle.js 584 bytes [emitted] [minimized] (name: main) ./index.js 128 bytes [built] [code generated] [no exports used] ./a.js 49 bytes [built] [code generated] @@ -1040,8 +1040,8 @@ webpack x.x.x compiled with 2 errors in X ms" exports[`StatsTestCases should print correct stats for entry-filename 1`] = ` "PublicPath: auto -asset a.js 1.4 KiB [emitted] (name: a) asset c.js 1.4 KiB [emitted] (name: b) +asset a.js 1.4 KiB [emitted] (name: a) chunk (runtime: b) c.js (b) 22 bytes [entry] [rendered] > ./b.js b ./b.js 22 bytes [built] [code generated] @@ -1181,22 +1181,22 @@ webpack x.x.x compiled successfully in X ms" `; exports[`StatsTestCases should print correct stats for graph-correctness-entries 1`] = ` -"chunk (runtime: e1, e2) b.js (b) 49 bytes <{786}> >{459}< [rendered] - ./module-b.js 49 bytes [built] [code generated] - import() ./module-b ./module-a.js 1:0-47 -chunk (runtime: e1) e1.js (e1) 49 bytes (javascript) 7.73 KiB (runtime) >{786}< [entry] [rendered] +"chunk (runtime: e2) e2.js (e2) 49 bytes (javascript) 7.73 KiB (runtime) >{152}< [entry] [rendered] runtime modules 7.73 KiB 10 modules - ./e1.js 49 bytes [built] [code generated] - entry ./e1 e1 -chunk (runtime: e1, e2) c.js (c) 49 bytes <{128}> <{621}> >{786}< [rendered] + ./e2.js 49 bytes [built] [code generated] + entry ./e2 e2 +chunk (runtime: e1, e2) c.js (c) 49 bytes <{128}> <{580}> >{996}< [rendered] ./module-c.js 49 bytes [built] [code generated] import() ./module-c ./e2.js 1:0-47 import() ./module-c ./module-b.js 1:0-47 -chunk (runtime: e2) e2.js (e2) 49 bytes (javascript) 7.73 KiB (runtime) >{459}< [entry] [rendered] +chunk (runtime: e1) e1.js (e1) 49 bytes (javascript) 7.73 KiB (runtime) >{996}< [entry] [rendered] runtime modules 7.73 KiB 10 modules - ./e2.js 49 bytes [built] [code generated] - entry ./e2 e2 -chunk (runtime: e1, e2) a.js (a) 49 bytes <{257}> <{459}> >{128}< [rendered] + ./e1.js 49 bytes [built] [code generated] + entry ./e1 e1 +chunk (runtime: e1, e2) b.js (b) 49 bytes <{996}> >{152}< [rendered] + ./module-b.js 49 bytes [built] [code generated] + import() ./module-b ./module-a.js 1:0-47 +chunk (runtime: e1, e2) a.js (a) 49 bytes <{152}> <{320}> >{580}< [rendered] ./module-a.js 49 bytes [built] [code generated] import() ./module-a ./e1.js 1:0-47 import() ./module-a ./module-c.js 1:0-47 @@ -1204,38 +1204,38 @@ webpack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for graph-correctness-modules 1`] = ` -"chunk (runtime: e1, e2) b.js (b) 179 bytes <{786}> >{459}< [rendered] - ./module-b.js 179 bytes [built] [code generated] - import() ./module-b ./module-a.js 1:0-47 -chunk (runtime: e1) e1.js (e1) 119 bytes (javascript) 8 KiB (runtime) >{786}< >{892}< [entry] [rendered] +"chunk (runtime: e2) e2.js (e2) 119 bytes (javascript) 8 KiB (runtime) >{152}< >{460}< [entry] [rendered] runtime modules 8 KiB 11 modules cacheable modules 119 bytes - ./e1.js 70 bytes [built] [code generated] - entry ./e1 e1 + ./e2.js 70 bytes [built] [code generated] + entry ./e2 e2 ./module-x.js 49 bytes [dependent] [built] [code generated] harmony side effect evaluation ./module-x ./e1.js 1:0-20 harmony side effect evaluation ./module-x ./e2.js 1:0-20 import() ./module-x ./module-b.js 2:0-20 -chunk (runtime: e1, e2) c.js (c) 49 bytes <{128}> <{621}> >{786}< [rendered] +chunk (runtime: e1, e2) c.js (c) 49 bytes <{128}> <{580}> >{996}< [rendered] ./module-c.js 49 bytes [built] [code generated] import() ./module-c ./e2.js 2:0-47 import() ./module-c ./module-b.js 1:0-47 -chunk (runtime: e2) e2.js (e2) 119 bytes (javascript) 8 KiB (runtime) >{459}< >{892}< [entry] [rendered] +chunk (runtime: e1) e1.js (e1) 119 bytes (javascript) 8 KiB (runtime) >{460}< >{996}< [entry] [rendered] runtime modules 8 KiB 11 modules cacheable modules 119 bytes - ./e2.js 70 bytes [built] [code generated] - entry ./e2 e2 + ./e1.js 70 bytes [built] [code generated] + entry ./e1 e1 ./module-x.js 49 bytes [dependent] [built] [code generated] harmony side effect evaluation ./module-x ./e1.js 1:0-20 harmony side effect evaluation ./module-x ./e2.js 1:0-20 import() ./module-x ./module-b.js 2:0-20 -chunk (runtime: e1, e2) a.js (a) 49 bytes <{257}> <{459}> >{128}< [rendered] +chunk (runtime: e1, e2) y.js (y) 1 bytes <{128}> <{320}> [rendered] + ./module-y.js 1 bytes [built] [code generated] + import() ./module-y ./module-x.js 1:0-47 +chunk (runtime: e1, e2) b.js (b) 179 bytes <{996}> >{152}< [rendered] + ./module-b.js 179 bytes [built] [code generated] + import() ./module-b ./module-a.js 1:0-47 +chunk (runtime: e1, e2) a.js (a) 49 bytes <{152}> <{320}> >{580}< [rendered] ./module-a.js 49 bytes [built] [code generated] import() ./module-a ./e1.js 2:0-47 import() ./module-a ./module-c.js 1:0-47 -chunk (runtime: e1, e2) y.js (y) 1 bytes <{257}> <{621}> [rendered] - ./module-y.js 1 bytes [built] [code generated] - import() ./module-y ./module-x.js 1:0-47 webpack x.x.x compiled successfully" `; @@ -1274,7 +1274,7 @@ chunk (runtime: main) trees.js (trees) 215 bytes [rendered] `; exports[`StatsTestCases should print correct stats for ignore-warnings 1`] = ` -"asset main.js 989 bytes [emitted] (name: main) +"asset main.js 1000 bytes [emitted] (name: main) orphan modules 617 bytes [orphan] 9 modules ./index.js + 9 modules 790 bytes [built] [code generated] @@ -1296,9 +1296,9 @@ asset 22c24a3b26d46118dc06.js 809 bytes [emitted] [immutable]" exports[`StatsTestCases should print correct stats for import-context-filter 1`] = ` "asset entry.js 12 KiB [emitted] (name: entry) -asset 398.js 482 bytes [emitted] -asset 544.js 482 bytes [emitted] -asset 718.js 482 bytes [emitted] +asset 576.js 482 bytes [emitted] +asset 835.js 482 bytes [emitted] +asset 30.js 480 bytes [emitted] runtime modules 6.58 KiB 9 modules built modules 724 bytes [built] modules by path ./templates/*.js 114 bytes @@ -1312,7 +1312,7 @@ webpack x.x.x compiled successfully in X ms" exports[`StatsTestCases should print correct stats for import-weak 1`] = ` "asset entry.js 13.1 KiB [emitted] (name: entry) -asset 836.js 138 bytes [emitted] +asset 979.js 138 bytes [emitted] runtime modules 7.7 KiB 10 modules orphan modules 37 bytes [orphan] 1 module cacheable modules 142 bytes @@ -1323,7 +1323,7 @@ webpack x.x.x compiled successfully in X ms" exports[`StatsTestCases should print correct stats for import-weak-parser-option 1`] = ` "asset entry.js 13.1 KiB [emitted] (name: entry) -asset 836.js 138 bytes [emitted] +asset 979.js 138 bytes [emitted] runtime modules 7.7 KiB 10 modules orphan modules 37 bytes [orphan] 1 module cacheable modules 116 bytes @@ -1395,7 +1395,7 @@ webpack x.x.x compiled successfully in X ms" exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 1`] = ` "1 chunks: asset bundle1.js 4.85 KiB [emitted] (name: main) - chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.77 KiB (runtime) <{179}> >{179}< [entry] [rendered] + chunk (runtime: main) bundle1.js (main) 219 bytes (javascript) 1.77 KiB (runtime) <{590}> >{590}< [entry] [rendered] runtime modules 1.77 KiB 4 modules cacheable modules 219 bytes ./a.js 22 bytes [dependent] [built] [code generated] @@ -1408,49 +1408,49 @@ exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 2 chunks: asset bundle2.js 12.6 KiB [emitted] (name: main) - asset 459.bundle2.js 664 bytes [emitted] (name: c) - chunk (runtime: main) bundle2.js (main) 101 bytes (javascript) 7.71 KiB (runtime) >{459}< [entry] [rendered] - runtime modules 7.71 KiB 10 modules - ./index.js 101 bytes [built] [code generated] - chunk (runtime: main) 459.bundle2.js (c) 118 bytes <{179}> <{459}> >{459}< [rendered] + asset 152.bundle2.js 663 bytes [emitted] (name: c) + chunk (runtime: main) 152.bundle2.js (c) 118 bytes <{152}> <{590}> >{152}< [rendered] dependent modules 44 bytes [dependent] ./d.js 22 bytes [dependent] [built] [code generated] ./e.js 22 bytes [dependent] [built] [code generated] ./a.js 22 bytes [built] [code generated] ./b.js 22 bytes [built] [code generated] ./c.js 30 bytes [built] [code generated] + chunk (runtime: main) bundle2.js (main) 101 bytes (javascript) 7.71 KiB (runtime) >{152}< [entry] [rendered] + runtime modules 7.71 KiB 10 modules + ./index.js 101 bytes [built] [code generated] 2 chunks (webpack x.x.x) compiled successfully in X ms 3 chunks: asset bundle3.js 12.6 KiB [emitted] (name: main) - asset 459.bundle3.js 528 bytes [emitted] (name: c) - asset 524.bundle3.js 206 bytes [emitted] - chunk (runtime: main) bundle3.js (main) 101 bytes (javascript) 7.71 KiB (runtime) >{459}< [entry] [rendered] - runtime modules 7.71 KiB 10 modules - ./index.js 101 bytes [built] [code generated] - chunk (runtime: main) 459.bundle3.js (c) 74 bytes <{179}> >{524}< [rendered] + asset 152.bundle3.js 527 bytes [emitted] (name: c) + asset 804.bundle3.js 206 bytes [emitted] + chunk (runtime: main) 152.bundle3.js (c) 74 bytes <{590}> >{804}< [rendered] ./a.js 22 bytes [built] [code generated] ./b.js 22 bytes [built] [code generated] ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) 524.bundle3.js 44 bytes <{459}> [rendered] + chunk (runtime: main) bundle3.js (main) 101 bytes (javascript) 7.71 KiB (runtime) >{152}< [entry] [rendered] + runtime modules 7.71 KiB 10 modules + ./index.js 101 bytes [built] [code generated] + chunk (runtime: main) 804.bundle3.js 44 bytes <{152}> [rendered] ./d.js 22 bytes [built] [code generated] ./e.js 22 bytes [built] [code generated] 3 chunks (webpack x.x.x) compiled successfully in X ms 4 chunks: asset bundle4.js 12.6 KiB [emitted] (name: main) - asset 459.bundle4.js 392 bytes [emitted] (name: c) - asset 394.bundle4.js 206 bytes [emitted] - asset 524.bundle4.js 206 bytes [emitted] - chunk (runtime: main) bundle4.js (main) 101 bytes (javascript) 7.71 KiB (runtime) >{394}< >{459}< [entry] [rendered] - runtime modules 7.71 KiB 10 modules - ./index.js 101 bytes [built] [code generated] - chunk (runtime: main) 394.bundle4.js 44 bytes <{179}> [rendered] + asset 152.bundle4.js 392 bytes [emitted] (name: c) + asset 804.bundle4.js 206 bytes [emitted] + asset 272.bundle4.js 205 bytes [emitted] + chunk (runtime: main) 152.bundle4.js (c) 30 bytes <{590}> >{804}< [rendered] + ./c.js 30 bytes [built] [code generated] + chunk (runtime: main) 272.bundle4.js 44 bytes <{590}> [rendered] ./a.js 22 bytes [built] [code generated] ./b.js 22 bytes [built] [code generated] - chunk (runtime: main) 459.bundle4.js (c) 30 bytes <{179}> >{524}< [rendered] - ./c.js 30 bytes [built] [code generated] - chunk (runtime: main) 524.bundle4.js 44 bytes <{459}> [rendered] + chunk (runtime: main) bundle4.js (main) 101 bytes (javascript) 7.71 KiB (runtime) >{152}< >{272}< [entry] [rendered] + runtime modules 7.71 KiB 10 modules + ./index.js 101 bytes [built] [code generated] + chunk (runtime: main) 804.bundle4.js 44 bytes <{152}> [rendered] ./d.js 22 bytes [built] [code generated] ./e.js 22 bytes [built] [code generated] 4 chunks (webpack x.x.x) compiled successfully in X ms" @@ -1633,45 +1633,45 @@ exports[`StatsTestCases should print correct stats for module-deduplication 1`] "asset e1.js 12.2 KiB [emitted] (name: e1) asset e2.js 12.2 KiB [emitted] (name: e2) asset e3.js 12.2 KiB [emitted] (name: e3) -asset 172.js 856 bytes [emitted] -asset 326.js 856 bytes [emitted] -asset 923.js 856 bytes [emitted] -asset 114.js 524 bytes [emitted] -asset 593.js 524 bytes [emitted] -asset 716.js 524 bytes [emitted] -chunk (runtime: e1) 114.js 61 bytes [rendered] - ./async1.js 61 bytes [built] [code generated] -chunk (runtime: e3) e3.js (e3) 249 bytes (javascript) 6.58 KiB (runtime) [entry] [rendered] +asset 192.js 856 bytes [emitted] +asset 512.js 856 bytes [emitted] +asset 843.js 856 bytes [emitted] +asset 132.js 524 bytes [emitted] +asset 224.js 524 bytes [emitted] +asset 572.js 524 bytes [emitted] +chunk (runtime: e2) e2.js (e2) 249 bytes (javascript) 6.58 KiB (runtime) [entry] [rendered] runtime modules 6.58 KiB 9 modules cacheable modules 249 bytes ./b.js 20 bytes [dependent] [built] [code generated] - ./e3.js + 2 modules 209 bytes [built] [code generated] - ./h.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e1, e3) 172.js 81 bytes [rendered] + ./e2.js + 2 modules 209 bytes [built] [code generated] + ./f.js 20 bytes [dependent] [built] [code generated] +chunk (runtime: e3) 132.js 61 bytes [rendered] + ./async3.js 61 bytes [built] [code generated] +chunk (runtime: e2, e3) 192.js 81 bytes [rendered] + ./async1.js 61 bytes [built] [code generated] + ./d.js 20 bytes [dependent] [built] [code generated] +chunk (runtime: e2) 224.js 61 bytes [rendered] ./async2.js 61 bytes [built] [code generated] - ./f.js 20 bytes [dependent] [built] [code generated] chunk (runtime: e1) e1.js (e1) 249 bytes (javascript) 6.58 KiB (runtime) [entry] [rendered] runtime modules 6.58 KiB 9 modules cacheable modules 249 bytes ./b.js 20 bytes [dependent] [built] [code generated] ./d.js 20 bytes [dependent] [built] [code generated] ./e1.js + 2 modules 209 bytes [built] [code generated] -chunk (runtime: e1, e2) 326.js 81 bytes [rendered] +chunk (runtime: e1, e2) 512.js 81 bytes [rendered] ./async3.js 61 bytes [built] [code generated] ./h.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e3) 593.js 61 bytes [rendered] - ./async3.js 61 bytes [built] [code generated] -chunk (runtime: e2) e2.js (e2) 249 bytes (javascript) 6.58 KiB (runtime) [entry] [rendered] +chunk (runtime: e1) 572.js 61 bytes [rendered] + ./async1.js 61 bytes [built] [code generated] +chunk (runtime: e1, e3) 843.js 81 bytes [rendered] + ./async2.js 61 bytes [built] [code generated] + ./f.js 20 bytes [dependent] [built] [code generated] +chunk (runtime: e3) e3.js (e3) 249 bytes (javascript) 6.58 KiB (runtime) [entry] [rendered] runtime modules 6.58 KiB 9 modules cacheable modules 249 bytes ./b.js 20 bytes [dependent] [built] [code generated] - ./e2.js + 2 modules 209 bytes [built] [code generated] - ./f.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e2) 716.js 61 bytes [rendered] - ./async2.js 61 bytes [built] [code generated] -chunk (runtime: e2, e3) 923.js 81 bytes [rendered] - ./async1.js 61 bytes [built] [code generated] - ./d.js 20 bytes [dependent] [built] [code generated] + ./e3.js + 2 modules 209 bytes [built] [code generated] + ./h.js 20 bytes [dependent] [built] [code generated] webpack x.x.x compiled successfully" `; @@ -1679,42 +1679,42 @@ exports[`StatsTestCases should print correct stats for module-deduplication-name "asset e1.js 12.1 KiB [emitted] (name: e1) asset e2.js 12.1 KiB [emitted] (name: e2) asset e3.js 12.1 KiB [emitted] (name: e3) -asset async1.js 962 bytes [emitted] (name: async1) -asset async2.js 962 bytes [emitted] (name: async2) -asset async3.js 962 bytes [emitted] (name: async3) -chunk (runtime: e3) e3.js (e3) 242 bytes (javascript) 6.63 KiB (runtime) [entry] [rendered] +asset async1.js 961 bytes [emitted] (name: async1) +asset async3.js 961 bytes [emitted] (name: async3) +asset async2.js 960 bytes [emitted] (name: async2) +chunk (runtime: e1, e2, e3) async3.js (async3) 135 bytes [rendered] + ./async3.js 115 bytes [built] [code generated] + ./h.js 20 bytes [dependent] [built] [code generated] +chunk (runtime: e1, e2, e3) async2.js (async2) 135 bytes [rendered] + ./async2.js 115 bytes [built] [code generated] + ./f.js 20 bytes [dependent] [built] [code generated] +chunk (runtime: e2) e2.js (e2) 242 bytes (javascript) 6.63 KiB (runtime) [entry] [rendered] runtime modules 6.63 KiB 9 modules cacheable modules 242 bytes ./b.js 20 bytes [dependent] [built] [code generated] - ./e3.js + 2 modules 202 bytes [built] [code generated] - ./h.js 20 bytes [dependent] [built] [code generated] + ./e2.js + 2 modules 202 bytes [built] [code generated] + ./f.js 20 bytes [dependent] [built] [code generated] chunk (runtime: e1) e1.js (e1) 242 bytes (javascript) 6.63 KiB (runtime) [entry] [rendered] runtime modules 6.63 KiB 9 modules cacheable modules 242 bytes ./b.js 20 bytes [dependent] [built] [code generated] ./d.js 20 bytes [dependent] [built] [code generated] ./e1.js + 2 modules 202 bytes [built] [code generated] -chunk (runtime: e1, e2, e3) async1.js (async1) 135 bytes [rendered] - ./async1.js 115 bytes [built] [code generated] - ./d.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e1, e2, e3) async3.js (async3) 135 bytes [rendered] - ./async3.js 115 bytes [built] [code generated] - ./h.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e2) e2.js (e2) 242 bytes (javascript) 6.63 KiB (runtime) [entry] [rendered] +chunk (runtime: e3) e3.js (e3) 242 bytes (javascript) 6.63 KiB (runtime) [entry] [rendered] runtime modules 6.63 KiB 9 modules cacheable modules 242 bytes ./b.js 20 bytes [dependent] [built] [code generated] - ./e2.js + 2 modules 202 bytes [built] [code generated] - ./f.js 20 bytes [dependent] [built] [code generated] -chunk (runtime: e1, e2, e3) async2.js (async2) 135 bytes [rendered] - ./async2.js 115 bytes [built] [code generated] - ./f.js 20 bytes [dependent] [built] [code generated] + ./e3.js + 2 modules 202 bytes [built] [code generated] + ./h.js 20 bytes [dependent] [built] [code generated] +chunk (runtime: e1, e2, e3) async1.js (async1) 135 bytes [rendered] + ./async1.js 115 bytes [built] [code generated] + ./d.js 20 bytes [dependent] [built] [code generated] webpack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for module-federation-custom-exposed-module-name 1`] = ` "asset container_bundle.js 12 KiB [emitted] (name: container) -asset custom-entry_bundle.js 414 bytes [emitted] (name: custom-entry) +asset custom-entry_bundle.js 413 bytes [emitted] (name: custom-entry) asset main_bundle.js 84 bytes [emitted] (name: main) runtime modules 6.6 KiB 9 modules built modules 82 bytes [built] @@ -1814,57 +1814,57 @@ webpack x.x.x compiled with 2 errors in X ms" exports[`StatsTestCases should print correct stats for named-chunk-groups 1`] = ` "Chunk Group main 11.7 KiB = a-main.js -Chunk Group async-a 1.07 KiB = a-52.js 257 bytes a-async-a.js 836 bytes -Chunk Group async-b 1.07 KiB = a-52.js 257 bytes a-async-b.js 836 bytes +Chunk Group async-a 1.07 KiB = a-164.js 259 bytes a-async-a.js 836 bytes +Chunk Group async-b 1.07 KiB = a-164.js 259 bytes a-async-b.js 837 bytes Chunk Group async-c 1.45 KiB = a-vendors.js 740 bytes a-async-c.js 741 bytes -chunk (runtime: main) a-52.js 149 bytes [rendered] split chunk (cache group: default) +chunk (runtime: main) a-164.js 149 bytes [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 ./shared.js 149 bytes [built] [code generated] -chunk (runtime: main) a-main.js (main) 146 bytes (javascript) 6.92 KiB (runtime) [entry] [rendered] - > ./ main - runtime modules 6.92 KiB 10 modules - ./index.js 146 bytes [built] [code generated] +chunk (runtime: main) a-async-b.js (async-b) 175 bytes [rendered] + > ./b ./index.js 2:0-47 + ./b.js 175 bytes [built] [code generated] chunk (runtime: main) a-vendors.js (vendors) (id hint: vendors) 40 bytes [rendered] split chunk (cache group: vendors) (name: vendors) > ./c ./index.js 3:0-47 ./node_modules/x.js 20 bytes [built] [code generated] ./node_modules/y.js 20 bytes [built] [code generated] -chunk (runtime: main) a-async-b.js (async-b) 175 bytes [rendered] - > ./b ./index.js 2:0-47 - ./b.js 175 bytes [built] [code generated] chunk (runtime: main) a-async-c.js (async-c) 67 bytes [rendered] > ./c ./index.js 3:0-47 ./c.js 67 bytes [built] [code generated] chunk (runtime: main) a-async-a.js (async-a) 175 bytes [rendered] > ./a ./index.js 1:0-47 ./a.js 175 bytes [built] [code generated] +chunk (runtime: main) a-main.js (main) 146 bytes (javascript) 6.92 KiB (runtime) [entry] [rendered] + > ./ main + runtime modules 6.92 KiB 10 modules + ./index.js 146 bytes [built] [code generated] webpack x.x.x compiled successfully Entrypoint main 11.7 KiB = b-main.js -Chunk Group async-a 1.07 KiB = b-52.js 257 bytes b-async-a.js 836 bytes -Chunk Group async-b 1.07 KiB = b-52.js 257 bytes b-async-b.js 836 bytes +Chunk Group async-a 1.07 KiB = b-164.js 259 bytes b-async-a.js 836 bytes +Chunk Group async-b 1.07 KiB = b-164.js 259 bytes b-async-b.js 837 bytes Chunk Group async-c 1.45 KiB = b-vendors.js 740 bytes b-async-c.js 741 bytes -chunk (runtime: main) b-52.js 149 bytes [rendered] split chunk (cache group: default) +chunk (runtime: main) b-164.js 149 bytes [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 ./shared.js 149 bytes [built] [code generated] -chunk (runtime: main) b-main.js (main) 146 bytes (javascript) 6.92 KiB (runtime) [entry] [rendered] - > ./ main - runtime modules 6.92 KiB 10 modules - ./index.js 146 bytes [built] [code generated] +chunk (runtime: main) b-async-b.js (async-b) 175 bytes [rendered] + > ./b ./index.js 2:0-47 + ./b.js 175 bytes [built] [code generated] chunk (runtime: main) b-vendors.js (vendors) (id hint: vendors) 40 bytes [rendered] split chunk (cache group: vendors) (name: vendors) > ./c ./index.js 3:0-47 ./node_modules/x.js 20 bytes [built] [code generated] ./node_modules/y.js 20 bytes [built] [code generated] -chunk (runtime: main) b-async-b.js (async-b) 175 bytes [rendered] - > ./b ./index.js 2:0-47 - ./b.js 175 bytes [built] [code generated] chunk (runtime: main) b-async-c.js (async-c) 67 bytes [rendered] > ./c ./index.js 3:0-47 ./c.js 67 bytes [built] [code generated] chunk (runtime: main) b-async-a.js (async-a) 175 bytes [rendered] > ./a ./index.js 1:0-47 ./a.js 175 bytes [built] [code generated] +chunk (runtime: main) b-main.js (main) 146 bytes (javascript) 6.92 KiB (runtime) [entry] [rendered] + > ./ main + runtime modules 6.92 KiB 10 modules + ./index.js 146 bytes [built] [code generated] webpack x.x.x compiled successfully" `; @@ -1907,54 +1907,54 @@ webpack x.x.x compiled with 1 error and 1 warning in X ms" `; exports[`StatsTestCases should print correct stats for optimize-chunks 1`] = ` -"asset main.js 11.1 KiB {179} [emitted] (name: main) -asset cir2 from cir1.js 377 bytes {288}, {289} [emitted] (name: cir2 from cir1) -asset cir1.js 333 bytes {592} [emitted] (name: cir1) -asset cir2.js 333 bytes {289} [emitted] (name: cir2) -asset abd.js 193 bytes {90}, {374} [emitted] (name: abd) -asset chunk.js 154 bytes {284}, {753} [emitted] (name: chunk) -asset ab.js 149 bytes {90} [emitted] (name: ab) -asset ac in ab.js 110 bytes {753} [emitted] (name: ac in ab) -chunk {90} (runtime: main) ab.js (ab) 2 bytes <{179}> >{753}< [rendered] - > [10] ./index.js 1:0-6:8 - ./modules/a.js [839] 1 bytes {90} {374} [built] [code generated] - ./modules/b.js [836] 1 bytes {90} {374} [built] [code generated] -chunk {179} (runtime: main) main.js (main) 524 bytes (javascript) 6.12 KiB (runtime) >{90}< >{289}< >{374}< >{592}< [entry] [rendered] +"asset main.js 11.1 KiB {590} [emitted] (name: main) +asset cir2 from cir1.js 376 bytes {112}, {684} [emitted] (name: cir2 from cir1) +asset cir1.js 333 bytes {948} [emitted] (name: cir1) +asset cir2.js 333 bytes {112} [emitted] (name: cir2) +asset abd.js 194 bytes {280}, {472} [emitted] (name: abd) +asset chunk.js 152 bytes {60}, {312} [emitted] (name: chunk) +asset ab.js 150 bytes {472} [emitted] (name: ab) +asset ac in ab.js 109 bytes {312} [emitted] (name: ac in ab) +chunk {60} (runtime: main) chunk.js (chunk) 2 bytes <{280}> <{312}> [rendered] + > [39] ./index.js 3:2-4:13 + > [39] ./index.js 9:1-10:12 + ./modules/c.js [80] 1 bytes {60} {312} [built] [code generated] + ./modules/d.js [640] 1 bytes {60} {280} [built] [code generated] +chunk {112} (runtime: main) cir2.js (cir2) 81 bytes <{590}> >{948}< [rendered] + > [39] ./index.js 14:0-54 + ./circular2.js [596] 81 bytes {112} {684} [built] [code generated] +chunk {280} (runtime: main) abd.js (abd) 3 bytes <{590}> >{60}< [rendered] + > [39] ./index.js 8:0-11:9 + ./modules/a.js [976] 1 bytes {280} {472} [built] [code generated] + ./modules/b.js [979] 1 bytes {280} {472} [built] [code generated] + ./modules/d.js [640] 1 bytes {60} {280} [built] [code generated] +chunk {312} (runtime: main) ac in ab.js (ac in ab) 1 bytes <{472}> >{60}< [rendered] + > [39] ./index.js 2:1-5:15 + ./modules/c.js [80] 1 bytes {60} {312} [built] [code generated] +chunk {472} (runtime: main) ab.js (ab) 2 bytes <{590}> >{312}< [rendered] + > [39] ./index.js 1:0-6:8 + ./modules/a.js [976] 1 bytes {280} {472} [built] [code generated] + ./modules/b.js [979] 1 bytes {280} {472} [built] [code generated] +chunk {590} (runtime: main) main.js (main) 524 bytes (javascript) 6.12 KiB (runtime) >{112}< >{280}< >{472}< >{948}< [entry] [rendered] > ./index main runtime modules 6.12 KiB 7 modules cacheable modules 524 bytes - ./index.js [10] 523 bytes {179} [built] [code generated] - ./modules/f.js [544] 1 bytes {179} [dependent] [built] [code generated] -chunk {284} (runtime: main) chunk.js (chunk) 2 bytes <{374}> <{753}> [rendered] - > [10] ./index.js 3:2-4:13 - > [10] ./index.js 9:1-10:12 - ./modules/c.js [115] 1 bytes {284} {753} [built] [code generated] - ./modules/d.js [928] 1 bytes {284} {374} [built] [code generated] -chunk {288} (runtime: main) cir2 from cir1.js (cir2 from cir1) 82 bytes <{592}> >{592}< [rendered] - > [655] ./circular1.js 1:0-79 - ./circular2.js [193] 81 bytes {288} {289} [built] [code generated] - ./modules/e.js [798] 1 bytes {288} [built] [code generated] -chunk {289} (runtime: main) cir2.js (cir2) 81 bytes <{179}> >{592}< [rendered] - > [10] ./index.js 14:0-54 - ./circular2.js [193] 81 bytes {288} {289} [built] [code generated] -chunk {374} (runtime: main) abd.js (abd) 3 bytes <{179}> >{284}< [rendered] - > [10] ./index.js 8:0-11:9 - ./modules/a.js [839] 1 bytes {90} {374} [built] [code generated] - ./modules/b.js [836] 1 bytes {90} {374} [built] [code generated] - ./modules/d.js [928] 1 bytes {284} {374} [built] [code generated] -chunk {592} (runtime: main) cir1.js (cir1) 81 bytes <{179}> <{288}> <{289}> >{288}< [rendered] - > [10] ./index.js 13:0-54 - > [193] ./circular2.js 1:0-79 - ./circular1.js [655] 81 bytes {592} [built] [code generated] -chunk {753} (runtime: main) ac in ab.js (ac in ab) 1 bytes <{90}> >{284}< [rendered] - > [10] ./index.js 2:1-5:15 - ./modules/c.js [115] 1 bytes {284} {753} [built] [code generated] + ./index.js [39] 523 bytes {590} [built] [code generated] + ./modules/f.js [224] 1 bytes {590} [dependent] [built] [code generated] +chunk {684} (runtime: main) cir2 from cir1.js (cir2 from cir1) 82 bytes <{948}> >{948}< [rendered] + > [980] ./circular1.js 1:0-79 + ./circular2.js [596] 81 bytes {112} {684} [built] [code generated] + ./modules/e.js [44] 1 bytes {684} [built] [code generated] +chunk {948} (runtime: main) cir1.js (cir1) 81 bytes <{112}> <{590}> <{684}> >{684}< [rendered] + > [39] ./index.js 13:0-54 + > [596] ./circular2.js 1:0-79 + ./circular1.js [980] 81 bytes {948} [built] [code generated] webpack x.x.x compiled successfully in X ms" `; exports[`StatsTestCases should print correct stats for output-module 1`] = ` -"asset main.mjs 9.54 KiB [emitted] [javascript module] (name: main) -asset 52.mjs 356 bytes [emitted] [javascript module] +"asset main.mjs 9.55 KiB [emitted] [javascript module] (name: main) +asset 632.mjs 358 bytes [emitted] [javascript module] runtime modules 5.76 KiB 7 modules orphan modules 38 bytes [orphan] 1 module cacheable modules 263 bytes @@ -2060,9 +2060,9 @@ webpack x.x.x compiled with 3 warnings in X ms" exports[`StatsTestCases should print correct stats for performance-disabled 1`] = ` "asset main.js 303 KiB [emitted] (name: main) -asset 460.js 323 bytes [emitted] -asset 524.js 206 bytes [emitted] -asset 996.js 138 bytes [emitted] +asset 720.js 323 bytes [emitted] +asset 804.js 206 bytes [emitted] +asset 636.js 138 bytes [emitted] Entrypoint main 303 KiB = main.js runtime modules 6.02 KiB 7 modules cacheable modules 293 KiB @@ -2077,9 +2077,9 @@ webpack x.x.x compiled successfully in X ms" exports[`StatsTestCases should print correct stats for performance-error 1`] = ` "asset main.js 303 KiB [emitted] [big] (name: main) -asset 460.js 323 bytes [emitted] -asset 524.js 206 bytes [emitted] -asset 996.js 138 bytes [emitted] +asset 720.js 323 bytes [emitted] +asset 804.js 206 bytes [emitted] +asset 636.js 138 bytes [emitted] Entrypoint main [big] 303 KiB = main.js runtime modules 6.02 KiB 7 modules cacheable modules 293 KiB @@ -2136,9 +2136,9 @@ webpack x.x.x compiled with 3 warnings in X ms" exports[`StatsTestCases should print correct stats for performance-no-hints 1`] = ` "asset main.js 303 KiB [emitted] [big] (name: main) -asset 460.js 323 bytes [emitted] -asset 524.js 206 bytes [emitted] -asset 996.js 138 bytes [emitted] +asset 720.js 323 bytes [emitted] +asset 804.js 206 bytes [emitted] +asset 636.js 138 bytes [emitted] Entrypoint main [big] 303 KiB = main.js runtime modules 6.02 KiB 7 modules cacheable modules 293 KiB @@ -2182,55 +2182,55 @@ webpack x.x.x compiled with 3 errors in X ms" `; exports[`StatsTestCases should print correct stats for prefetch 1`] = ` -"asset main.js 16.9 KiB {179} [emitted] (name: main) -asset prefetched.js 556 bytes {505} [emitted] (name: prefetched) -asset inner2.js 150 bytes {641} [emitted] (name: inner2) -asset inner.js 110 bytes {746} [emitted] (name: inner) -asset prefetched2.js 110 bytes {379} [emitted] (name: prefetched2) -asset prefetched3.js 110 bytes {220} [emitted] (name: prefetched3) -asset normal.js 109 bytes {30} [emitted] (name: normal) +"asset main.js 16.9 KiB {590} [emitted] (name: main) +asset prefetched.js 555 bytes {364} [emitted] (name: prefetched) +asset inner2.js 150 bytes {804} [emitted] (name: inner2) +asset normal.js 110 bytes {448} [emitted] (name: normal) +asset prefetched2.js 110 bytes {944} [emitted] (name: prefetched2) +asset inner.js 109 bytes {776} [emitted] (name: inner) +asset prefetched3.js 109 bytes {372} [emitted] (name: prefetched3) Entrypoint main 16.9 KiB = main.js - prefetch: prefetched2.js {379} (name: prefetched2), prefetched.js {505} (name: prefetched), prefetched3.js {220} (name: prefetched3) -chunk {30} (runtime: main) normal.js (normal) 1 bytes <{179}> [rendered] -chunk {179} (runtime: main) main.js (main) 436 bytes (javascript) 9.96 KiB (runtime) >{30}< >{220}< >{379}< >{505}< (prefetch: {379} {505} {220}) [entry] [rendered] -chunk {220} (runtime: main) prefetched3.js (prefetched3) 1 bytes <{179}> [rendered] -chunk {379} (runtime: main) prefetched2.js (prefetched2) 1 bytes <{179}> [rendered] -chunk {505} (runtime: main) prefetched.js (prefetched) 228 bytes <{179}> >{641}< >{746}< (prefetch: {641} {746}) [rendered] -chunk {641} (runtime: main) inner2.js (inner2) 2 bytes <{505}> [rendered] -chunk {746} (runtime: main) inner.js (inner) 1 bytes <{505}> [rendered]" + prefetch: prefetched2.js {944} (name: prefetched2), prefetched.js {364} (name: prefetched), prefetched3.js {372} (name: prefetched3) +chunk {364} (runtime: main) prefetched.js (prefetched) 228 bytes <{590}> >{776}< >{804}< (prefetch: {804} {776}) [rendered] +chunk {372} (runtime: main) prefetched3.js (prefetched3) 1 bytes <{590}> [rendered] +chunk {448} (runtime: main) normal.js (normal) 1 bytes <{590}> [rendered] +chunk {590} (runtime: main) main.js (main) 436 bytes (javascript) 9.96 KiB (runtime) >{364}< >{372}< >{448}< >{944}< (prefetch: {944} {364} {372}) [entry] [rendered] +chunk {776} (runtime: main) inner.js (inner) 1 bytes <{364}> [rendered] +chunk {804} (runtime: main) inner2.js (inner2) 2 bytes <{364}> [rendered] +chunk {944} (runtime: main) prefetched2.js (prefetched2) 1 bytes <{590}> [rendered]" `; exports[`StatsTestCases should print correct stats for prefetch-preload-mixed 1`] = ` -"chunk (runtime: main) c2.js (c2) 1 bytes <{459}> [rendered] -chunk (runtime: main) a1.js (a1) 1 bytes <{786}> [rendered] -chunk (runtime: main) c1.js (c1) 1 bytes <{459}> [rendered] -chunk (runtime: main) b.js (b) 203 bytes <{179}> >{132}< >{751}< >{978}< (prefetch: {751} {132}) (preload: {978}) [rendered] -chunk (runtime: main) b3.js (b3) 1 bytes <{128}> [rendered] -chunk (runtime: main) a2.js (a2) 1 bytes <{786}> [rendered] -chunk (runtime: main) main.js (main) 195 bytes (javascript) 10.6 KiB (runtime) >{128}< >{459}< >{786}< (prefetch: {786} {128} {459}) [entry] [rendered] -chunk (runtime: main) c.js (c) 134 bytes <{179}> >{3}< >{76}< (preload: {76} {3}) [rendered] -chunk (runtime: main) b1.js (b1) 1 bytes <{128}> [rendered] -chunk (runtime: main) a.js (a) 136 bytes <{179}> >{74}< >{178}< (prefetch: {74} {178}) [rendered] -chunk (runtime: main) b2.js (b2) 1 bytes <{128}> [rendered]" +"chunk (runtime: main) c2.js (c2) 1 bytes <{152}> [rendered] +chunk (runtime: main) a2.js (a2) 1 bytes <{996}> [rendered] +chunk (runtime: main) c.js (c) 134 bytes <{590}> >{96}< >{704}< (preload: {704} {96}) [rendered] +chunk (runtime: main) a1.js (a1) 1 bytes <{996}> [rendered] +chunk (runtime: main) b3.js (b3) 1 bytes <{580}> [rendered] +chunk (runtime: main) b.js (b) 203 bytes <{590}> >{568}< >{756}< >{760}< (prefetch: {756} {568}) (preload: {760}) [rendered] +chunk (runtime: main) main.js (main) 195 bytes (javascript) 10.6 KiB (runtime) >{152}< >{580}< >{996}< (prefetch: {996} {580} {152}) [entry] [rendered] +chunk (runtime: main) c1.js (c1) 1 bytes <{152}> [rendered] +chunk (runtime: main) b1.js (b1) 1 bytes <{580}> [rendered] +chunk (runtime: main) b2.js (b2) 1 bytes <{580}> [rendered] +chunk (runtime: main) a.js (a) 136 bytes <{590}> >{150}< >{341}< (prefetch: {341} {150}) [rendered]" `; exports[`StatsTestCases should print correct stats for preload 1`] = ` "asset main.js 15.2 KiB [emitted] (name: main) -asset preloaded.js 556 bytes [emitted] (name: preloaded) +asset preloaded.js 555 bytes [emitted] (name: preloaded) asset inner2.js 150 bytes [emitted] (name: inner2) -asset inner.js 110 bytes [emitted] (name: inner) -asset normal.js 109 bytes [emitted] (name: normal) -asset preloaded2.js 109 bytes [emitted] (name: preloaded2) -asset preloaded3.js 108 bytes [emitted] (name: preloaded3) +asset normal.js 110 bytes [emitted] (name: normal) +asset preloaded2.js 110 bytes [emitted] (name: preloaded2) +asset inner.js 109 bytes [emitted] (name: inner) +asset preloaded3.js 109 bytes [emitted] (name: preloaded3) Entrypoint main 15.2 KiB = main.js preload: preloaded2.js (name: preloaded2), preloaded.js (name: preloaded), preloaded3.js (name: preloaded3) -chunk (runtime: main) normal.js (normal) 1 bytes [rendered] -chunk (runtime: main) main.js (main) 424 bytes (javascript) 8.9 KiB (runtime) (preload: {363} {851} {355}) [entry] [rendered] chunk (runtime: main) preloaded3.js (preloaded3) 1 bytes [rendered] -chunk (runtime: main) preloaded2.js (preloaded2) 1 bytes [rendered] -chunk (runtime: main) inner2.js (inner2) 2 bytes [rendered] +chunk (runtime: main) preloaded.js (preloaded) 226 bytes (preload: {804} {776}) [rendered] +chunk (runtime: main) normal.js (normal) 1 bytes [rendered] +chunk (runtime: main) main.js (main) 424 bytes (javascript) 8.9 KiB (runtime) (preload: {832} {260} {68}) [entry] [rendered] chunk (runtime: main) inner.js (inner) 1 bytes [rendered] -chunk (runtime: main) preloaded.js (preloaded) 226 bytes (preload: {641} {746}) [rendered]" +chunk (runtime: main) inner2.js (inner2) 2 bytes [rendered] +chunk (runtime: main) preloaded2.js (preloaded2) 1 bytes [rendered]" `; exports[`StatsTestCases should print correct stats for preset-detailed 1`] = ` @@ -2243,66 +2243,66 @@ exports[`StatsTestCases should print correct stats for preset-detailed 1`] = ` [LogTestPlugin] Log [LogTestPlugin] End PublicPath: auto -asset main.js 10.3 KiB {179} [emitted] (name: main) -asset 460.js 323 bytes {460} [emitted] -asset 524.js 206 bytes {524} [emitted] -asset 996.js 138 bytes {996} [emitted] +asset main.js 10.3 KiB {590} [emitted] (name: main) +asset 720.js 323 bytes {720} [emitted] +asset 804.js 206 bytes {804} [emitted] +asset 636.js 138 bytes {636} [emitted] Entrypoint main 10.3 KiB = main.js -chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 6.02 KiB (runtime) >{460}< >{996}< [entry] [rendered] +chunk {590} (runtime: main) main.js (main) 73 bytes (javascript) 6.02 KiB (runtime) >{636}< >{720}< [entry] [rendered] > ./index main -chunk {460} (runtime: main) 460.js 54 bytes <{179}> >{524}< [rendered] - > ./c [10] ./index.js 3:0-16 -chunk {524} (runtime: main) 524.js 44 bytes <{460}> [rendered] - > [460] ./c.js 1:0-52 -chunk {996} (runtime: main) 996.js 22 bytes <{179}> [rendered] - > ./b [10] ./index.js 2:0-16 +chunk {636} (runtime: main) 636.js 22 bytes <{590}> [rendered] + > ./b [39] ./index.js 2:0-16 +chunk {720} (runtime: main) 720.js 54 bytes <{590}> >{804}< [rendered] + > ./c [39] ./index.js 3:0-16 +chunk {804} (runtime: main) 804.js 44 bytes <{720}> [rendered] + > [720] ./c.js 1:0-52 runtime modules 6.02 KiB - webpack/runtime/ensure chunk 326 bytes {179} [code generated] + webpack/runtime/ensure chunk 326 bytes {590} [code generated] [no exports] [used exports unknown] - webpack/runtime/get javascript chunk filename 167 bytes {179} [code generated] + webpack/runtime/get javascript chunk filename 167 bytes {590} [code generated] [no exports] [used exports unknown] - webpack/runtime/global 221 bytes {179} [code generated] + webpack/runtime/global 221 bytes {590} [code generated] [no exports] [used exports unknown] - webpack/runtime/hasOwnProperty shorthand 88 bytes {179} [code generated] + webpack/runtime/hasOwnProperty shorthand 88 bytes {590} [code generated] [no exports] [used exports unknown] - webpack/runtime/jsonp chunk loading 2.97 KiB {179} [code generated] + webpack/runtime/jsonp chunk loading 2.97 KiB {590} [code generated] [no exports] [used exports unknown] - webpack/runtime/load script 1.36 KiB {179} [code generated] + webpack/runtime/load script 1.36 KiB {590} [code generated] [no exports] [used exports unknown] - webpack/runtime/publicPath 923 bytes {179} [code generated] + webpack/runtime/publicPath 923 bytes {590} [code generated] [no exports] [used exports unknown] cacheable modules 193 bytes - ./index.js [10] 51 bytes {179} [depth 0] [built] [code generated] + ./index.js [39] 51 bytes {590} [depth 0] [built] [code generated] [no exports used] Statement (ExpressionStatement) with side effects in source code at 1:0-15 ModuleConcatenation bailout: Module is not an ECMAScript module - ./a.js [847] 22 bytes {179} [depth 1] [built] [code generated] + ./a.js [80] 22 bytes {590} [depth 1] [built] [code generated] [used exports unknown] CommonJS bailout: module.exports is used directly at 1:0-14 Statement (ExpressionStatement) with side effects in source code at 1:0-21 ModuleConcatenation bailout: Module is not an ECMAScript module - ./b.js [996] 22 bytes {996} [depth 1] [built] [code generated] + ./b.js [636] 22 bytes {636} [depth 1] [built] [code generated] [used exports unknown] CommonJS bailout: module.exports is used directly at 1:0-14 Statement (ExpressionStatement) with side effects in source code at 1:0-21 ModuleConcatenation bailout: Module is not an ECMAScript module - ./c.js [460] 54 bytes {460} [depth 1] [built] [code generated] + ./c.js [720] 54 bytes {720} [depth 1] [built] [code generated] [used exports unknown] Statement (ExpressionStatement) with side effects in source code at 1:0-53 ModuleConcatenation bailout: Module is not an ECMAScript module - ./d.js [767] 22 bytes {524} [depth 2] [built] [code generated] + ./d.js [744] 22 bytes {804} [depth 2] [built] [code generated] [used exports unknown] CommonJS bailout: module.exports is used directly at 1:0-14 Statement (ExpressionStatement) with side effects in source code at 1:0-21 ModuleConcatenation bailout: Module is not an ECMAScript module - ./e.js [390] 22 bytes {524} [depth 2] [built] [code generated] + ./e.js [928] 22 bytes {804} [depth 2] [built] [code generated] [used exports unknown] CommonJS bailout: module.exports is used directly at 1:0-14 Statement (ExpressionStatement) with side effects in source code at 1:0-21 @@ -2346,7 +2346,7 @@ LOG from webpack.FileSystemInfo Directory info in cache: 0 timestamps 0 hashes 0 timestamp hash combinations Managed items info in cache: 0 items -1970-04-20 12:42:42: webpack x.x.x compiled successfully in X ms (d0ef3eec49bd8418e22c)" +1970-04-20 12:42:42: webpack x.x.x compiled successfully in X ms (8fe0e0dcc6f8c10a1eb4)" `; exports[`StatsTestCases should print correct stats for preset-errors-only 1`] = `""`; @@ -2422,9 +2422,9 @@ exports[`StatsTestCases should print correct stats for preset-normal 1`] = ` [LogTestPlugin] Warning [LogTestPlugin] Info asset main.js 10.3 KiB [emitted] (name: main) -asset 460.js 323 bytes [emitted] -asset 524.js 206 bytes [emitted] -asset 996.js 138 bytes [emitted] +asset 720.js 323 bytes [emitted] +asset 804.js 206 bytes [emitted] +asset 636.js 138 bytes [emitted] runtime modules 6.02 KiB 7 modules cacheable modules 193 bytes ./index.js 51 bytes [built] [code generated] @@ -2445,9 +2445,9 @@ webpack x.x.x compiled successfully in X ms" exports[`StatsTestCases should print correct stats for preset-normal-performance 1`] = ` "asset main.js 303 KiB [emitted] [big] (name: main) -asset 460.js 323 bytes [emitted] -asset 524.js 206 bytes [emitted] -asset 996.js 138 bytes [emitted] +asset 720.js 323 bytes [emitted] +asset 804.js 206 bytes [emitted] +asset 636.js 138 bytes [emitted] runtime modules 6.02 KiB 7 modules cacheable modules 293 KiB ./index.js 52 bytes [built] [code generated] @@ -2473,9 +2473,9 @@ webpack x.x.x compiled with 2 warnings in X ms" exports[`StatsTestCases should print correct stats for preset-normal-performance-ensure-filter-sourcemaps 1`] = ` "asset main.js 303 KiB [emitted] [big] (name: main) 1 related asset -asset 460.js 355 bytes [emitted] 1 related asset -asset 524.js 238 bytes [emitted] 1 related asset -asset 996.js 170 bytes [emitted] 1 related asset +asset 720.js 355 bytes [emitted] 1 related asset +asset 804.js 238 bytes [emitted] 1 related asset +asset 636.js 170 bytes [emitted] 1 related asset runtime modules 6.02 KiB 7 modules cacheable modules 293 KiB ./index.js 52 bytes [built] [code generated] @@ -2519,90 +2519,90 @@ exports[`StatsTestCases should print correct stats for preset-verbose 1`] = ` [LogTestPlugin] Log [LogTestPlugin] End PublicPath: auto -asset main.js 10.3 KiB {179} [emitted] (name: main) -asset 460.js 323 bytes {460} [emitted] -asset 524.js 206 bytes {524} [emitted] -asset 996.js 138 bytes {996} [emitted] +asset main.js 10.3 KiB {590} [emitted] (name: main) +asset 720.js 323 bytes {720} [emitted] +asset 804.js 206 bytes {804} [emitted] +asset 636.js 138 bytes {636} [emitted] Entrypoint main 10.3 KiB = main.js -chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 6.02 KiB (runtime) >{460}< >{996}< [entry] [rendered] +chunk {590} (runtime: main) main.js (main) 73 bytes (javascript) 6.02 KiB (runtime) >{636}< >{720}< [entry] [rendered] > ./index main runtime modules 6.02 KiB - webpack/runtime/ensure chunk 326 bytes {179} [code generated] + webpack/runtime/ensure chunk 326 bytes {590} [code generated] [no exports] [used exports unknown] - webpack/runtime/get javascript chunk filename 167 bytes {179} [code generated] + webpack/runtime/get javascript chunk filename 167 bytes {590} [code generated] [no exports] [used exports unknown] - webpack/runtime/global 221 bytes {179} [code generated] + webpack/runtime/global 221 bytes {590} [code generated] [no exports] [used exports unknown] - webpack/runtime/hasOwnProperty shorthand 88 bytes {179} [code generated] + webpack/runtime/hasOwnProperty shorthand 88 bytes {590} [code generated] [no exports] [used exports unknown] - webpack/runtime/jsonp chunk loading 2.97 KiB {179} [code generated] + webpack/runtime/jsonp chunk loading 2.97 KiB {590} [code generated] [no exports] [used exports unknown] - webpack/runtime/load script 1.36 KiB {179} [code generated] + webpack/runtime/load script 1.36 KiB {590} [code generated] [no exports] [used exports unknown] - webpack/runtime/publicPath 923 bytes {179} [code generated] + webpack/runtime/publicPath 923 bytes {590} [code generated] [no exports] [used exports unknown] cacheable modules 73 bytes - ./a.js [847] 22 bytes {179} [depth 1] [dependent] [built] [code generated] + ./a.js [80] 22 bytes {590} [depth 1] [dependent] [built] [code generated] [used exports unknown] CommonJS bailout: module.exports is used directly at 1:0-14 Statement (ExpressionStatement) with side effects in source code at 1:0-21 ModuleConcatenation bailout: Module is not an ECMAScript module - cjs self exports reference [847] ./a.js 1:0-14 - cjs require ./a [10] ./index.js 1:0-14 - X ms [10] -> + cjs self exports reference [80] ./a.js 1:0-14 + cjs require ./a [39] ./index.js 1:0-14 + X ms [39] -> X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) - ./index.js [10] 51 bytes {179} [depth 0] [built] [code generated] + ./index.js [39] 51 bytes {590} [depth 0] [built] [code generated] [no exports used] Statement (ExpressionStatement) with side effects in source code at 1:0-15 ModuleConcatenation bailout: Module is not an ECMAScript module entry ./index main X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) -chunk {460} (runtime: main) 460.js 54 bytes <{179}> >{524}< [rendered] - > ./c [10] ./index.js 3:0-16 - ./c.js [460] 54 bytes {460} [depth 1] [built] [code generated] +chunk {636} (runtime: main) 636.js 22 bytes <{590}> [rendered] + > ./b [39] ./index.js 2:0-16 + ./b.js [636] 22 bytes {636} [depth 1] [built] [code generated] [used exports unknown] - Statement (ExpressionStatement) with side effects in source code at 1:0-53 + CommonJS bailout: module.exports is used directly at 1:0-14 + Statement (ExpressionStatement) with side effects in source code at 1:0-21 ModuleConcatenation bailout: Module is not an ECMAScript module - amd require ./c [10] ./index.js 3:0-16 - X ms [10] -> + cjs self exports reference [636] ./b.js 1:0-14 + amd require ./b [39] ./index.js 2:0-16 + X ms [39] -> X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) -chunk {524} (runtime: main) 524.js 44 bytes <{460}> [rendered] - > [460] ./c.js 1:0-52 - ./d.js [767] 22 bytes {524} [depth 2] [built] [code generated] +chunk {720} (runtime: main) 720.js 54 bytes <{590}> >{804}< [rendered] + > ./c [39] ./index.js 3:0-16 + ./c.js [720] 54 bytes {720} [depth 1] [built] [code generated] [used exports unknown] - CommonJS bailout: module.exports is used directly at 1:0-14 - Statement (ExpressionStatement) with side effects in source code at 1:0-21 + Statement (ExpressionStatement) with side effects in source code at 1:0-53 ModuleConcatenation bailout: Module is not an ECMAScript module - require.ensure item ./d [460] ./c.js 1:0-52 - cjs self exports reference [767] ./d.js 1:0-14 - X ms [10] -> X ms [460] -> + amd require ./c [39] ./index.js 3:0-16 + X ms [39] -> X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) - ./e.js [390] 22 bytes {524} [depth 2] [built] [code generated] +chunk {804} (runtime: main) 804.js 44 bytes <{720}> [rendered] + > [720] ./c.js 1:0-52 + ./d.js [744] 22 bytes {804} [depth 2] [built] [code generated] [used exports unknown] CommonJS bailout: module.exports is used directly at 1:0-14 Statement (ExpressionStatement) with side effects in source code at 1:0-21 ModuleConcatenation bailout: Module is not an ECMAScript module - require.ensure item ./e [460] ./c.js 1:0-52 - cjs self exports reference [390] ./e.js 1:0-14 - X ms [10] -> X ms [460] -> + require.ensure item ./d [720] ./c.js 1:0-52 + cjs self exports reference [744] ./d.js 1:0-14 + X ms [39] -> X ms [720] -> X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) -chunk {996} (runtime: main) 996.js 22 bytes <{179}> [rendered] - > ./b [10] ./index.js 2:0-16 - ./b.js [996] 22 bytes {996} [depth 1] [built] [code generated] + ./e.js [928] 22 bytes {804} [depth 2] [built] [code generated] [used exports unknown] CommonJS bailout: module.exports is used directly at 1:0-14 Statement (ExpressionStatement) with side effects in source code at 1:0-21 ModuleConcatenation bailout: Module is not an ECMAScript module - cjs self exports reference [996] ./b.js 1:0-14 - amd require ./b [10] ./index.js 2:0-16 - X ms [10] -> + require.ensure item ./e [720] ./c.js 1:0-52 + cjs self exports reference [928] ./e.js 1:0-14 + X ms [39] -> X ms [720] -> X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) @@ -2722,21 +2722,21 @@ LOG from webpack.FileSystemInfo Directory info in cache: 0 timestamps 0 hashes 0 timestamp hash combinations Managed items info in cache: 0 items -1970-04-20 12:42:42: webpack x.x.x compiled successfully in X ms (d0ef3eec49bd8418e22c)" +1970-04-20 12:42:42: webpack x.x.x compiled successfully in X ms (8fe0e0dcc6f8c10a1eb4)" `; exports[`StatsTestCases should print correct stats for real-content-hash 1`] = ` "a-normal: assets by path *.js 3.23 KiB - asset 48e1a25a11a7b9397e41-48e1a2.js 2.77 KiB [emitted] [immutable] [minimized] (name: runtime) - asset f96e917feecf51c4fc5c-f96e91.js 232 bytes [emitted] [immutable] [minimized] (name: lazy) - asset f17033ffbf027f2d71b7-f17033.js 212 bytes [emitted] [immutable] [minimized] (name: index) + asset 6cca84209a011d8f4e3e-6cca84.js 2.77 KiB [emitted] [immutable] [minimized] (name: runtime) + asset dc9fe55325071ffe06cc-dc9fe5.js 232 bytes [emitted] [immutable] [minimized] (name: lazy) + asset d0a1503542397868f61b-d0a150.js 212 bytes [emitted] [immutable] [minimized] (name: index) asset 666f2b8847021ccc7608-666f2b.js 21 bytes [emitted] [immutable] [minimized] (name: a, b) assets by chunk 20.4 KiB (auxiliary name: lazy) asset 89a353e9c515885abd8e.png 14.6 KiB [emitted] [immutable] [from: file.png] (auxiliary name: lazy) asset 7382fad5b015914e0811.jpg?query 5.89 KiB [cached] [immutable] [from: file.jpg?query] (auxiliary name: lazy) asset 7382fad5b015914e0811.jpg 5.89 KiB [emitted] [immutable] [from: file.jpg] (auxiliary name: index) - Entrypoint index 2.98 KiB (5.89 KiB) = 48e1a25a11a7b9397e41-48e1a2.js 2.77 KiB f17033ffbf027f2d71b7-f17033.js 212 bytes 1 auxiliary asset + Entrypoint index 2.98 KiB (5.89 KiB) = 6cca84209a011d8f4e3e-6cca84.js 2.77 KiB d0a1503542397868f61b-d0a150.js 212 bytes 1 auxiliary asset Entrypoint a 21 bytes = 666f2b8847021ccc7608-666f2b.js Entrypoint b 21 bytes = 666f2b8847021ccc7608-666f2b.js runtime modules 7.34 KiB 9 modules @@ -2755,15 +2755,15 @@ exports[`StatsTestCases should print correct stats for real-content-hash 1`] = ` b-normal: assets by path *.js 3.23 KiB - asset f64fdaf8571eaf5e2680-f64fda.js 2.77 KiB [emitted] [immutable] [minimized] (name: runtime) - asset f96e917feecf51c4fc5c-f96e91.js 232 bytes [emitted] [immutable] [minimized] (name: lazy) - asset f17033ffbf027f2d71b7-f17033.js 212 bytes [emitted] [immutable] [minimized] (name: index) + asset 6cca84209a011d8f4e3e-6cca84.js 2.77 KiB [emitted] [immutable] [minimized] (name: runtime) + asset dc9fe55325071ffe06cc-dc9fe5.js 232 bytes [emitted] [immutable] [minimized] (name: lazy) + asset d0a1503542397868f61b-d0a150.js 212 bytes [emitted] [immutable] [minimized] (name: index) asset 666f2b8847021ccc7608-666f2b.js 21 bytes [emitted] [immutable] [minimized] (name: a, b) assets by chunk 20.4 KiB (auxiliary name: lazy) asset 89a353e9c515885abd8e.png 14.6 KiB [emitted] [immutable] [from: file.png] (auxiliary name: lazy) asset 7382fad5b015914e0811.jpg?query 5.89 KiB [cached] [immutable] [from: file.jpg?query] (auxiliary name: lazy) asset 7382fad5b015914e0811.jpg 5.89 KiB [emitted] [immutable] [from: file.jpg] (auxiliary name: index) - Entrypoint index 2.98 KiB (5.89 KiB) = f64fdaf8571eaf5e2680-f64fda.js 2.77 KiB f17033ffbf027f2d71b7-f17033.js 212 bytes 1 auxiliary asset + Entrypoint index 2.98 KiB (5.89 KiB) = 6cca84209a011d8f4e3e-6cca84.js 2.77 KiB d0a1503542397868f61b-d0a150.js 212 bytes 1 auxiliary asset Entrypoint a 21 bytes = 666f2b8847021ccc7608-666f2b.js Entrypoint b 21 bytes = 666f2b8847021ccc7608-666f2b.js runtime modules 7.34 KiB 9 modules @@ -2782,19 +2782,19 @@ b-normal: a-source-map: assets by path *.js 3.44 KiB - asset 018715e3bf7c960ef754-018715.js 2.83 KiB [emitted] [immutable] [minimized] (name: runtime) - sourceMap 018715e3bf7c960ef754-018715.js.map 14.7 KiB [emitted] [dev] (auxiliary name: runtime) - asset 0a8aef384737d9f64f44-0a8aef.js 288 bytes [emitted] [immutable] [minimized] (name: lazy) - sourceMap 0a8aef384737d9f64f44-0a8aef.js.map 409 bytes [emitted] [dev] (auxiliary name: lazy) - asset da629d4acf5998c06668-da629d.js 268 bytes [emitted] [immutable] [minimized] (name: index) - sourceMap da629d4acf5998c06668-da629d.js.map 366 bytes [emitted] [dev] (auxiliary name: index) + asset fbf67d352fd9e6b257e7-fbf67d.js 2.83 KiB [emitted] [immutable] [minimized] (name: runtime) + sourceMap fbf67d352fd9e6b257e7-fbf67d.js.map 14.7 KiB [emitted] [dev] (auxiliary name: runtime) + asset 8b05840021929aacd839-8b0584.js 288 bytes [emitted] [immutable] [minimized] (name: lazy) + sourceMap 8b05840021929aacd839-8b0584.js.map 409 bytes [emitted] [dev] (auxiliary name: lazy) + asset 791c32443320ca0384d1-791c32.js 268 bytes [emitted] [immutable] [minimized] (name: index) + sourceMap 791c32443320ca0384d1-791c32.js.map 366 bytes [emitted] [dev] (auxiliary name: index) asset 222c2acc68675174e6b2-222c2a.js 77 bytes [emitted] [immutable] [minimized] (name: a, b) sourceMap 222c2acc68675174e6b2-222c2a.js.map 254 bytes [emitted] [dev] (auxiliary name: a, b) assets by chunk 20.4 KiB (auxiliary name: lazy) asset 89a353e9c515885abd8e.png 14.6 KiB [emitted] [immutable] [from: file.png] (auxiliary name: lazy) asset 7382fad5b015914e0811.jpg?query 5.89 KiB [cached] [immutable] [from: file.jpg?query] (auxiliary name: lazy) asset 7382fad5b015914e0811.jpg 5.89 KiB [emitted] [immutable] [from: file.jpg] (auxiliary name: index) - Entrypoint index 3.09 KiB (20.9 KiB) = 018715e3bf7c960ef754-018715.js 2.83 KiB da629d4acf5998c06668-da629d.js 268 bytes 3 auxiliary assets + Entrypoint index 3.09 KiB (20.9 KiB) = fbf67d352fd9e6b257e7-fbf67d.js 2.83 KiB 791c32443320ca0384d1-791c32.js 268 bytes 3 auxiliary assets Entrypoint a 77 bytes (254 bytes) = 222c2acc68675174e6b2-222c2a.js 1 auxiliary asset Entrypoint b 77 bytes (254 bytes) = 222c2acc68675174e6b2-222c2a.js 1 auxiliary asset runtime modules 7.34 KiB 9 modules @@ -2813,19 +2813,19 @@ a-source-map: b-source-map: assets by path *.js 3.44 KiB - asset 487b2e232adae9b3ff8b-487b2e.js 2.83 KiB [emitted] [immutable] [minimized] (name: runtime) - sourceMap 487b2e232adae9b3ff8b-487b2e.js.map 14.7 KiB [emitted] [dev] (auxiliary name: runtime) - asset 0a8aef384737d9f64f44-0a8aef.js 288 bytes [emitted] [immutable] [minimized] (name: lazy) - sourceMap 0a8aef384737d9f64f44-0a8aef.js.map 405 bytes [emitted] [dev] (auxiliary name: lazy) - asset da629d4acf5998c06668-da629d.js 268 bytes [emitted] [immutable] [minimized] (name: index) - sourceMap da629d4acf5998c06668-da629d.js.map 323 bytes [emitted] [dev] (auxiliary name: index) + asset b96bcf32c92db07c833f-b96bcf.js 2.83 KiB [emitted] [immutable] [minimized] (name: runtime) + sourceMap b96bcf32c92db07c833f-b96bcf.js.map 14.7 KiB [emitted] [dev] (auxiliary name: runtime) + asset 8b05840021929aacd839-8b0584.js 288 bytes [emitted] [immutable] [minimized] (name: lazy) + sourceMap 8b05840021929aacd839-8b0584.js.map 405 bytes [emitted] [dev] (auxiliary name: lazy) + asset 791c32443320ca0384d1-791c32.js 268 bytes [emitted] [immutable] [minimized] (name: index) + sourceMap 791c32443320ca0384d1-791c32.js.map 323 bytes [emitted] [dev] (auxiliary name: index) asset 222c2acc68675174e6b2-222c2a.js 77 bytes [emitted] [immutable] [minimized] (name: a, b) sourceMap 222c2acc68675174e6b2-222c2a.js.map 254 bytes [emitted] [dev] (auxiliary name: a, b) assets by chunk 20.4 KiB (auxiliary name: lazy) asset 89a353e9c515885abd8e.png 14.6 KiB [emitted] [immutable] [from: file.png] (auxiliary name: lazy) asset 7382fad5b015914e0811.jpg?query 5.89 KiB [cached] [immutable] [from: file.jpg?query] (auxiliary name: lazy) asset 7382fad5b015914e0811.jpg 5.89 KiB [emitted] [immutable] [from: file.jpg] (auxiliary name: index) - Entrypoint index 3.09 KiB (20.9 KiB) = 487b2e232adae9b3ff8b-487b2e.js 2.83 KiB da629d4acf5998c06668-da629d.js 268 bytes 3 auxiliary assets + Entrypoint index 3.09 KiB (20.9 KiB) = b96bcf32c92db07c833f-b96bcf.js 2.83 KiB 791c32443320ca0384d1-791c32.js 268 bytes 3 auxiliary assets Entrypoint a 77 bytes (254 bytes) = 222c2acc68675174e6b2-222c2a.js 1 auxiliary asset Entrypoint b 77 bytes (254 bytes) = 222c2acc68675174e6b2-222c2a.js 1 auxiliary asset runtime modules 7.34 KiB 9 modules @@ -3001,9 +3001,9 @@ webpack x.x.x compiled successfully" exports[`StatsTestCases should print correct stats for runtime-chunk-integration 1`] = ` "base: asset without-runtime.js 12.1 KiB [emitted] (name: runtime) - asset without-505.js 1.2 KiB [emitted] - asset without-main1.js 815 bytes [emitted] (name: main1) - Entrypoint main1 12.9 KiB = without-runtime.js 12.1 KiB without-main1.js 815 bytes + asset without-340.js 1.2 KiB [emitted] + asset without-main1.js 816 bytes [emitted] (name: main1) + Entrypoint main1 12.9 KiB = without-runtime.js 12.1 KiB without-main1.js 816 bytes runtime modules 7.57 KiB 10 modules cacheable modules 126 bytes ./main1.js 66 bytes [built] [code generated] @@ -3014,12 +3014,12 @@ exports[`StatsTestCases should print correct stats for runtime-chunk-integration static custom name: asset with-manifest.js 12.1 KiB [emitted] (name: manifest) - asset with-505.js 1.2 KiB [emitted] - asset with-main1.js 815 bytes [emitted] (name: main1) - asset with-main2.js 434 bytes [emitted] (name: main2) + asset with-340.js 1.2 KiB [emitted] + asset with-main1.js 816 bytes [emitted] (name: main1) asset with-main3.js 434 bytes [emitted] (name: main3) - Entrypoint main1 12.9 KiB = with-manifest.js 12.1 KiB with-main1.js 815 bytes - Entrypoint main2 12.5 KiB = with-manifest.js 12.1 KiB with-main2.js 434 bytes + asset with-main2.js 433 bytes [emitted] (name: main2) + Entrypoint main1 12.9 KiB = with-manifest.js 12.1 KiB with-main1.js 816 bytes + Entrypoint main2 12.5 KiB = with-manifest.js 12.1 KiB with-main2.js 433 bytes Entrypoint main3 12.5 KiB = with-manifest.js 12.1 KiB with-main3.js 434 bytes runtime modules 7.56 KiB 10 modules cacheable modules 166 bytes @@ -3034,12 +3034,12 @@ static custom name: dynamic custom name: asset func-b.js 12.1 KiB [emitted] (name: b) asset func-a.js 4.91 KiB [emitted] (name: a) - asset func-505.js 1.2 KiB [emitted] - asset func-main1.js 815 bytes [emitted] (name: main1) - asset func-main2.js 434 bytes [emitted] (name: main2) + asset func-340.js 1.2 KiB [emitted] + asset func-main1.js 816 bytes [emitted] (name: main1) asset func-main3.js 434 bytes [emitted] (name: main3) - Entrypoint main1 12.9 KiB = func-b.js 12.1 KiB func-main1.js 815 bytes - Entrypoint main2 12.5 KiB = func-b.js 12.1 KiB func-main2.js 434 bytes + asset func-main2.js 433 bytes [emitted] (name: main2) + Entrypoint main1 12.9 KiB = func-b.js 12.1 KiB func-main1.js 816 bytes + Entrypoint main2 12.5 KiB = func-b.js 12.1 KiB func-main2.js 433 bytes Entrypoint main3 5.33 KiB = func-a.js 4.91 KiB func-main3.js 434 bytes runtime modules 10 KiB 13 modules cacheable modules 166 bytes @@ -3572,107 +3572,116 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` Entrypoint a 12.6 KiB = default/a.js Entrypoint b 3.93 KiB = default/b.js Entrypoint c 3.93 KiB = default/c.js - chunk (runtime: b) default/b.js (b) 196 bytes (javascript) 396 bytes (runtime) [entry] [rendered] - > ./b b - dependent modules 80 bytes [dependent] 4 modules - runtime modules 396 bytes 2 modules - ./b.js 116 bytes [built] [code generated] - chunk (runtime: a, main) default/async-g.js (async-g) 45 bytes <{282}> <{767}> <{786}> <{794}> <{954}> ={568}= [rendered] + chunk (runtime: a, main) default/async-g.js (async-g) 45 bytes <{464}> <{472}> <{616}> <{744}> <{996}> ={144}= [rendered] > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] - chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 6.68 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered] - > ./ main - runtime modules 6.68 KiB 9 modules - ./index.js 147 bytes [built] [code generated] - chunk (runtime: main) default/282.js (id hint: vendors) 20 bytes <{179}> ={334}= ={383}= ={568}= ={767}= ={769}= ={794}= ={954}= >{137}< >{568}< [rendered] split chunk (cache group: defaultVendors) - > ./a ./index.js 1:0-47 - > ./b ./index.js 2:0-47 - > ./c ./index.js 3:0-47 - ./node_modules/x.js 20 bytes [built] [code generated] - chunk (runtime: main) default/async-b.js (async-b) 116 bytes <{179}> ={282}= ={568}= ={767}= ={954}= [rendered] + chunk (runtime: a, main) default/144.js 20 bytes <{464}> <{472}> <{590}> <{616}> <{744}> <{996}> ={96}= ={272}= ={276}= ={388}= ={472}= ={616}= ={744}= [rendered] split chunk (cache group: default) > ./b ./index.js 2:0-47 - ./b.js 116 bytes [built] [code generated] - chunk (runtime: main) default/async-c.js (async-c) 116 bytes <{179}> ={282}= ={568}= ={767}= ={769}= [rendered] > ./c ./index.js 3:0-47 - ./c.js 116 bytes [built] [code generated] + > ./g ./a.js 6:0-47 + ./f.js 20 bytes [built] [code generated] chunk (runtime: c) default/c.js (c) 196 bytes (javascript) 396 bytes (runtime) [entry] [rendered] > ./c c dependent modules 80 bytes [dependent] 4 modules runtime modules 396 bytes 2 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: a, main) default/568.js 20 bytes <{179}> <{282}> <{767}> <{786}> <{794}> <{954}> ={137}= ={282}= ={334}= ={383}= ={767}= ={769}= ={954}= [rendered] split chunk (cache group: default) + chunk (runtime: main) default/async-b.js (async-b) 116 bytes <{590}> ={144}= ={472}= ={616}= ={744}= [rendered] > ./b ./index.js 2:0-47 + ./b.js 116 bytes [built] [code generated] + chunk (runtime: main) default/async-c.js (async-c) 116 bytes <{590}> ={144}= ={388}= ={472}= ={744}= [rendered] > ./c ./index.js 3:0-47 - > ./g ./a.js 6:0-47 - ./f.js 20 bytes [built] [code generated] - chunk (runtime: main) default/767.js 20 bytes <{179}> ={282}= ={334}= ={383}= ={568}= ={769}= ={794}= ={954}= >{137}< >{568}< [rendered] split chunk (cache group: default) + ./c.js 116 bytes [built] [code generated] + chunk (runtime: main) default/388.js (id hint: vendors) 20 bytes <{590}> ={144}= ={276}= ={472}= ={744}= [rendered] split chunk (cache group: defaultVendors) + > ./c ./index.js 3:0-47 + ./node_modules/z.js 20 bytes [built] [code generated] + chunk (runtime: main) default/async-a.js (async-a) 185 bytes <{590}> ={472}= ={616}= ={744}= >{96}< >{144}< [rendered] + > ./a ./index.js 1:0-47 + ./a.js + 1 modules 185 bytes [built] [code generated] + chunk (runtime: main) default/472.js (id hint: vendors) 20 bytes <{590}> ={144}= ={272}= ={276}= ={388}= ={464}= ={616}= ={744}= >{96}< >{144}< [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 - ./d.js 20 bytes [built] [code generated] - chunk (runtime: main) default/769.js (id hint: vendors) 20 bytes <{179}> ={282}= ={383}= ={568}= ={767}= [rendered] split chunk (cache group: defaultVendors) + ./node_modules/x.js 20 bytes [built] [code generated] + chunk (runtime: b) default/b.js (b) 196 bytes (javascript) 396 bytes (runtime) [entry] [rendered] + > ./b b + dependent modules 80 bytes [dependent] 4 modules + runtime modules 396 bytes 2 modules + ./b.js 116 bytes [built] [code generated] + chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 6.68 KiB (runtime) >{144}< >{272}< >{276}< >{388}< >{464}< >{472}< >{616}< >{744}< [entry] [rendered] + > ./ main + runtime modules 6.68 KiB 9 modules + ./index.js 147 bytes [built] [code generated] + chunk (runtime: main) default/616.js (id hint: vendors) 20 bytes <{590}> ={144}= ={272}= ={464}= ={472}= ={744}= >{96}< >{144}< [rendered] split chunk (cache group: defaultVendors) + > ./a ./index.js 1:0-47 + > ./b ./index.js 2:0-47 + ./node_modules/y.js 20 bytes [built] [code generated] + chunk (runtime: main) default/744.js 20 bytes <{590}> ={144}= ={272}= ={276}= ={388}= ={464}= ={472}= ={616}= >{96}< >{144}< [rendered] split chunk (cache group: default) + > ./a ./index.js 1:0-47 + > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 - ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 6.67 KiB (runtime) >{137}< >{568}< [entry] [rendered] + ./d.js 20 bytes [built] [code generated] + chunk (runtime: a) default/a.js (a) 245 bytes (javascript) 6.67 KiB (runtime) >{96}< >{144}< [entry] [rendered] > ./a a runtime modules 6.67 KiB 9 modules dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [built] [code generated] - chunk (runtime: main) default/async-a.js (async-a) 185 bytes <{179}> ={282}= ={767}= ={954}= >{137}< >{568}< [rendered] - > ./a ./index.js 1:0-47 - ./a.js + 1 modules 185 bytes [built] [code generated] - chunk (runtime: main) default/954.js (id hint: vendors) 20 bytes <{179}> ={282}= ={334}= ={568}= ={767}= ={794}= >{137}< >{568}< [rendered] split chunk (cache group: defaultVendors) - > ./a ./index.js 1:0-47 - > ./b ./index.js 2:0-47 - ./node_modules/y.js 20 bytes [built] [code generated] default (webpack x.x.x) compiled successfully all-chunks: Entrypoint main 11.5 KiB = all-chunks/main.js - Entrypoint a 15 KiB = all-chunks/282.js 412 bytes all-chunks/954.js 412 bytes all-chunks/767.js 412 bytes all-chunks/390.js 412 bytes all-chunks/a.js 13.4 KiB - Entrypoint b 8.13 KiB = all-chunks/282.js 412 bytes all-chunks/954.js 412 bytes all-chunks/767.js 412 bytes all-chunks/568.js 412 bytes all-chunks/b.js 6.52 KiB - Entrypoint c 8.13 KiB = all-chunks/282.js 412 bytes all-chunks/769.js 412 bytes all-chunks/767.js 412 bytes all-chunks/568.js 412 bytes all-chunks/c.js 6.52 KiB - chunk (runtime: b) all-chunks/b.js (b) 116 bytes (javascript) 2.76 KiB (runtime) ={282}= ={568}= ={767}= ={954}= [entry] [rendered] - > ./b b - runtime modules 2.76 KiB 4 modules - ./b.js 116 bytes [built] [code generated] - chunk (runtime: a, main) all-chunks/async-g.js (async-g) 45 bytes <{282}> <{390}> <{767}> <{786}> <{794}> <{954}> ={568}= [rendered] + Entrypoint a 15 KiB = all-chunks/472.js 412 bytes all-chunks/616.js 412 bytes all-chunks/744.js 412 bytes all-chunks/928.js 412 bytes all-chunks/a.js 13.4 KiB + Entrypoint b 8.13 KiB = all-chunks/472.js 412 bytes all-chunks/616.js 412 bytes all-chunks/744.js 412 bytes all-chunks/144.js 412 bytes all-chunks/b.js 6.52 KiB + Entrypoint c 8.13 KiB = all-chunks/472.js 412 bytes all-chunks/388.js 412 bytes all-chunks/744.js 412 bytes all-chunks/144.js 412 bytes all-chunks/c.js 6.52 KiB + chunk (runtime: a, main) all-chunks/async-g.js (async-g) 45 bytes <{464}> <{472}> <{616}> <{744}> <{928}> <{996}> ={144}= [rendered] > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] - chunk (runtime: main) all-chunks/main.js (main) 147 bytes (javascript) 6.68 KiB (runtime) >{282}< >{334}< >{383}< >{390}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered] - > ./ main - runtime modules 6.68 KiB 9 modules - ./index.js 147 bytes [built] [code generated] - chunk (runtime: a, b, c, main) all-chunks/282.js (id hint: vendors) 20 bytes <{179}> ={128}= ={334}= ={383}= ={390}= ={459}= ={568}= ={767}= ={769}= ={786}= ={794}= ={954}= >{137}< >{568}< [initial] [rendered] split chunk (cache group: defaultVendors) - > ./a ./index.js 1:0-47 + chunk (runtime: a, b, c, main) all-chunks/144.js 20 bytes <{464}> <{472}> <{590}> <{616}> <{744}> <{928}> <{996}> ={96}= ={152}= ={272}= ={276}= ={388}= ={472}= ={580}= ={616}= ={744}= [initial] [rendered] split chunk (cache group: default) > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 - > ./a a + > ./g ./a.js 6:0-47 > ./b b > ./c c - ./node_modules/x.js 20 bytes [built] [code generated] - chunk (runtime: main) all-chunks/async-b.js (async-b) 116 bytes <{179}> ={282}= ={568}= ={767}= ={954}= [rendered] + ./f.js 20 bytes [built] [code generated] + chunk (runtime: c) all-chunks/c.js (c) 116 bytes (javascript) 2.76 KiB (runtime) ={144}= ={388}= ={472}= ={744}= [entry] [rendered] + > ./c c + runtime modules 2.76 KiB 4 modules + ./c.js 116 bytes [built] [code generated] + chunk (runtime: main) all-chunks/async-b.js (async-b) 116 bytes <{590}> ={144}= ={472}= ={616}= ={744}= [rendered] > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] - chunk (runtime: main) all-chunks/async-c.js (async-c) 116 bytes <{179}> ={282}= ={568}= ={767}= ={769}= [rendered] + chunk (runtime: main) all-chunks/async-c.js (async-c) 116 bytes <{590}> ={144}= ={388}= ={472}= ={744}= [rendered] > ./c ./index.js 3:0-47 ./c.js 116 bytes [built] [code generated] - chunk (runtime: a, main) all-chunks/390.js 20 bytes <{179}> ={282}= ={767}= ={786}= ={794}= ={954}= >{137}< >{568}< [initial] [rendered] split chunk (cache group: default) + chunk (runtime: c, main) all-chunks/388.js (id hint: vendors) 20 bytes <{590}> ={144}= ={152}= ={276}= ={472}= ={744}= [initial] [rendered] split chunk (cache group: defaultVendors) + > ./c ./index.js 3:0-47 + > ./c c + ./node_modules/z.js 20 bytes [built] [code generated] + chunk (runtime: main) all-chunks/async-a.js (async-a) 165 bytes <{590}> ={472}= ={616}= ={744}= ={928}= >{96}< >{144}< [rendered] + > ./a ./index.js 1:0-47 + ./a.js 165 bytes [built] [code generated] + chunk (runtime: a, b, c, main) all-chunks/472.js (id hint: vendors) 20 bytes <{590}> ={144}= ={152}= ={272}= ={276}= ={388}= ={464}= ={580}= ={616}= ={744}= ={928}= ={996}= >{96}< >{144}< [initial] [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 + > ./b ./index.js 2:0-47 + > ./c ./index.js 3:0-47 > ./a a - ./e.js 20 bytes [built] [code generated] - chunk (runtime: c) all-chunks/c.js (c) 116 bytes (javascript) 2.76 KiB (runtime) ={282}= ={568}= ={767}= ={769}= [entry] [rendered] + > ./b b > ./c c + ./node_modules/x.js 20 bytes [built] [code generated] + chunk (runtime: b) all-chunks/b.js (b) 116 bytes (javascript) 2.76 KiB (runtime) ={144}= ={472}= ={616}= ={744}= [entry] [rendered] + > ./b b runtime modules 2.76 KiB 4 modules - ./c.js 116 bytes [built] [code generated] - chunk (runtime: a, b, c, main) all-chunks/568.js 20 bytes <{179}> <{282}> <{390}> <{767}> <{786}> <{794}> <{954}> ={128}= ={137}= ={282}= ={334}= ={383}= ={459}= ={767}= ={769}= ={954}= [initial] [rendered] split chunk (cache group: default) + ./b.js 116 bytes [built] [code generated] + chunk (runtime: main) all-chunks/main.js (main) 147 bytes (javascript) 6.68 KiB (runtime) >{144}< >{272}< >{276}< >{388}< >{464}< >{472}< >{616}< >{744}< >{928}< [entry] [rendered] + > ./ main + runtime modules 6.68 KiB 9 modules + ./index.js 147 bytes [built] [code generated] + chunk (runtime: a, b, main) all-chunks/616.js (id hint: vendors) 20 bytes <{590}> ={144}= ={272}= ={464}= ={472}= ={580}= ={744}= ={928}= ={996}= >{96}< >{144}< [initial] [rendered] split chunk (cache group: defaultVendors) + > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 - > ./c ./index.js 3:0-47 - > ./g ./a.js 6:0-47 + > ./a a > ./b b - > ./c c - ./f.js 20 bytes [built] [code generated] - chunk (runtime: a, b, c, main) all-chunks/767.js 20 bytes <{179}> ={128}= ={282}= ={334}= ={383}= ={390}= ={459}= ={568}= ={769}= ={786}= ={794}= ={954}= >{137}< >{568}< [initial] [rendered] split chunk (cache group: default) + ./node_modules/y.js 20 bytes [built] [code generated] + chunk (runtime: a, b, c, main) all-chunks/744.js 20 bytes <{590}> ={144}= ={152}= ={272}= ={276}= ={388}= ={464}= ={472}= ={580}= ={616}= ={928}= ={996}= >{96}< >{144}< [initial] [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 @@ -3680,47 +3689,38 @@ all-chunks: > ./b b > ./c c ./d.js 20 bytes [built] [code generated] - chunk (runtime: c, main) all-chunks/769.js (id hint: vendors) 20 bytes <{179}> ={282}= ={383}= ={459}= ={568}= ={767}= [initial] [rendered] split chunk (cache group: defaultVendors) - > ./c ./index.js 3:0-47 - > ./c c - ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: a) all-chunks/a.js (a) 165 bytes (javascript) 7.59 KiB (runtime) ={282}= ={390}= ={767}= ={954}= >{137}< >{568}< [entry] [rendered] + chunk (runtime: a, main) all-chunks/928.js 20 bytes <{590}> ={464}= ={472}= ={616}= ={744}= ={996}= >{96}< >{144}< [initial] [rendered] split chunk (cache group: default) + > ./a ./index.js 1:0-47 + > ./a a + ./e.js 20 bytes [built] [code generated] + chunk (runtime: a) all-chunks/a.js (a) 165 bytes (javascript) 7.59 KiB (runtime) ={472}= ={616}= ={744}= ={928}= >{96}< >{144}< [entry] [rendered] > ./a a runtime modules 7.59 KiB 10 modules ./a.js 165 bytes [built] [code generated] - chunk (runtime: main) all-chunks/async-a.js (async-a) 165 bytes <{179}> ={282}= ={390}= ={767}= ={954}= >{137}< >{568}< [rendered] - > ./a ./index.js 1:0-47 - ./a.js 165 bytes [built] [code generated] - chunk (runtime: a, b, main) all-chunks/954.js (id hint: vendors) 20 bytes <{179}> ={128}= ={282}= ={334}= ={390}= ={568}= ={767}= ={786}= ={794}= >{137}< >{568}< [initial] [rendered] split chunk (cache group: defaultVendors) - > ./a ./index.js 1:0-47 - > ./b ./index.js 2:0-47 - > ./a a - > ./b b - ./node_modules/y.js 20 bytes [built] [code generated] all-chunks (webpack x.x.x) compiled successfully manual: Entrypoint main 11.3 KiB = manual/main.js - Entrypoint a 14.8 KiB = manual/vendors.js 1.04 KiB manual/a.js 13.7 KiB - Entrypoint b 8.44 KiB = manual/vendors.js 1.04 KiB manual/b.js 7.39 KiB - Entrypoint c 8.44 KiB = manual/vendors.js 1.04 KiB manual/c.js 7.39 KiB - chunk (runtime: b) manual/b.js (b) 156 bytes (javascript) 2.76 KiB (runtime) ={216}= [entry] [rendered] - > ./b b - > x b - > y b - > z b - runtime modules 2.76 KiB 4 modules - dependent modules 40 bytes [dependent] 2 modules - ./b.js 116 bytes [built] [code generated] - chunk (runtime: a, main) manual/async-g.js (async-g) 65 bytes <{216}> <{786}> <{794}> [rendered] + Entrypoint a 14.8 KiB = manual/vendors.js 1.04 KiB manual/a.js 13.7 KiB + Entrypoint b 8.44 KiB = manual/vendors.js 1.04 KiB manual/b.js 7.39 KiB + Entrypoint c 8.44 KiB = manual/vendors.js 1.04 KiB manual/c.js 7.39 KiB + chunk (runtime: a, main) manual/async-g.js (async-g) 65 bytes <{275}> <{464}> <{996}> [rendered] > ./g ./a.js 6:0-47 dependent modules 20 bytes [dependent] 1 module ./g.js 45 bytes [built] [code generated] - chunk (runtime: main) manual/main.js (main) 147 bytes (javascript) 6.68 KiB (runtime) >{216}< >{334}< >{383}< >{794}< [entry] [rendered] - > ./ main - runtime modules 6.68 KiB 9 modules - ./index.js 147 bytes [built] [code generated] - chunk (runtime: a, b, c, main) manual/vendors.js (vendors) (id hint: vendors) 60 bytes <{179}> ={128}= ={334}= ={383}= ={459}= ={786}= ={794}= >{137}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + chunk (runtime: c) manual/c.js (c) 156 bytes (javascript) 2.76 KiB (runtime) ={275}= [entry] [rendered] + > ./c c + > x c + > y c + > z c + runtime modules 2.76 KiB 4 modules + dependent modules 40 bytes [dependent] 2 modules + ./c.js 116 bytes [built] [code generated] + chunk (runtime: main) manual/async-b.js (async-b) 156 bytes <{590}> ={275}= [rendered] + > ./b ./index.js 2:0-47 + dependent modules 40 bytes [dependent] 2 modules + ./b.js 116 bytes [built] [code generated] + chunk (runtime: a, b, c, main) manual/vendors.js (vendors) (id hint: vendors) 60 bytes <{590}> ={152}= ={272}= ={276}= ={464}= ={580}= ={996}= >{96}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 @@ -3739,23 +3739,27 @@ manual: ./node_modules/x.js 20 bytes [built] [code generated] ./node_modules/y.js 20 bytes [built] [code generated] ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: main) manual/async-b.js (async-b) 156 bytes <{179}> ={216}= [rendered] - > ./b ./index.js 2:0-47 - dependent modules 40 bytes [dependent] 2 modules - ./b.js 116 bytes [built] [code generated] - chunk (runtime: main) manual/async-c.js (async-c) 156 bytes <{179}> ={216}= [rendered] + chunk (runtime: main) manual/async-c.js (async-c) 156 bytes <{590}> ={275}= [rendered] > ./c ./index.js 3:0-47 dependent modules 40 bytes [dependent] 2 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: c) manual/c.js (c) 156 bytes (javascript) 2.76 KiB (runtime) ={216}= [entry] [rendered] - > ./c c - > x c - > y c - > z c + chunk (runtime: main) manual/async-a.js (async-a) 205 bytes <{590}> ={275}= >{96}< [rendered] + > ./a ./index.js 1:0-47 + dependent modules 20 bytes [dependent] 1 module + ./a.js + 1 modules 185 bytes [built] [code generated] + chunk (runtime: b) manual/b.js (b) 156 bytes (javascript) 2.76 KiB (runtime) ={275}= [entry] [rendered] + > ./b b + > x b + > y b + > z b runtime modules 2.76 KiB 4 modules dependent modules 40 bytes [dependent] 2 modules - ./c.js 116 bytes [built] [code generated] - chunk (runtime: a) manual/a.js (a) 205 bytes (javascript) 7.56 KiB (runtime) ={216}= >{137}< [entry] [rendered] + ./b.js 116 bytes [built] [code generated] + chunk (runtime: main) manual/main.js (main) 147 bytes (javascript) 6.68 KiB (runtime) >{272}< >{275}< >{276}< >{464}< [entry] [rendered] + > ./ main + runtime modules 6.68 KiB 9 modules + ./index.js 147 bytes [built] [code generated] + chunk (runtime: a) manual/a.js (a) 205 bytes (javascript) 7.56 KiB (runtime) ={275}= >{96}< [entry] [rendered] > ./a a > x a > y a @@ -3763,180 +3767,168 @@ manual: runtime modules 7.56 KiB 10 modules dependent modules 20 bytes [dependent] 1 module ./a.js + 1 modules 185 bytes [built] [code generated] - chunk (runtime: main) manual/async-a.js (async-a) 205 bytes <{179}> ={216}= >{137}< [rendered] - > ./a ./index.js 1:0-47 - dependent modules 20 bytes [dependent] 1 module - ./a.js + 1 modules 185 bytes [built] [code generated] manual (webpack x.x.x) compiled successfully name-too-long: Entrypoint main 11.5 KiB = name-too-long/main.js - Entrypoint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 15 KiB = name-too-long/282.js 412 bytes name-too-long/954.js 412 bytes name-too-long/767.js 412 bytes name-too-long/390.js 412 bytes name-too-long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js 13.4 KiB - Entrypoint bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 8.13 KiB = name-too-long/282.js 412 bytes name-too-long/954.js 412 bytes name-too-long/767.js 412 bytes name-too-long/568.js 412 bytes name-too-long/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js 6.52 KiB - Entrypoint cccccccccccccccccccccccccccccc 8.13 KiB = name-too-long/282.js 412 bytes name-too-long/769.js 412 bytes name-too-long/767.js 412 bytes name-too-long/568.js 412 bytes name-too-long/cccccccccccccccccccccccccccccc.js 6.52 KiB - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, main) name-too-long/async-g.js (async-g) 45 bytes <{282}> <{390}> <{751}> <{767}> <{794}> <{954}> ={568}= [rendered] + Entrypoint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 15 KiB = name-too-long/472.js 412 bytes name-too-long/616.js 412 bytes name-too-long/744.js 412 bytes name-too-long/928.js 412 bytes name-too-long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js 13.4 KiB + Entrypoint bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 8.13 KiB = name-too-long/472.js 412 bytes name-too-long/616.js 412 bytes name-too-long/744.js 412 bytes name-too-long/144.js 412 bytes name-too-long/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js 6.52 KiB + Entrypoint cccccccccccccccccccccccccccccc 8.13 KiB = name-too-long/472.js 412 bytes name-too-long/388.js 412 bytes name-too-long/744.js 412 bytes name-too-long/144.js 412 bytes name-too-long/cccccccccccccccccccccccccccccc.js 6.52 KiB + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, main) name-too-long/async-g.js (async-g) 45 bytes <{464}> <{472}> <{616}> <{744}> <{820}> <{928}> ={144}= [rendered] > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] - chunk (runtime: main) name-too-long/main.js (main) 147 bytes (javascript) 6.68 KiB (runtime) >{282}< >{334}< >{383}< >{390}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered] - > ./ main - runtime modules 6.68 KiB 9 modules - ./index.js 147 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccc, main) name-too-long/282.js (id hint: vendors) 20 bytes <{179}> ={334}= ={383}= ={390}= ={568}= ={658}= ={751}= ={766}= ={767}= ={769}= ={794}= ={954}= >{137}< >{568}< [initial] [rendered] split chunk (cache group: defaultVendors) - > ./a ./index.js 1:0-47 + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccc, main) name-too-long/144.js 20 bytes <{464}> <{472}> <{590}> <{616}> <{744}> <{820}> <{928}> ={96}= ={272}= ={276}= ={388}= ={416}= ={472}= ={616}= ={744}= ={856}= [initial] [rendered] split chunk (cache group: default) > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 - > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + > ./g ./a.js 6:0-47 > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > ./c cccccccccccccccccccccccccccccc - ./node_modules/x.js 20 bytes [built] [code generated] - chunk (runtime: main) name-too-long/async-b.js (async-b) 116 bytes <{179}> ={282}= ={568}= ={767}= ={954}= [rendered] + ./f.js 20 bytes [built] [code generated] + chunk (runtime: main) name-too-long/async-b.js (async-b) 116 bytes <{590}> ={144}= ={472}= ={616}= ={744}= [rendered] > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] - chunk (runtime: main) name-too-long/async-c.js (async-c) 116 bytes <{179}> ={282}= ={568}= ={767}= ={769}= [rendered] + chunk (runtime: main) name-too-long/async-c.js (async-c) 116 bytes <{590}> ={144}= ={388}= ={472}= ={744}= [rendered] > ./c ./index.js 3:0-47 ./c.js 116 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, main) name-too-long/390.js 20 bytes <{179}> ={282}= ={751}= ={767}= ={794}= ={954}= >{137}< >{568}< [initial] [rendered] split chunk (cache group: default) - > ./a ./index.js 1:0-47 - > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - ./e.js 20 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccc, main) name-too-long/568.js 20 bytes <{179}> <{282}> <{390}> <{751}> <{767}> <{794}> <{954}> ={137}= ={282}= ={334}= ={383}= ={658}= ={766}= ={767}= ={769}= ={954}= [initial] [rendered] split chunk (cache group: default) - > ./b ./index.js 2:0-47 + chunk (runtime: cccccccccccccccccccccccccccccc, main) name-too-long/388.js (id hint: vendors) 20 bytes <{590}> ={144}= ={276}= ={416}= ={472}= ={744}= [initial] [rendered] split chunk (cache group: defaultVendors) > ./c ./index.js 3:0-47 - > ./g ./a.js 6:0-47 - > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > ./c cccccccccccccccccccccccccccccc - ./f.js 20 bytes [built] [code generated] - chunk (runtime: cccccccccccccccccccccccccccccc) name-too-long/cccccccccccccccccccccccccccccc.js (cccccccccccccccccccccccccccccc) 116 bytes (javascript) 2.76 KiB (runtime) ={282}= ={568}= ={767}= ={769}= [entry] [rendered] + ./node_modules/z.js 20 bytes [built] [code generated] + chunk (runtime: cccccccccccccccccccccccccccccc) name-too-long/cccccccccccccccccccccccccccccc.js (cccccccccccccccccccccccccccccc) 116 bytes (javascript) 2.76 KiB (runtime) ={144}= ={388}= ={472}= ={744}= [entry] [rendered] > ./c cccccccccccccccccccccccccccccc runtime modules 2.76 KiB 4 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) name-too-long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 165 bytes (javascript) 7.6 KiB (runtime) ={282}= ={390}= ={767}= ={954}= >{137}< >{568}< [entry] [rendered] - > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - runtime modules 7.6 KiB 10 modules + chunk (runtime: main) name-too-long/async-a.js (async-a) 165 bytes <{590}> ={472}= ={616}= ={744}= ={928}= >{96}< >{144}< [rendered] + > ./a ./index.js 1:0-47 ./a.js 165 bytes [built] [code generated] - chunk (runtime: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) name-too-long/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 116 bytes (javascript) 2.76 KiB (runtime) ={282}= ={568}= ={767}= ={954}= [entry] [rendered] - > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb - runtime modules 2.76 KiB 4 modules - ./b.js 116 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccc, main) name-too-long/767.js 20 bytes <{179}> ={282}= ={334}= ={383}= ={390}= ={568}= ={658}= ={751}= ={766}= ={769}= ={794}= ={954}= >{137}< >{568}< [initial] [rendered] split chunk (cache group: default) + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccc, main) name-too-long/472.js (id hint: vendors) 20 bytes <{590}> ={144}= ={272}= ={276}= ={388}= ={416}= ={464}= ={616}= ={744}= ={820}= ={856}= ={928}= >{96}< >{144}< [initial] [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > ./c cccccccccccccccccccccccccccccc - ./d.js 20 bytes [built] [code generated] - chunk (runtime: cccccccccccccccccccccccccccccc, main) name-too-long/769.js (id hint: vendors) 20 bytes <{179}> ={282}= ={383}= ={568}= ={658}= ={767}= [initial] [rendered] split chunk (cache group: defaultVendors) - > ./c ./index.js 3:0-47 - > ./c cccccccccccccccccccccccccccccc - ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: main) name-too-long/async-a.js (async-a) 165 bytes <{179}> ={282}= ={390}= ={767}= ={954}= >{137}< >{568}< [rendered] - > ./a ./index.js 1:0-47 - ./a.js 165 bytes [built] [code generated] - chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, main) name-too-long/954.js (id hint: vendors) 20 bytes <{179}> ={282}= ={334}= ={390}= ={568}= ={751}= ={766}= ={767}= ={794}= >{137}< >{568}< [initial] [rendered] split chunk (cache group: defaultVendors) + ./node_modules/x.js 20 bytes [built] [code generated] + chunk (runtime: main) name-too-long/main.js (main) 147 bytes (javascript) 6.68 KiB (runtime) >{144}< >{272}< >{276}< >{388}< >{464}< >{472}< >{616}< >{744}< >{928}< [entry] [rendered] + > ./ main + runtime modules 6.68 KiB 9 modules + ./index.js 147 bytes [built] [code generated] + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, main) name-too-long/616.js (id hint: vendors) 20 bytes <{590}> ={144}= ={272}= ={464}= ={472}= ={744}= ={820}= ={856}= ={928}= >{96}< >{144}< [initial] [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ./node_modules/y.js 20 bytes [built] [code generated] + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccccccc, main) name-too-long/744.js 20 bytes <{590}> ={144}= ={272}= ={276}= ={388}= ={416}= ={464}= ={472}= ={616}= ={820}= ={856}= ={928}= >{96}< >{144}< [initial] [rendered] split chunk (cache group: default) + > ./a ./index.js 1:0-47 + > ./b ./index.js 2:0-47 + > ./c ./index.js 3:0-47 + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + > ./c cccccccccccccccccccccccccccccc + ./d.js 20 bytes [built] [code generated] + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) name-too-long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 165 bytes (javascript) 7.6 KiB (runtime) ={472}= ={616}= ={744}= ={928}= >{96}< >{144}< [entry] [rendered] + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + runtime modules 7.6 KiB 10 modules + ./a.js 165 bytes [built] [code generated] + chunk (runtime: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) name-too-long/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 116 bytes (javascript) 2.76 KiB (runtime) ={144}= ={472}= ={616}= ={744}= [entry] [rendered] + > ./b bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + runtime modules 2.76 KiB 4 modules + ./b.js 116 bytes [built] [code generated] + chunk (runtime: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, main) name-too-long/928.js 20 bytes <{590}> ={464}= ={472}= ={616}= ={744}= ={820}= >{96}< >{144}< [initial] [rendered] split chunk (cache group: default) + > ./a ./index.js 1:0-47 + > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + ./e.js 20 bytes [built] [code generated] name-too-long (webpack x.x.x) compiled successfully custom-chunks-filter: Entrypoint main 11.5 KiB = custom-chunks-filter/main.js Entrypoint a 12.6 KiB = custom-chunks-filter/a.js - Entrypoint b 8.13 KiB = custom-chunks-filter/282.js 412 bytes custom-chunks-filter/954.js 412 bytes custom-chunks-filter/568.js 412 bytes custom-chunks-filter/767.js 412 bytes custom-chunks-filter/b.js 6.52 KiB - Entrypoint c 8.13 KiB = custom-chunks-filter/282.js 412 bytes custom-chunks-filter/769.js 412 bytes custom-chunks-filter/568.js 412 bytes custom-chunks-filter/767.js 412 bytes custom-chunks-filter/c.js 6.52 KiB - chunk (runtime: b) custom-chunks-filter/b.js (b) 116 bytes (javascript) 2.76 KiB (runtime) ={282}= ={568}= ={767}= ={954}= [entry] [rendered] - > ./b b - runtime modules 2.76 KiB 4 modules - ./b.js 116 bytes [built] [code generated] - chunk (runtime: a, main) custom-chunks-filter/async-g.js (async-g) 45 bytes <{282}> <{767}> <{786}> <{794}> <{954}> ={568}= [rendered] + Entrypoint b 8.13 KiB = custom-chunks-filter/472.js 412 bytes custom-chunks-filter/616.js 412 bytes custom-chunks-filter/144.js 412 bytes custom-chunks-filter/744.js 412 bytes custom-chunks-filter/b.js 6.52 KiB + Entrypoint c 8.13 KiB = custom-chunks-filter/472.js 412 bytes custom-chunks-filter/388.js 412 bytes custom-chunks-filter/144.js 412 bytes custom-chunks-filter/744.js 412 bytes custom-chunks-filter/c.js 6.52 KiB + chunk (runtime: a, main) custom-chunks-filter/async-g.js (async-g) 45 bytes <{464}> <{472}> <{616}> <{744}> <{996}> ={144}= [rendered] > ./g ./a.js 6:0-47 ./g.js 45 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter/main.js (main) 147 bytes (javascript) 6.69 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered] - > ./ main - runtime modules 6.69 KiB 9 modules - ./index.js 147 bytes [built] [code generated] - chunk (runtime: b, c, main) custom-chunks-filter/282.js (id hint: vendors) 20 bytes <{179}> ={128}= ={334}= ={383}= ={459}= ={568}= ={767}= ={769}= ={794}= ={954}= >{137}< >{568}< [initial] [rendered] split chunk (cache group: defaultVendors) - > ./a ./index.js 1:0-47 + chunk (runtime: a, b, c, main) custom-chunks-filter/144.js 20 bytes <{464}> <{472}> <{590}> <{616}> <{744}> <{996}> ={96}= ={152}= ={272}= ={276}= ={388}= ={472}= ={580}= ={616}= ={744}= [initial] [rendered] split chunk (cache group: default) > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 + > ./g ./a.js 6:0-47 > ./b b > ./c c - ./node_modules/x.js 20 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter/async-b.js (async-b) 116 bytes <{179}> ={282}= ={568}= ={767}= ={954}= [rendered] + ./f.js 20 bytes [built] [code generated] + chunk (runtime: c) custom-chunks-filter/c.js (c) 116 bytes (javascript) 2.76 KiB (runtime) ={144}= ={388}= ={472}= ={744}= [entry] [rendered] + > ./c c + runtime modules 2.76 KiB 4 modules + ./c.js 116 bytes [built] [code generated] + chunk (runtime: main) custom-chunks-filter/async-b.js (async-b) 116 bytes <{590}> ={144}= ={472}= ={616}= ={744}= [rendered] > ./b ./index.js 2:0-47 ./b.js 116 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter/async-c.js (async-c) 116 bytes <{179}> ={282}= ={568}= ={767}= ={769}= [rendered] + chunk (runtime: main) custom-chunks-filter/async-c.js (async-c) 116 bytes <{590}> ={144}= ={388}= ={472}= ={744}= [rendered] > ./c ./index.js 3:0-47 ./c.js 116 bytes [built] [code generated] - chunk (runtime: c) custom-chunks-filter/c.js (c) 116 bytes (javascript) 2.76 KiB (runtime) ={282}= ={568}= ={767}= ={769}= [entry] [rendered] + chunk (runtime: c, main) custom-chunks-filter/388.js (id hint: vendors) 20 bytes <{590}> ={144}= ={152}= ={276}= ={472}= ={744}= [initial] [rendered] split chunk (cache group: defaultVendors) + > ./c ./index.js 3:0-47 > ./c c - runtime modules 2.76 KiB 4 modules - ./c.js 116 bytes [built] [code generated] - chunk (runtime: a, b, c, main) custom-chunks-filter/568.js 20 bytes <{179}> <{282}> <{767}> <{786}> <{794}> <{954}> ={128}= ={137}= ={282}= ={334}= ={383}= ={459}= ={767}= ={769}= ={954}= [initial] [rendered] split chunk (cache group: default) + ./node_modules/z.js 20 bytes [built] [code generated] + chunk (runtime: main) custom-chunks-filter/async-a.js (async-a) 185 bytes <{590}> ={472}= ={616}= ={744}= >{96}< >{144}< [rendered] + > ./a ./index.js 1:0-47 + ./a.js + 1 modules 185 bytes [built] [code generated] + chunk (runtime: b, c, main) custom-chunks-filter/472.js (id hint: vendors) 20 bytes <{590}> ={144}= ={152}= ={272}= ={276}= ={388}= ={464}= ={580}= ={616}= ={744}= >{96}< >{144}< [initial] [rendered] split chunk (cache group: defaultVendors) + > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 - > ./g ./a.js 6:0-47 > ./b b > ./c c - ./f.js 20 bytes [built] [code generated] - chunk (runtime: b, c, main) custom-chunks-filter/767.js 20 bytes <{179}> ={128}= ={282}= ={334}= ={383}= ={459}= ={568}= ={769}= ={794}= ={954}= >{137}< >{568}< [initial] [rendered] split chunk (cache group: default) + ./node_modules/x.js 20 bytes [built] [code generated] + chunk (runtime: b) custom-chunks-filter/b.js (b) 116 bytes (javascript) 2.76 KiB (runtime) ={144}= ={472}= ={616}= ={744}= [entry] [rendered] + > ./b b + runtime modules 2.76 KiB 4 modules + ./b.js 116 bytes [built] [code generated] + chunk (runtime: main) custom-chunks-filter/main.js (main) 147 bytes (javascript) 6.69 KiB (runtime) >{144}< >{272}< >{276}< >{388}< >{464}< >{472}< >{616}< >{744}< [entry] [rendered] + > ./ main + runtime modules 6.69 KiB 9 modules + ./index.js 147 bytes [built] [code generated] + chunk (runtime: b, main) custom-chunks-filter/616.js (id hint: vendors) 20 bytes <{590}> ={144}= ={272}= ={464}= ={472}= ={580}= ={744}= >{96}< >{144}< [initial] [rendered] split chunk (cache group: defaultVendors) + > ./a ./index.js 1:0-47 + > ./b ./index.js 2:0-47 + > ./b b + ./node_modules/y.js 20 bytes [built] [code generated] + chunk (runtime: b, c, main) custom-chunks-filter/744.js 20 bytes <{590}> ={144}= ={152}= ={272}= ={276}= ={388}= ={464}= ={472}= ={580}= ={616}= >{96}< >{144}< [initial] [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 > ./b b > ./c c ./d.js 20 bytes [built] [code generated] - chunk (runtime: c, main) custom-chunks-filter/769.js (id hint: vendors) 20 bytes <{179}> ={282}= ={383}= ={459}= ={568}= ={767}= [initial] [rendered] split chunk (cache group: defaultVendors) - > ./c ./index.js 3:0-47 - > ./c c - ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: a) custom-chunks-filter/a.js (a) 245 bytes (javascript) 6.68 KiB (runtime) >{137}< >{568}< [entry] [rendered] + chunk (runtime: a) custom-chunks-filter/a.js (a) 245 bytes (javascript) 6.68 KiB (runtime) >{96}< >{144}< [entry] [rendered] > ./a a runtime modules 6.68 KiB 9 modules dependent modules 60 bytes [dependent] 3 modules ./a.js + 1 modules 185 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter/async-a.js (async-a) 185 bytes <{179}> ={282}= ={767}= ={954}= >{137}< >{568}< [rendered] - > ./a ./index.js 1:0-47 - ./a.js + 1 modules 185 bytes [built] [code generated] - chunk (runtime: b, main) custom-chunks-filter/954.js (id hint: vendors) 20 bytes <{179}> ={128}= ={282}= ={334}= ={568}= ={767}= ={794}= >{137}< >{568}< [initial] [rendered] split chunk (cache group: defaultVendors) - > ./a ./index.js 1:0-47 - > ./b ./index.js 2:0-47 - > ./b b - ./node_modules/y.js 20 bytes [built] [code generated] custom-chunks-filter (webpack x.x.x) compiled successfully custom-chunks-filter-in-cache-groups: Entrypoint main 11.3 KiB = custom-chunks-filter-in-cache-groups/main.js - Entrypoint a 14.6 KiB = custom-chunks-filter-in-cache-groups/176.js 860 bytes custom-chunks-filter-in-cache-groups/a.js 13.8 KiB + Entrypoint a 14.6 KiB = custom-chunks-filter-in-cache-groups/892.js 860 bytes custom-chunks-filter-in-cache-groups/a.js 13.8 KiB Entrypoint b 8.44 KiB = custom-chunks-filter-in-cache-groups/vendors.js 1.05 KiB custom-chunks-filter-in-cache-groups/b.js 7.39 KiB Entrypoint c 8.44 KiB = custom-chunks-filter-in-cache-groups/vendors.js 1.05 KiB custom-chunks-filter-in-cache-groups/c.js 7.39 KiB - chunk (runtime: b) custom-chunks-filter-in-cache-groups/b.js (b) 156 bytes (javascript) 2.76 KiB (runtime) ={216}= [entry] [rendered] - > ./b b - > x b - > y b - > z b - runtime modules 2.76 KiB 4 modules - dependent modules 40 bytes [dependent] 2 modules - ./b.js 116 bytes [built] [code generated] - chunk (runtime: a, main) custom-chunks-filter-in-cache-groups/async-g.js (async-g) 65 bytes <{176}> <{216}> <{786}> <{794}> [rendered] + chunk (runtime: a, main) custom-chunks-filter-in-cache-groups/async-g.js (async-g) 65 bytes <{275}> <{464}> <{892}> <{996}> [rendered] > ./g ./a.js 6:0-47 dependent modules 20 bytes [dependent] 1 module ./g.js 45 bytes [built] [code generated] - chunk (runtime: a) custom-chunks-filter-in-cache-groups/176.js (id hint: vendors) 60 bytes ={786}= >{137}< [initial] [rendered] split chunk (cache group: defaultVendors) - > ./a a - > x a - > y a - > z a - ./node_modules/x.js 20 bytes [built] [code generated] - ./node_modules/y.js 20 bytes [built] [code generated] - ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter-in-cache-groups/main.js (main) 147 bytes (javascript) 6.71 KiB (runtime) >{216}< >{334}< >{383}< >{794}< [entry] [rendered] - > ./ main - runtime modules 6.71 KiB 9 modules - ./index.js 147 bytes [built] [code generated] - chunk (runtime: b, c, main) custom-chunks-filter-in-cache-groups/vendors.js (vendors) (id hint: vendors) 60 bytes <{179}> ={128}= ={334}= ={383}= ={459}= ={794}= >{137}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + chunk (runtime: c) custom-chunks-filter-in-cache-groups/c.js (c) 156 bytes (javascript) 2.76 KiB (runtime) ={275}= [entry] [rendered] + > ./c c + > x c + > y c + > z c + runtime modules 2.76 KiB 4 modules + dependent modules 40 bytes [dependent] 2 modules + ./c.js 116 bytes [built] [code generated] + chunk (runtime: main) custom-chunks-filter-in-cache-groups/async-b.js (async-b) 156 bytes <{590}> ={275}= [rendered] + > ./b ./index.js 2:0-47 + dependent modules 40 bytes [dependent] 2 modules + ./b.js 116 bytes [built] [code generated] + chunk (runtime: b, c, main) custom-chunks-filter-in-cache-groups/vendors.js (vendors) (id hint: vendors) 60 bytes <{590}> ={152}= ={272}= ={276}= ={464}= ={580}= >{96}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 @@ -3951,23 +3943,35 @@ custom-chunks-filter-in-cache-groups: ./node_modules/x.js 20 bytes [built] [code generated] ./node_modules/y.js 20 bytes [built] [code generated] ./node_modules/z.js 20 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter-in-cache-groups/async-b.js (async-b) 156 bytes <{179}> ={216}= [rendered] - > ./b ./index.js 2:0-47 - dependent modules 40 bytes [dependent] 2 modules - ./b.js 116 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter-in-cache-groups/async-c.js (async-c) 156 bytes <{179}> ={216}= [rendered] + chunk (runtime: main) custom-chunks-filter-in-cache-groups/async-c.js (async-c) 156 bytes <{590}> ={275}= [rendered] > ./c ./index.js 3:0-47 dependent modules 40 bytes [dependent] 2 modules ./c.js 116 bytes [built] [code generated] - chunk (runtime: c) custom-chunks-filter-in-cache-groups/c.js (c) 156 bytes (javascript) 2.76 KiB (runtime) ={216}= [entry] [rendered] - > ./c c - > x c - > y c - > z c + chunk (runtime: main) custom-chunks-filter-in-cache-groups/async-a.js (async-a) 205 bytes <{590}> ={275}= >{96}< [rendered] + > ./a ./index.js 1:0-47 + dependent modules 20 bytes [dependent] 1 module + ./a.js + 1 modules 185 bytes [built] [code generated] + chunk (runtime: b) custom-chunks-filter-in-cache-groups/b.js (b) 156 bytes (javascript) 2.76 KiB (runtime) ={275}= [entry] [rendered] + > ./b b + > x b + > y b + > z b runtime modules 2.76 KiB 4 modules dependent modules 40 bytes [dependent] 2 modules - ./c.js 116 bytes [built] [code generated] - chunk (runtime: a) custom-chunks-filter-in-cache-groups/a.js (a) 205 bytes (javascript) 7.59 KiB (runtime) ={176}= >{137}< [entry] [rendered] + ./b.js 116 bytes [built] [code generated] + chunk (runtime: main) custom-chunks-filter-in-cache-groups/main.js (main) 147 bytes (javascript) 6.71 KiB (runtime) >{272}< >{275}< >{276}< >{464}< [entry] [rendered] + > ./ main + runtime modules 6.71 KiB 9 modules + ./index.js 147 bytes [built] [code generated] + chunk (runtime: a) custom-chunks-filter-in-cache-groups/892.js (id hint: vendors) 60 bytes ={996}= >{96}< [initial] [rendered] split chunk (cache group: defaultVendors) + > ./a a + > x a + > y a + > z a + ./node_modules/x.js 20 bytes [built] [code generated] + ./node_modules/y.js 20 bytes [built] [code generated] + ./node_modules/z.js 20 bytes [built] [code generated] + chunk (runtime: a) custom-chunks-filter-in-cache-groups/a.js (a) 205 bytes (javascript) 7.59 KiB (runtime) ={892}= >{96}< [entry] [rendered] > ./a a > x a > y a @@ -3975,10 +3979,6 @@ custom-chunks-filter-in-cache-groups: runtime modules 7.59 KiB 10 modules dependent modules 20 bytes [dependent] 1 module ./a.js + 1 modules 185 bytes [built] [code generated] - chunk (runtime: main) custom-chunks-filter-in-cache-groups/async-a.js (async-a) 205 bytes <{179}> ={216}= >{137}< [rendered] - > ./a ./index.js 1:0-47 - dependent modules 20 bytes [dependent] 1 module - ./a.js + 1 modules 185 bytes [built] [code generated] custom-chunks-filter-in-cache-groups (webpack x.x.x) compiled successfully" `; @@ -4023,56 +4023,56 @@ production (webpack x.x.x) compiled successfully" exports[`StatsTestCases should print correct stats for split-chunks-chunk-name 1`] = ` "Entrypoint main 11.2 KiB = default/main.js -chunk (runtime: main) default/main.js (main) 192 bytes (javascript) 6.65 KiB (runtime) >{334}< >{709}< >{794}< [entry] [rendered] - > ./ main - runtime modules 6.65 KiB 9 modules - ./index.js 192 bytes [built] [code generated] -chunk (runtime: main) default/async-b.js (async-b) (id hint: vendors) 122 bytes <{179}> [rendered] reused as split chunk (cache group: defaultVendors) - > b ./index.js 2:0-45 - ./node_modules/b.js 122 bytes [built] [code generated] -chunk (runtime: main) default/async-c-1.js (async-c-1) (id hint: vendors) 122 bytes <{179}> [rendered] reused as split chunk (cache group: defaultVendors) +chunk (runtime: main) default/async-c-1.js (async-c-1) (id hint: vendors) 122 bytes <{590}> [rendered] reused as split chunk (cache group: defaultVendors) > c ./index.js 3:0-47 > c ./index.js 4:0-47 ./node_modules/c.js 122 bytes [built] [code generated] -chunk (runtime: main) default/async-a.js (async-a) 20 bytes <{179}> [rendered] +chunk (runtime: main) default/async-b.js (async-b) (id hint: vendors) 122 bytes <{590}> [rendered] reused as split chunk (cache group: defaultVendors) + > b ./index.js 2:0-45 + ./node_modules/b.js 122 bytes [built] [code generated] +chunk (runtime: main) default/async-a.js (async-a) 20 bytes <{590}> [rendered] > a ./index.js 1:0-45 ./node_modules/a.js 20 bytes [built] [code generated] +chunk (runtime: main) default/main.js (main) 192 bytes (javascript) 6.65 KiB (runtime) >{136}< >{272}< >{464}< [entry] [rendered] + > ./ main + runtime modules 6.65 KiB 9 modules + ./index.js 192 bytes [built] [code generated] webpack x.x.x compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-combinations 1`] = ` "Entrypoint main 11.7 KiB = main.js -chunk (runtime: main) async-d.js (async-d) 132 bytes <{179}> [rendered] - > ./d ./index.js 4:0-47 - dependent modules 87 bytes [dependent] 1 module - ./d.js 45 bytes [built] [code generated] -chunk (runtime: main) async-g.js (async-g) 132 bytes <{179}> [rendered] +chunk (runtime: main) async-g.js (async-g) 132 bytes <{590}> [rendered] > ./g ./index.js 7:0-47 dependent modules 87 bytes [dependent] 1 module ./g.js 45 bytes [built] [code generated] -chunk (runtime: main) main.js (main) 343 bytes (javascript) 6.71 KiB (runtime) >{31}< >{137}< >{206}< >{334}< >{383}< >{449}< >{794}< >{804}< [entry] [rendered] - > ./ main - runtime modules 6.71 KiB 9 modules - ./index.js 343 bytes [built] [code generated] -chunk (runtime: main) async-f.js (async-f) 132 bytes <{179}> [rendered] - > ./f ./index.js 6:0-47 - dependent modules 87 bytes [dependent] 1 module - ./f.js 45 bytes [built] [code generated] -chunk (runtime: main) async-b.js (async-b) 70 bytes <{179}> ={804}= [rendered] +chunk (runtime: main) async-b.js (async-b) 70 bytes <{590}> ={712}= [rendered] > ./b ./index.js 2:0-47 ./b.js 70 bytes [built] [code generated] -chunk (runtime: main) async-c.js (async-c) 132 bytes <{179}> [rendered] +chunk (runtime: main) async-c.js (async-c) 132 bytes <{590}> [rendered] > ./c ./index.js 3:0-47 dependent modules 87 bytes [dependent] 1 module ./c.js 45 bytes [built] [code generated] -chunk (runtime: main) async-e.js (async-e) 132 bytes <{179}> [rendered] - > ./e ./index.js 5:0-47 +chunk (runtime: main) async-f.js (async-f) 132 bytes <{590}> [rendered] + > ./f ./index.js 6:0-47 dependent modules 87 bytes [dependent] 1 module - ./e.js 45 bytes [built] [code generated] -chunk (runtime: main) async-a.js (async-a) 70 bytes <{179}> ={804}= [rendered] + ./f.js 45 bytes [built] [code generated] +chunk (runtime: main) async-a.js (async-a) 70 bytes <{590}> ={712}= [rendered] > ./a ./index.js 1:0-47 ./a.js 70 bytes [built] [code generated] -chunk (runtime: main) 804.js 174 bytes <{179}> ={334}= ={794}= [rendered] split chunk (cache group: default) +chunk (runtime: main) async-e.js (async-e) 132 bytes <{590}> [rendered] + > ./e ./index.js 5:0-47 + dependent modules 87 bytes [dependent] 1 module + ./e.js 45 bytes [built] [code generated] +chunk (runtime: main) main.js (main) 343 bytes (javascript) 6.71 KiB (runtime) >{96}< >{272}< >{276}< >{288}< >{464}< >{476}< >{668}< >{712}< [entry] [rendered] + > ./ main + runtime modules 6.71 KiB 9 modules + ./index.js 343 bytes [built] [code generated] +chunk (runtime: main) async-d.js (async-d) 132 bytes <{590}> [rendered] + > ./d ./index.js 4:0-47 + dependent modules 87 bytes [dependent] 1 module + ./d.js 45 bytes [built] [code generated] +chunk (runtime: main) 712.js 174 bytes <{590}> ={272}= ={464}= [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 ./x.js 87 bytes [built] [code generated] @@ -4082,68 +4082,68 @@ webpack x.x.x compiled successfully" exports[`StatsTestCases should print correct stats for split-chunks-issue-6413 1`] = ` "Entrypoint main 11.3 KiB = main.js -chunk (runtime: main) main.js (main) 147 bytes (javascript) 6.65 KiB (runtime) >{282}< >{334}< >{383}< >{543}< >{794}< [entry] [rendered] - > ./ main - runtime modules 6.65 KiB 9 modules - ./index.js 147 bytes [built] [code generated] -chunk (runtime: main) 282.js (id hint: vendors) 20 bytes <{179}> ={334}= ={383}= ={543}= ={794}= [rendered] split chunk (cache group: defaultVendors) +chunk (runtime: main) 176.js 45 bytes <{590}> ={272}= ={276}= ={464}= ={472}= [rendered] split chunk (cache group: default) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 - ./node_modules/x.js 20 bytes [built] [code generated] -chunk (runtime: main) async-b.js (async-b) 36 bytes <{179}> ={282}= ={543}= [rendered] + ./common.js 45 bytes [built] [code generated] +chunk (runtime: main) async-b.js (async-b) 36 bytes <{590}> ={176}= ={472}= [rendered] > ./b ./index.js 2:0-47 ./b.js 36 bytes [built] [code generated] -chunk (runtime: main) async-c.js (async-c) 36 bytes <{179}> ={282}= ={543}= [rendered] +chunk (runtime: main) async-c.js (async-c) 36 bytes <{590}> ={176}= ={472}= [rendered] > ./c ./index.js 3:0-47 ./c.js 36 bytes [built] [code generated] -chunk (runtime: main) 543.js 45 bytes <{179}> ={282}= ={334}= ={383}= ={794}= [rendered] split chunk (cache group: default) +chunk (runtime: main) async-a.js (async-a) 36 bytes <{590}> ={176}= ={472}= [rendered] + > ./a ./index.js 1:0-47 + ./a.js 36 bytes [built] [code generated] +chunk (runtime: main) 472.js (id hint: vendors) 20 bytes <{590}> ={176}= ={272}= ={276}= ={464}= [rendered] split chunk (cache group: defaultVendors) > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 - ./common.js 45 bytes [built] [code generated] -chunk (runtime: main) async-a.js (async-a) 36 bytes <{179}> ={282}= ={543}= [rendered] - > ./a ./index.js 1:0-47 - ./a.js 36 bytes [built] [code generated] + ./node_modules/x.js 20 bytes [built] [code generated] +chunk (runtime: main) main.js (main) 147 bytes (javascript) 6.65 KiB (runtime) >{176}< >{272}< >{276}< >{464}< >{472}< [entry] [rendered] + > ./ main + runtime modules 6.65 KiB 9 modules + ./index.js 147 bytes [built] [code generated] default (webpack x.x.x) compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-issue-6696 1`] = ` "Entrypoint main 13.4 KiB = vendors.js 412 bytes main.js 13 KiB -chunk (runtime: main) main.js (main) 134 bytes (javascript) 7.57 KiB (runtime) ={216}= >{334}< >{794}< [entry] [rendered] - > ./ main - runtime modules 7.57 KiB 10 modules - ./index.js 134 bytes [built] [code generated] -chunk (runtime: main) vendors.js (vendors) (id hint: vendors) 20 bytes ={179}= >{334}< >{794}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) - > ./ main - ./node_modules/y.js 20 bytes [built] [code generated] -chunk (runtime: main) async-b.js (async-b) 49 bytes <{179}> <{216}> [rendered] +chunk (runtime: main) async-b.js (async-b) 49 bytes <{275}> <{590}> [rendered] > ./b ./index.js 3:0-47 dependent modules 20 bytes [dependent] 1 module ./b.js 29 bytes [built] [code generated] -chunk (runtime: main) async-a.js (async-a) 49 bytes <{179}> <{216}> [rendered] +chunk (runtime: main) vendors.js (vendors) (id hint: vendors) 20 bytes ={590}= >{272}< >{464}< [initial] [rendered] split chunk (cache group: vendors) (name: vendors) + > ./ main + ./node_modules/y.js 20 bytes [built] [code generated] +chunk (runtime: main) async-a.js (async-a) 49 bytes <{275}> <{590}> [rendered] > ./a ./index.js 2:0-47 dependent modules 20 bytes [dependent] 1 module ./a.js 29 bytes [built] [code generated] +chunk (runtime: main) main.js (main) 134 bytes (javascript) 7.57 KiB (runtime) ={275}= >{272}< >{464}< [entry] [rendered] + > ./ main + runtime modules 7.57 KiB 10 modules + ./index.js 134 bytes [built] [code generated] default (webpack x.x.x) compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-issue-7401 1`] = ` -"Entrypoint a 6.42 KiB = 282.js 412 bytes a.js 6.02 KiB +"Entrypoint a 6.42 KiB = 472.js 412 bytes a.js 6.02 KiB Entrypoint b 10.9 KiB = b.js -Chunk Group c 795 bytes = 282.js 412 bytes c.js 383 bytes -chunk (runtime: b) b.js (b) 43 bytes (javascript) 6.61 KiB (runtime) >{282}< >{459}< [entry] [rendered] - > ./b b - runtime modules 6.61 KiB 9 modules - ./b.js 43 bytes [built] [code generated] -chunk (runtime: a, b) 282.js (id hint: vendors) 20 bytes <{128}> ={459}= ={786}= [initial] [rendered] split chunk (cache group: defaultVendors) +Chunk Group c 795 bytes = 472.js 412 bytes c.js 383 bytes +chunk (runtime: b) c.js (c) 35 bytes <{580}> ={472}= [rendered] + > ./c ./b.js 1:0-41 + ./c.js 35 bytes [built] [code generated] +chunk (runtime: a, b) 472.js (id hint: vendors) 20 bytes <{580}> ={152}= ={996}= [initial] [rendered] split chunk (cache group: defaultVendors) > ./c ./b.js 1:0-41 > ./a a ./node_modules/x.js 20 bytes [built] [code generated] -chunk (runtime: b) c.js (c) 35 bytes <{128}> ={282}= [rendered] - > ./c ./b.js 1:0-41 - ./c.js 35 bytes [built] [code generated] -chunk (runtime: a) a.js (a) 35 bytes (javascript) 2.75 KiB (runtime) ={282}= [entry] [rendered] +chunk (runtime: b) b.js (b) 43 bytes (javascript) 6.61 KiB (runtime) >{152}< >{472}< [entry] [rendered] + > ./b b + runtime modules 6.61 KiB 9 modules + ./b.js 43 bytes [built] [code generated] +chunk (runtime: a) a.js (a) 35 bytes (javascript) 2.75 KiB (runtime) ={472}= [entry] [rendered] > ./a a runtime modules 2.75 KiB 4 modules ./a.js 35 bytes [built] [code generated] @@ -4151,28 +4151,28 @@ default (webpack x.x.x) compiled successfully" `; exports[`StatsTestCases should print correct stats for split-chunks-keep-remaining-size 1`] = ` -"Entrypoint main 11.4 KiB = default/main.js -chunk (runtime: main) default/async-d.js (async-d) 84 bytes <{179}> ={782}= [rendered] - > ./d ./index.js 4:0-47 - ./d.js 84 bytes [built] [code generated] -chunk (runtime: main) default/main.js (main) 196 bytes (javascript) 6.68 KiB (runtime) >{31}< >{334}< >{383}< >{782}< >{794}< >{821}< [entry] [rendered] - > ./ main - runtime modules 6.68 KiB 9 modules - ./index.js 196 bytes [built] [code generated] -chunk (runtime: main) default/async-b.js (async-b) 50 bytes <{179}> ={821}= [rendered] +"Entrypoint main 11.4 KiB = default/main.js +chunk (runtime: main) default/76.js (id hint: vendors) 252 bytes <{590}> ={668}= [rendered] split chunk (cache group: defaultVendors) + > ./d ./index.js 4:0-47 + ./node_modules/shared.js?3 126 bytes [built] [code generated] + ./node_modules/shared.js?4 126 bytes [built] [code generated] +chunk (runtime: main) default/async-b.js (async-b) 50 bytes <{590}> ={916}= [rendered] > ./b ./index.js 2:0-47 ./b.js 50 bytes [built] [code generated] -chunk (runtime: main) default/async-c.js (async-c) 50 bytes <{179}> ={821}= [rendered] +chunk (runtime: main) default/async-c.js (async-c) 50 bytes <{590}> ={916}= [rendered] > ./c ./index.js 3:0-47 ./c.js 50 bytes [built] [code generated] -chunk (runtime: main) default/782.js (id hint: vendors) 252 bytes <{179}> ={31}= [rendered] split chunk (cache group: defaultVendors) - > ./d ./index.js 4:0-47 - ./node_modules/shared.js?3 126 bytes [built] [code generated] - ./node_modules/shared.js?4 126 bytes [built] [code generated] -chunk (runtime: main) default/async-a.js (async-a) 176 bytes <{179}> [rendered] +chunk (runtime: main) default/async-a.js (async-a) 176 bytes <{590}> [rendered] > ./a ./index.js 1:0-47 ./a.js + 1 modules 176 bytes [built] [code generated] -chunk (runtime: main) default/821.js (id hint: vendors) 126 bytes <{179}> ={334}= ={383}= [rendered] split chunk (cache group: defaultVendors) +chunk (runtime: main) default/main.js (main) 196 bytes (javascript) 6.68 KiB (runtime) >{76}< >{272}< >{276}< >{464}< >{668}< >{916}< [entry] [rendered] + > ./ main + runtime modules 6.68 KiB 9 modules + ./index.js 196 bytes [built] [code generated] +chunk (runtime: main) default/async-d.js (async-d) 84 bytes <{590}> ={76}= [rendered] + > ./d ./index.js 4:0-47 + ./d.js 84 bytes [built] [code generated] +chunk (runtime: main) default/916.js (id hint: vendors) 126 bytes <{590}> ={272}= ={276}= [rendered] split chunk (cache group: defaultVendors) > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 ./node_modules/shared.js?2 126 bytes [built] [code generated] @@ -4182,20 +4182,26 @@ webpack x.x.x compiled successfully" exports[`StatsTestCases should print correct stats for split-chunks-max-size 1`] = ` "production: Entrypoint main 31.8 KiB = 13 assets - chunk (runtime: main) prod-main-6bb16544.js (main-6bb16544) 1.57 KiB ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + chunk (runtime: main) prod-main-1443e336.js (main-1443e336) 594 bytes ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main - ./in-some-directory/very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) prod-main-77a8c116.js (main-77a8c116) 1.57 KiB ={1}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + ./subfolder/small.js?1 66 bytes [built] [code generated] + ./subfolder/small.js?2 66 bytes [built] [code generated] + ./subfolder/small.js?3 66 bytes [built] [code generated] + ./subfolder/small.js?4 66 bytes [built] [code generated] + ./subfolder/small.js?5 66 bytes [built] [code generated] + ./subfolder/small.js?6 66 bytes [built] [code generated] + ./subfolder/small.js?7 66 bytes [built] [code generated] + ./subfolder/small.js?8 66 bytes [built] [code generated] + ./subfolder/small.js?9 66 bytes [built] [code generated] + chunk (runtime: main) prod-96.js (id hint: vendors) 399 bytes ={91}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] split chunk (cache group: defaultVendors) > ./ main - ./very-big.js?2 1.57 KiB [built] [code generated] - chunk (runtime: main) prod-main-3c98d7c3.js (main-3c98d7c3) 531 bytes ={1}= ={59}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + ./node_modules/big.js?1 267 bytes [built] [code generated] + ./node_modules/small.js?1 66 bytes [built] [code generated] + ./node_modules/small.js?2 66 bytes [built] [code generated] + chunk (runtime: main) prod-main-6bb16544.js (main-6bb16544) 1.57 KiB ={91}= ={96}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main - ./in-some-directory/big.js?1 267 bytes [built] [code generated] - ./in-some-directory/small.js?1 66 bytes [built] [code generated] - ./in-some-directory/small.js?2 66 bytes [built] [code generated] - ./in-some-directory/small.js?3 66 bytes [built] [code generated] - ./in-some-directory/small.js?4 66 bytes [built] [code generated] - chunk (runtime: main) prod-main-2f7dcf2e.js (main-2f7dcf2e) 594 bytes ={1}= ={59}= ={198}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + ./in-some-directory/very-big.js?1 1.57 KiB [built] [code generated] + chunk (runtime: main) prod-main-2f7dcf2e.js (main-2f7dcf2e) 594 bytes ={91}= ={96}= ={216}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main ./inner-module/small.js?1 66 bytes [built] [code generated] ./inner-module/small.js?2 66 bytes [built] [code generated] @@ -4206,10 +4212,22 @@ exports[`StatsTestCases should print correct stats for split-chunks-max-size 1`] ./inner-module/small.js?7 66 bytes [built] [code generated] ./inner-module/small.js?8 66 bytes [built] [code generated] ./inner-module/small.js?9 66 bytes [built] [code generated] - chunk (runtime: main) prod-main-89a43a0f.js (main-89a43a0f) 1.57 KiB ={1}= ={59}= ={198}= ={204}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + chunk (runtime: main) prod-main-89a43a0f.js (main-89a43a0f) 1.57 KiB ={91}= ={96}= ={216}= ={384}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main ./very-big.js?3 1.57 KiB [built] [code generated] - chunk (runtime: main) prod-main-e7c5ace7.js (main-e7c5ace7) 594 bytes ={1}= ={59}= ={198}= ={204}= ={318}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + chunk (runtime: main) prod-main-10f51d07.js (main-10f51d07) 534 bytes ={91}= ={96}= ={216}= ={384}= ={392}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] + > ./ main + ./big.js?1 267 bytes [built] [code generated] + ./big.js?2 267 bytes [built] [code generated] + chunk (runtime: main) prod-main-12217e1d.js (main-12217e1d) 1.57 KiB (javascript) 3.01 KiB (runtime) ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [entry] [rendered] + > ./ main + runtime modules 3.01 KiB 5 modules + ./very-big.js?1 1.57 KiB [built] [code generated] + chunk (runtime: main) prod-main-5cfff2c6.js (main-5cfff2c6) 534 bytes ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] + > ./ main + ./subfolder/big.js?1 267 bytes [built] [code generated] + ./subfolder/big.js?2 267 bytes [built] [code generated] + chunk (runtime: main) prod-main-e7c5ace7.js (main-e7c5ace7) 594 bytes ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main ./small.js?1 66 bytes [built] [code generated] ./small.js?2 66 bytes [built] [code generated] @@ -4220,40 +4238,22 @@ exports[`StatsTestCases should print correct stats for split-chunks-max-size 1`] ./small.js?7 66 bytes [built] [code generated] ./small.js?8 66 bytes [built] [code generated] ./small.js?9 66 bytes [built] [code generated] - chunk (runtime: main) prod-main-1443e336.js (main-1443e336) 594 bytes ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + chunk (runtime: main) prod-main-3c98d7c3.js (main-3c98d7c3) 531 bytes ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main - ./subfolder/small.js?1 66 bytes [built] [code generated] - ./subfolder/small.js?2 66 bytes [built] [code generated] - ./subfolder/small.js?3 66 bytes [built] [code generated] - ./subfolder/small.js?4 66 bytes [built] [code generated] - ./subfolder/small.js?5 66 bytes [built] [code generated] - ./subfolder/small.js?6 66 bytes [built] [code generated] - ./subfolder/small.js?7 66 bytes [built] [code generated] - ./subfolder/small.js?8 66 bytes [built] [code generated] - ./subfolder/small.js?9 66 bytes [built] [code generated] - chunk (runtime: main) prod-410.js (id hint: vendors) 1.57 KiB ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] split chunk (cache group: defaultVendors) + ./in-some-directory/big.js?1 267 bytes [built] [code generated] + ./in-some-directory/small.js?1 66 bytes [built] [code generated] + ./in-some-directory/small.js?2 66 bytes [built] [code generated] + ./in-some-directory/small.js?3 66 bytes [built] [code generated] + ./in-some-directory/small.js?4 66 bytes [built] [code generated] + chunk (runtime: main) prod-876.js (id hint: vendors) 1.57 KiB ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={968}= ={976}= [initial] [rendered] split chunk (cache group: defaultVendors) > ./ main ./node_modules/very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) prod-main-5cfff2c6.js (main-5cfff2c6) 534 bytes ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] - > ./ main - ./subfolder/big.js?1 267 bytes [built] [code generated] - ./subfolder/big.js?2 267 bytes [built] [code generated] - chunk (runtime: main) prod-main-1df31ce3.js (main-1df31ce3) 1.19 KiB ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={662}= ={663}= ={869}= [initial] [rendered] + chunk (runtime: main) prod-main-1df31ce3.js (main-1df31ce3) 1.19 KiB ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={976}= [initial] [rendered] > ./ main ./index.js 1.19 KiB [built] [code generated] - chunk (runtime: main) prod-main-10f51d07.js (main-10f51d07) 534 bytes ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={663}= ={869}= [initial] [rendered] - > ./ main - ./big.js?1 267 bytes [built] [code generated] - ./big.js?2 267 bytes [built] [code generated] - chunk (runtime: main) prod-main-12217e1d.js (main-12217e1d) 1.57 KiB (javascript) 3.01 KiB (runtime) ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={869}= [entry] [rendered] - > ./ main - runtime modules 3.01 KiB 5 modules - ./very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) prod-869.js (id hint: vendors) 399 bytes ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= [initial] [rendered] split chunk (cache group: defaultVendors) + chunk (runtime: main) prod-main-77a8c116.js (main-77a8c116) 1.57 KiB ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= [initial] [rendered] > ./ main - ./node_modules/big.js?1 267 bytes [built] [code generated] - ./node_modules/small.js?1 66 bytes [built] [code generated] - ./node_modules/small.js?2 66 bytes [built] [code generated] + ./very-big.js?2 1.57 KiB [built] [code generated] production (webpack x.x.x) compiled successfully development: @@ -4334,22 +4334,12 @@ development: switched: Entrypoint main 31.5 KiB = 9 assets - chunk (runtime: main) switched-main-6bb16544.js (main-6bb16544) 1.57 KiB ={59}= ={318}= ={410}= ={520}= ={581}= ={663}= ={869}= ={997}= [initial] [rendered] - > ./ main - ./in-some-directory/very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) switched-main-77a8c116.js (main-77a8c116) 1.57 KiB ={1}= ={318}= ={410}= ={520}= ={581}= ={663}= ={869}= ={997}= [initial] [rendered] - > ./ main - ./very-big.js?2 1.57 KiB [built] [code generated] - chunk (runtime: main) switched-main-89a43a0f.js (main-89a43a0f) 1.57 KiB ={1}= ={59}= ={410}= ={520}= ={581}= ={663}= ={869}= ={997}= [initial] [rendered] + chunk (runtime: main) switched-96.js (id hint: vendors) 399 bytes ={192}= ={216}= ={392}= ={476}= ={496}= ={876}= ={968}= ={976}= [initial] [rendered] split chunk (cache group: defaultVendors) > ./ main - ./very-big.js?3 1.57 KiB [built] [code generated] - chunk (runtime: main) switched-410.js (id hint: vendors) 1.57 KiB ={1}= ={59}= ={318}= ={520}= ={581}= ={663}= ={869}= ={997}= [initial] [rendered] split chunk (cache group: defaultVendors) - > ./ main - ./node_modules/very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) switched-main-1df31ce3.js (main-1df31ce3) 1.19 KiB ={1}= ={59}= ={318}= ={410}= ={581}= ={663}= ={869}= ={997}= [initial] [rendered] - > ./ main - ./index.js 1.19 KiB [built] [code generated] - chunk (runtime: main) switched-main-879072e3.js (main-879072e3) 1.68 KiB ={1}= ={59}= ={318}= ={410}= ={520}= ={663}= ={869}= ={997}= [initial] [rendered] + ./node_modules/big.js?1 267 bytes [built] [code generated] + ./node_modules/small.js?1 66 bytes [built] [code generated] + ./node_modules/small.js?2 66 bytes [built] [code generated] + chunk (runtime: main) switched-main-879072e3.js (main-879072e3) 1.68 KiB ={96}= ={216}= ={392}= ={476}= ={496}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main modules by path ./subfolder/*.js 1.1 KiB ./subfolder/big.js?1 267 bytes [built] [code generated] @@ -4361,16 +4351,13 @@ switched: ./small.js?2 66 bytes [built] [code generated] ./small.js?3 66 bytes [built] [code generated] + 6 modules - chunk (runtime: main) switched-main-12217e1d.js (main-12217e1d) 1.57 KiB (javascript) 3.01 KiB (runtime) ={1}= ={59}= ={318}= ={410}= ={520}= ={581}= ={869}= ={997}= [entry] [rendered] + chunk (runtime: main) switched-main-6bb16544.js (main-6bb16544) 1.57 KiB ={96}= ={192}= ={392}= ={476}= ={496}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main - runtime modules 3.01 KiB 5 modules - ./very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) switched-869.js (id hint: vendors) 399 bytes ={1}= ={59}= ={318}= ={410}= ={520}= ={581}= ={663}= ={997}= [initial] [rendered] split chunk (cache group: defaultVendors) + ./in-some-directory/very-big.js?1 1.57 KiB [built] [code generated] + chunk (runtime: main) switched-main-89a43a0f.js (main-89a43a0f) 1.57 KiB ={96}= ={192}= ={216}= ={476}= ={496}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main - ./node_modules/big.js?1 267 bytes [built] [code generated] - ./node_modules/small.js?1 66 bytes [built] [code generated] - ./node_modules/small.js?2 66 bytes [built] [code generated] - chunk (runtime: main) switched-main-7aeafcb2.js (main-7aeafcb2) 1.62 KiB ={1}= ={59}= ={318}= ={410}= ={520}= ={581}= ={663}= ={869}= [initial] [rendered] + ./very-big.js?3 1.57 KiB [built] [code generated] + chunk (runtime: main) switched-main-7aeafcb2.js (main-7aeafcb2) 1.62 KiB ={96}= ={192}= ={216}= ={392}= ={496}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main modules by path ./inner-module/*.js 594 bytes ./inner-module/small.js?1 66 bytes [built] [code generated] @@ -4382,6 +4369,19 @@ switched: modules by path ./*.js 534 bytes ./big.js?1 267 bytes [built] [code generated] ./big.js?2 267 bytes [built] [code generated] + chunk (runtime: main) switched-main-12217e1d.js (main-12217e1d) 1.57 KiB (javascript) 3.01 KiB (runtime) ={96}= ={192}= ={216}= ={392}= ={476}= ={876}= ={968}= ={976}= [entry] [rendered] + > ./ main + runtime modules 3.01 KiB 5 modules + ./very-big.js?1 1.57 KiB [built] [code generated] + chunk (runtime: main) switched-876.js (id hint: vendors) 1.57 KiB ={96}= ={192}= ={216}= ={392}= ={476}= ={496}= ={968}= ={976}= [initial] [rendered] split chunk (cache group: defaultVendors) + > ./ main + ./node_modules/very-big.js?1 1.57 KiB [built] [code generated] + chunk (runtime: main) switched-main-1df31ce3.js (main-1df31ce3) 1.19 KiB ={96}= ={192}= ={216}= ={392}= ={476}= ={496}= ={876}= ={976}= [initial] [rendered] + > ./ main + ./index.js 1.19 KiB [built] [code generated] + chunk (runtime: main) switched-main-77a8c116.js (main-77a8c116) 1.57 KiB ={96}= ={192}= ={216}= ={392}= ={476}= ={496}= ={876}= ={968}= [initial] [rendered] + > ./ main + ./very-big.js?2 1.57 KiB [built] [code generated] WARNING in SplitChunksPlugin Cache group defaultVendors @@ -4397,20 +4397,26 @@ switched: zero-min: Entrypoint main 31.8 KiB = 13 assets - chunk (runtime: main) zero-min-main-6bb16544.js (main-6bb16544) 1.57 KiB ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + chunk (runtime: main) zero-min-main-1443e336.js (main-1443e336) 594 bytes ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main - ./in-some-directory/very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) zero-min-main-77a8c116.js (main-77a8c116) 1.57 KiB ={1}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + ./subfolder/small.js?1 66 bytes [built] [code generated] + ./subfolder/small.js?2 66 bytes [built] [code generated] + ./subfolder/small.js?3 66 bytes [built] [code generated] + ./subfolder/small.js?4 66 bytes [built] [code generated] + ./subfolder/small.js?5 66 bytes [built] [code generated] + ./subfolder/small.js?6 66 bytes [built] [code generated] + ./subfolder/small.js?7 66 bytes [built] [code generated] + ./subfolder/small.js?8 66 bytes [built] [code generated] + ./subfolder/small.js?9 66 bytes [built] [code generated] + chunk (runtime: main) zero-min-96.js (id hint: vendors) 399 bytes ={91}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] split chunk (cache group: defaultVendors) > ./ main - ./very-big.js?2 1.57 KiB [built] [code generated] - chunk (runtime: main) zero-min-main-3c98d7c3.js (main-3c98d7c3) 531 bytes ={1}= ={59}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + ./node_modules/big.js?1 267 bytes [built] [code generated] + ./node_modules/small.js?1 66 bytes [built] [code generated] + ./node_modules/small.js?2 66 bytes [built] [code generated] + chunk (runtime: main) zero-min-main-6bb16544.js (main-6bb16544) 1.57 KiB ={91}= ={96}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main - ./in-some-directory/big.js?1 267 bytes [built] [code generated] - ./in-some-directory/small.js?1 66 bytes [built] [code generated] - ./in-some-directory/small.js?2 66 bytes [built] [code generated] - ./in-some-directory/small.js?3 66 bytes [built] [code generated] - ./in-some-directory/small.js?4 66 bytes [built] [code generated] - chunk (runtime: main) zero-min-main-2f7dcf2e.js (main-2f7dcf2e) 594 bytes ={1}= ={59}= ={198}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + ./in-some-directory/very-big.js?1 1.57 KiB [built] [code generated] + chunk (runtime: main) zero-min-main-2f7dcf2e.js (main-2f7dcf2e) 594 bytes ={91}= ={96}= ={216}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main ./inner-module/small.js?1 66 bytes [built] [code generated] ./inner-module/small.js?2 66 bytes [built] [code generated] @@ -4421,10 +4427,22 @@ zero-min: ./inner-module/small.js?7 66 bytes [built] [code generated] ./inner-module/small.js?8 66 bytes [built] [code generated] ./inner-module/small.js?9 66 bytes [built] [code generated] - chunk (runtime: main) zero-min-main-89a43a0f.js (main-89a43a0f) 1.57 KiB ={1}= ={59}= ={198}= ={204}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + chunk (runtime: main) zero-min-main-89a43a0f.js (main-89a43a0f) 1.57 KiB ={91}= ={96}= ={216}= ={384}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main ./very-big.js?3 1.57 KiB [built] [code generated] - chunk (runtime: main) zero-min-main-e7c5ace7.js (main-e7c5ace7) 594 bytes ={1}= ={59}= ={198}= ={204}= ={318}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + chunk (runtime: main) zero-min-main-10f51d07.js (main-10f51d07) 534 bytes ={91}= ={96}= ={216}= ={384}= ={392}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] + > ./ main + ./big.js?1 267 bytes [built] [code generated] + ./big.js?2 267 bytes [built] [code generated] + chunk (runtime: main) zero-min-main-12217e1d.js (main-12217e1d) 1.57 KiB (javascript) 3.01 KiB (runtime) ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={536}= ={592}= ={728}= ={876}= ={968}= ={976}= [entry] [rendered] + > ./ main + runtime modules 3.01 KiB 5 modules + ./very-big.js?1 1.57 KiB [built] [code generated] + chunk (runtime: main) zero-min-main-5cfff2c6.js (main-5cfff2c6) 534 bytes ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={592}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] + > ./ main + ./subfolder/big.js?1 267 bytes [built] [code generated] + ./subfolder/big.js?2 267 bytes [built] [code generated] + chunk (runtime: main) zero-min-main-e7c5ace7.js (main-e7c5ace7) 594 bytes ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={728}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main ./small.js?1 66 bytes [built] [code generated] ./small.js?2 66 bytes [built] [code generated] @@ -4435,88 +4453,65 @@ zero-min: ./small.js?7 66 bytes [built] [code generated] ./small.js?8 66 bytes [built] [code generated] ./small.js?9 66 bytes [built] [code generated] - chunk (runtime: main) zero-min-main-1443e336.js (main-1443e336) 594 bytes ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={410}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] + chunk (runtime: main) zero-min-main-3c98d7c3.js (main-3c98d7c3) 531 bytes ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={876}= ={968}= ={976}= [initial] [rendered] > ./ main - ./subfolder/small.js?1 66 bytes [built] [code generated] - ./subfolder/small.js?2 66 bytes [built] [code generated] - ./subfolder/small.js?3 66 bytes [built] [code generated] - ./subfolder/small.js?4 66 bytes [built] [code generated] - ./subfolder/small.js?5 66 bytes [built] [code generated] - ./subfolder/small.js?6 66 bytes [built] [code generated] - ./subfolder/small.js?7 66 bytes [built] [code generated] - ./subfolder/small.js?8 66 bytes [built] [code generated] - ./subfolder/small.js?9 66 bytes [built] [code generated] - chunk (runtime: main) zero-min-410.js (id hint: vendors) 1.57 KiB ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={490}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] split chunk (cache group: defaultVendors) + ./in-some-directory/big.js?1 267 bytes [built] [code generated] + ./in-some-directory/small.js?1 66 bytes [built] [code generated] + ./in-some-directory/small.js?2 66 bytes [built] [code generated] + ./in-some-directory/small.js?3 66 bytes [built] [code generated] + ./in-some-directory/small.js?4 66 bytes [built] [code generated] + chunk (runtime: main) zero-min-876.js (id hint: vendors) 1.57 KiB ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={968}= ={976}= [initial] [rendered] split chunk (cache group: defaultVendors) > ./ main ./node_modules/very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) zero-min-main-5cfff2c6.js (main-5cfff2c6) 534 bytes ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={520}= ={662}= ={663}= ={869}= [initial] [rendered] - > ./ main - ./subfolder/big.js?1 267 bytes [built] [code generated] - ./subfolder/big.js?2 267 bytes [built] [code generated] - chunk (runtime: main) zero-min-main-1df31ce3.js (main-1df31ce3) 1.19 KiB ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={662}= ={663}= ={869}= [initial] [rendered] + chunk (runtime: main) zero-min-main-1df31ce3.js (main-1df31ce3) 1.19 KiB ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={976}= [initial] [rendered] > ./ main ./index.js 1.19 KiB [built] [code generated] - chunk (runtime: main) zero-min-main-10f51d07.js (main-10f51d07) 534 bytes ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={663}= ={869}= [initial] [rendered] - > ./ main - ./big.js?1 267 bytes [built] [code generated] - ./big.js?2 267 bytes [built] [code generated] - chunk (runtime: main) zero-min-main-12217e1d.js (main-12217e1d) 1.57 KiB (javascript) 3.01 KiB (runtime) ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={869}= [entry] [rendered] - > ./ main - runtime modules 3.01 KiB 5 modules - ./very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) zero-min-869.js (id hint: vendors) 399 bytes ={1}= ={59}= ={198}= ={204}= ={318}= ={358}= ={400}= ={410}= ={490}= ={520}= ={662}= ={663}= [initial] [rendered] split chunk (cache group: defaultVendors) + chunk (runtime: main) zero-min-main-77a8c116.js (main-77a8c116) 1.57 KiB ={91}= ={96}= ={216}= ={384}= ={392}= ={480}= ={496}= ={536}= ={592}= ={728}= ={876}= ={968}= [initial] [rendered] > ./ main - ./node_modules/big.js?1 267 bytes [built] [code generated] - ./node_modules/small.js?1 66 bytes [built] [code generated] - ./node_modules/small.js?2 66 bytes [built] [code generated] + ./very-big.js?2 1.57 KiB [built] [code generated] zero-min (webpack x.x.x) compiled successfully max-async-size: Entrypoint main 15.9 KiB = max-async-size-main.js - chunk (runtime: main) max-async-size-main.js (main) 2.46 KiB (javascript) 6.96 KiB (runtime) >{342}< >{385}< >{820}< >{920}< [entry] [rendered] - > ./async main - runtime modules 6.96 KiB 10 modules - dependent modules 2.09 KiB [dependent] 6 modules - ./async/index.js 386 bytes [built] [code generated] - chunk (runtime: main) max-async-size-async-b-77a8c116.js (async-b-77a8c116) 1.57 KiB <{179}> ={385}= ={820}= ={920}= [rendered] + chunk (runtime: main) max-async-size-async-b-77a8c116.js (async-b-77a8c116) 1.57 KiB <{590}> ={324}= ={440}= ={560}= [rendered] > ./b ./async/index.js 10:2-49 > ./a ./async/index.js 9:2-49 ./very-big.js?2 1.57 KiB [built] [code generated] - chunk (runtime: main) max-async-size-async-b-12217e1d.js (async-b-12217e1d) 1.57 KiB <{179}> ={342}= ={820}= ={920}= [rendered] + chunk (runtime: main) max-async-size-async-b-12217e1d.js (async-b-12217e1d) 1.57 KiB <{590}> ={24}= ={440}= ={560}= [rendered] > ./b ./async/index.js 10:2-49 > ./a ./async/index.js 9:2-49 ./very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) max-async-size-async-b-89a43a0f.js (async-b-89a43a0f) 1.57 KiB <{179}> ={342}= ={385}= ={920}= [rendered] - > ./b ./async/index.js 10:2-49 - > ./a ./async/index.js 9:2-49 - ./very-big.js?3 1.57 KiB [built] [code generated] - chunk (runtime: main) max-async-size-async-b-bde52cb3.js (async-b-bde52cb3) 855 bytes <{179}> ={342}= ={385}= ={820}= [rendered] + chunk (runtime: main) max-async-size-async-b-bde52cb3.js (async-b-bde52cb3) 855 bytes <{590}> ={24}= ={324}= ={560}= [rendered] > ./b ./async/index.js 10:2-49 > ./a ./async/index.js 9:2-49 dependent modules 594 bytes [dependent] 9 modules cacheable modules 261 bytes ./async/a.js 189 bytes [built] [code generated] ./async/b.js 72 bytes [built] [code generated] + chunk (runtime: main) max-async-size-async-b-89a43a0f.js (async-b-89a43a0f) 1.57 KiB <{590}> ={24}= ={324}= ={440}= [rendered] + > ./b ./async/index.js 10:2-49 + > ./a ./async/index.js 9:2-49 + ./very-big.js?3 1.57 KiB [built] [code generated] + chunk (runtime: main) max-async-size-main.js (main) 2.46 KiB (javascript) 6.96 KiB (runtime) >{24}< >{324}< >{440}< >{560}< [entry] [rendered] + > ./async main + runtime modules 6.96 KiB 10 modules + dependent modules 2.09 KiB [dependent] 6 modules + ./async/index.js 386 bytes [built] [code generated] max-async-size (webpack x.x.x) compiled successfully enforce-min-size: Entrypoint main 31.9 KiB = 14 assets - chunk (runtime: main) enforce-min-size-10.js (id hint: all) 1.19 KiB ={179}= ={221}= ={262}= ={410}= ={434}= ={463}= ={519}= ={575}= ={614}= ={692}= ={822}= ={825}= ={869}= [initial] [rendered] split chunk (cache group: all) - > ./ main - ./index.js 1.19 KiB [built] [code generated] - chunk (runtime: main) enforce-min-size-main.js (main) 3.01 KiB ={10}= ={221}= ={262}= ={410}= ={434}= ={463}= ={519}= ={575}= ={614}= ={692}= ={822}= ={825}= ={869}= [entry] [rendered] + chunk (runtime: main) enforce-min-size-16.js (id hint: all) 1.57 KiB ={39}= ={79}= ={80}= ={96}= ={192}= ={552}= ={590}= ={624}= ={700}= ={832}= ={836}= ={876}= ={980}= [initial] [rendered] split chunk (cache group: all) > ./ main - runtime modules 3.01 KiB 5 modules - chunk (runtime: main) enforce-min-size-221.js (id hint: all) 1.57 KiB ={10}= ={179}= ={262}= ={410}= ={434}= ={463}= ={519}= ={575}= ={614}= ={692}= ={822}= ={825}= ={869}= [initial] [rendered] split chunk (cache group: all) - > ./ main - ./very-big.js?3 1.57 KiB [built] [code generated] - chunk (runtime: main) enforce-min-size-262.js (id hint: all) 1.57 KiB ={10}= ={179}= ={221}= ={410}= ={434}= ={463}= ={519}= ={575}= ={614}= ={692}= ={822}= ={825}= ={869}= [initial] [rendered] split chunk (cache group: all) + ./very-big.js?1 1.57 KiB [built] [code generated] + chunk (runtime: main) enforce-min-size-39.js (id hint: all) 1.19 KiB ={16}= ={79}= ={80}= ={96}= ={192}= ={552}= ={590}= ={624}= ={700}= ={832}= ={836}= ={876}= ={980}= [initial] [rendered] split chunk (cache group: all) > ./ main - ./in-some-directory/very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) enforce-min-size-410.js (id hint: all) 1.57 KiB ={10}= ={179}= ={221}= ={262}= ={434}= ={463}= ={519}= ={575}= ={614}= ={692}= ={822}= ={825}= ={869}= [initial] [rendered] split chunk (cache group: all) + ./index.js 1.19 KiB [built] [code generated] + chunk (runtime: main) enforce-min-size-79.js (id hint: all) 534 bytes ={16}= ={39}= ={80}= ={96}= ={192}= ={552}= ={590}= ={624}= ={700}= ={832}= ={836}= ={876}= ={980}= [initial] [rendered] split chunk (cache group: all) > ./ main - ./node_modules/very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) enforce-min-size-434.js (id hint: all) 594 bytes ={10}= ={179}= ={221}= ={262}= ={410}= ={463}= ={519}= ={575}= ={614}= ={692}= ={822}= ={825}= ={869}= [initial] [rendered] split chunk (cache group: all) + ./subfolder/big.js?1 267 bytes [built] [code generated] + ./subfolder/big.js?2 267 bytes [built] [code generated] + chunk (runtime: main) enforce-min-size-80.js (id hint: all) 594 bytes ={16}= ={39}= ={79}= ={96}= ={192}= ={552}= ={590}= ={624}= ={700}= ={832}= ={836}= ={876}= ={980}= [initial] [rendered] split chunk (cache group: all) > ./ main ./inner-module/small.js?1 66 bytes [built] [code generated] ./inner-module/small.js?2 66 bytes [built] [code generated] @@ -4527,24 +4522,25 @@ enforce-min-size: ./inner-module/small.js?7 66 bytes [built] [code generated] ./inner-module/small.js?8 66 bytes [built] [code generated] ./inner-module/small.js?9 66 bytes [built] [code generated] - chunk (runtime: main) enforce-min-size-463.js (id hint: all) 1.57 KiB ={10}= ={179}= ={221}= ={262}= ={410}= ={434}= ={519}= ={575}= ={614}= ={692}= ={822}= ={825}= ={869}= [initial] [rendered] split chunk (cache group: all) + chunk (runtime: main) enforce-min-size-96.js (id hint: all) 399 bytes ={16}= ={39}= ={79}= ={80}= ={192}= ={552}= ={590}= ={624}= ={700}= ={832}= ={836}= ={876}= ={980}= [initial] [rendered] split chunk (cache group: all) > ./ main - ./very-big.js?1 1.57 KiB [built] [code generated] - chunk (runtime: main) enforce-min-size-519.js (id hint: all) 534 bytes ={10}= ={179}= ={221}= ={262}= ={410}= ={434}= ={463}= ={575}= ={614}= ={692}= ={822}= ={825}= ={869}= [initial] [rendered] split chunk (cache group: all) + ./node_modules/big.js?1 267 bytes [built] [code generated] + ./node_modules/small.js?1 66 bytes [built] [code generated] + ./node_modules/small.js?2 66 bytes [built] [code generated] + chunk (runtime: main) enforce-min-size-192.js (id hint: all) 534 bytes ={16}= ={39}= ={79}= ={80}= ={96}= ={552}= ={590}= ={624}= ={700}= ={832}= ={836}= ={876}= ={980}= [initial] [rendered] split chunk (cache group: all) > ./ main ./big.js?1 267 bytes [built] [code generated] ./big.js?2 267 bytes [built] [code generated] - chunk (runtime: main) enforce-min-size-575.js (id hint: all) 1.57 KiB ={10}= ={179}= ={221}= ={262}= ={410}= ={434}= ={463}= ={519}= ={614}= ={692}= ={822}= ={825}= ={869}= [initial] [rendered] split chunk (cache group: all) + chunk (runtime: main) enforce-min-size-552.js (id hint: all) 1.57 KiB ={16}= ={39}= ={79}= ={80}= ={96}= ={192}= ={590}= ={624}= ={700}= ={832}= ={836}= ={876}= ={980}= [initial] [rendered] split chunk (cache group: all) > ./ main ./very-big.js?2 1.57 KiB [built] [code generated] - chunk (runtime: main) enforce-min-size-614.js (id hint: all) 531 bytes ={10}= ={179}= ={221}= ={262}= ={410}= ={434}= ={463}= ={519}= ={575}= ={692}= ={822}= ={825}= ={869}= [initial] [rendered] split chunk (cache group: all) + chunk (runtime: main) enforce-min-size-main.js (main) 3.01 KiB ={16}= ={39}= ={79}= ={80}= ={96}= ={192}= ={552}= ={624}= ={700}= ={832}= ={836}= ={876}= ={980}= [entry] [rendered] > ./ main - ./in-some-directory/big.js?1 267 bytes [built] [code generated] - ./in-some-directory/small.js?1 66 bytes [built] [code generated] - ./in-some-directory/small.js?2 66 bytes [built] [code generated] - ./in-some-directory/small.js?3 66 bytes [built] [code generated] - ./in-some-directory/small.js?4 66 bytes [built] [code generated] - chunk (runtime: main) enforce-min-size-692.js (id hint: all) 594 bytes ={10}= ={179}= ={221}= ={262}= ={410}= ={434}= ={463}= ={519}= ={575}= ={614}= ={822}= ={825}= ={869}= [initial] [rendered] split chunk (cache group: all) + runtime modules 3.01 KiB 5 modules + chunk (runtime: main) enforce-min-size-624.js (id hint: all) 1.57 KiB ={16}= ={39}= ={79}= ={80}= ={96}= ={192}= ={552}= ={590}= ={700}= ={832}= ={836}= ={876}= ={980}= [initial] [rendered] split chunk (cache group: all) + > ./ main + ./in-some-directory/very-big.js?1 1.57 KiB [built] [code generated] + chunk (runtime: main) enforce-min-size-700.js (id hint: all) 594 bytes ={16}= ={39}= ={79}= ={80}= ={96}= ={192}= ={552}= ={590}= ={624}= ={832}= ={836}= ={876}= ={980}= [initial] [rendered] split chunk (cache group: all) > ./ main ./small.js?1 66 bytes [built] [code generated] ./small.js?2 66 bytes [built] [code generated] @@ -4555,7 +4551,14 @@ enforce-min-size: ./small.js?7 66 bytes [built] [code generated] ./small.js?8 66 bytes [built] [code generated] ./small.js?9 66 bytes [built] [code generated] - chunk (runtime: main) enforce-min-size-822.js (id hint: all) 594 bytes ={10}= ={179}= ={221}= ={262}= ={410}= ={434}= ={463}= ={519}= ={575}= ={614}= ={692}= ={825}= ={869}= [initial] [rendered] split chunk (cache group: all) + chunk (runtime: main) enforce-min-size-832.js (id hint: all) 531 bytes ={16}= ={39}= ={79}= ={80}= ={96}= ={192}= ={552}= ={590}= ={624}= ={700}= ={836}= ={876}= ={980}= [initial] [rendered] split chunk (cache group: all) + > ./ main + ./in-some-directory/big.js?1 267 bytes [built] [code generated] + ./in-some-directory/small.js?1 66 bytes [built] [code generated] + ./in-some-directory/small.js?2 66 bytes [built] [code generated] + ./in-some-directory/small.js?3 66 bytes [built] [code generated] + ./in-some-directory/small.js?4 66 bytes [built] [code generated] + chunk (runtime: main) enforce-min-size-836.js (id hint: all) 594 bytes ={16}= ={39}= ={79}= ={80}= ={96}= ={192}= ={552}= ={590}= ={624}= ={700}= ={832}= ={876}= ={980}= [initial] [rendered] split chunk (cache group: all) > ./ main ./subfolder/small.js?1 66 bytes [built] [code generated] ./subfolder/small.js?2 66 bytes [built] [code generated] @@ -4566,15 +4569,12 @@ enforce-min-size: ./subfolder/small.js?7 66 bytes [built] [code generated] ./subfolder/small.js?8 66 bytes [built] [code generated] ./subfolder/small.js?9 66 bytes [built] [code generated] - chunk (runtime: main) enforce-min-size-825.js (id hint: all) 534 bytes ={10}= ={179}= ={221}= ={262}= ={410}= ={434}= ={463}= ={519}= ={575}= ={614}= ={692}= ={822}= ={869}= [initial] [rendered] split chunk (cache group: all) + chunk (runtime: main) enforce-min-size-876.js (id hint: all) 1.57 KiB ={16}= ={39}= ={79}= ={80}= ={96}= ={192}= ={552}= ={590}= ={624}= ={700}= ={832}= ={836}= ={980}= [initial] [rendered] split chunk (cache group: all) > ./ main - ./subfolder/big.js?1 267 bytes [built] [code generated] - ./subfolder/big.js?2 267 bytes [built] [code generated] - chunk (runtime: main) enforce-min-size-869.js (id hint: all) 399 bytes ={10}= ={179}= ={221}= ={262}= ={410}= ={434}= ={463}= ={519}= ={575}= ={614}= ={692}= ={822}= ={825}= [initial] [rendered] split chunk (cache group: all) + ./node_modules/very-big.js?1 1.57 KiB [built] [code generated] + chunk (runtime: main) enforce-min-size-980.js (id hint: all) 1.57 KiB ={16}= ={39}= ={79}= ={80}= ={96}= ={192}= ={552}= ={590}= ={624}= ={700}= ={832}= ={836}= ={876}= [initial] [rendered] split chunk (cache group: all) > ./ main - ./node_modules/big.js?1 267 bytes [built] [code generated] - ./node_modules/small.js?1 66 bytes [built] [code generated] - ./node_modules/small.js?2 66 bytes [built] [code generated] + ./very-big.js?3 1.57 KiB [built] [code generated] enforce-min-size (webpack x.x.x) compiled successfully only-async: @@ -4589,28 +4589,28 @@ only-async: exports[`StatsTestCases should print correct stats for split-chunks-min-size-reduction 1`] = ` "Entrypoint main 11.5 KiB = default/main.js -chunk (runtime: main) default/async-d.js (async-d) 50 bytes <{179}> ={821}= [rendered] - > ./d ./index.js 4:0-47 - ./d.js 50 bytes [built] [code generated] -chunk (runtime: main) default/main.js (main) 245 bytes (javascript) 6.69 KiB (runtime) >{31}< >{334}< >{383}< >{449}< >{794}< >{821}< [entry] [rendered] - > ./ main - runtime modules 6.69 KiB 9 modules - ./index.js 245 bytes [built] [code generated] -chunk (runtime: main) default/async-b.js (async-b) 176 bytes <{179}> [rendered] +chunk (runtime: main) default/async-b.js (async-b) 176 bytes <{590}> [rendered] > ./b ./index.js 2:0-47 ./b.js 50 bytes [built] [code generated] ./node_modules/shared.js?1 126 bytes [dependent] [built] [code generated] -chunk (runtime: main) default/async-c.js (async-c) 50 bytes <{179}> ={821}= [rendered] +chunk (runtime: main) default/async-c.js (async-c) 50 bytes <{590}> ={916}= [rendered] > ./c ./index.js 3:0-47 ./c.js 50 bytes [built] [code generated] -chunk (runtime: main) default/async-e.js (async-e) 50 bytes <{179}> ={821}= [rendered] - > ./e ./index.js 5:0-47 - ./e.js 50 bytes [built] [code generated] -chunk (runtime: main) default/async-a.js (async-a) 176 bytes <{179}> [rendered] +chunk (runtime: main) default/async-a.js (async-a) 176 bytes <{590}> [rendered] > ./a ./index.js 1:0-47 ./a.js 50 bytes [built] [code generated] ./node_modules/shared.js?1 126 bytes [dependent] [built] [code generated] -chunk (runtime: main) default/821.js (id hint: vendors) 126 bytes <{179}> ={31}= ={383}= ={449}= [rendered] split chunk (cache group: defaultVendors) +chunk (runtime: main) default/async-e.js (async-e) 50 bytes <{590}> ={916}= [rendered] + > ./e ./index.js 5:0-47 + ./e.js 50 bytes [built] [code generated] +chunk (runtime: main) default/main.js (main) 245 bytes (javascript) 6.69 KiB (runtime) >{272}< >{276}< >{464}< >{476}< >{668}< >{916}< [entry] [rendered] + > ./ main + runtime modules 6.69 KiB 9 modules + ./index.js 245 bytes [built] [code generated] +chunk (runtime: main) default/async-d.js (async-d) 50 bytes <{590}> ={916}= [rendered] + > ./d ./index.js 4:0-47 + ./d.js 50 bytes [built] [code generated] +chunk (runtime: main) default/916.js (id hint: vendors) 126 bytes <{590}> ={276}= ={476}= ={668}= [rendered] split chunk (cache group: defaultVendors) > ./c ./index.js 3:0-47 > ./d ./index.js 4:0-47 > ./e ./index.js 5:0-47 @@ -4620,26 +4620,26 @@ webpack x.x.x compiled successfully" exports[`StatsTestCases should print correct stats for split-chunks-prefer-bigger-splits 1`] = ` "Entrypoint main 11.2 KiB = default/main.js -chunk (runtime: main) default/118.js 150 bytes <{179}> ={334}= ={383}= [rendered] split chunk (cache group: default) +chunk (runtime: main) default/128.js 150 bytes <{590}> ={272}= ={276}= [rendered] split chunk (cache group: default) > ./b ./index.js 2:0-47 > ./c ./index.js 3:0-47 ./d.js 63 bytes [built] [code generated] ./f.js 87 bytes [built] [code generated] -chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 6.66 KiB (runtime) >{118}< >{334}< >{383}< >{794}< [entry] [rendered] - > ./ main - runtime modules 6.66 KiB 9 modules - ./index.js 147 bytes [built] [code generated] -chunk (runtime: main) default/async-b.js (async-b) 158 bytes <{179}> ={118}= [rendered] +chunk (runtime: main) default/async-b.js (async-b) 158 bytes <{590}> ={128}= [rendered] > ./b ./index.js 2:0-47 dependent modules 63 bytes [dependent] 1 module ./b.js 95 bytes [built] [code generated] -chunk (runtime: main) default/async-c.js (async-c) 70 bytes <{179}> ={118}= [rendered] +chunk (runtime: main) default/async-c.js (async-c) 70 bytes <{590}> ={128}= [rendered] > ./c ./index.js 3:0-47 ./c.js 70 bytes [built] [code generated] -chunk (runtime: main) default/async-a.js (async-a) 196 bytes <{179}> [rendered] +chunk (runtime: main) default/async-a.js (async-a) 196 bytes <{590}> [rendered] > ./a ./index.js 1:0-47 dependent modules 126 bytes [dependent] 2 modules ./a.js 70 bytes [built] [code generated] +chunk (runtime: main) default/main.js (main) 147 bytes (javascript) 6.66 KiB (runtime) >{128}< >{272}< >{276}< >{464}< [entry] [rendered] + > ./ main + runtime modules 6.66 KiB 9 modules + ./index.js 147 bytes [built] [code generated] webpack x.x.x compiled successfully" `; @@ -4647,39 +4647,39 @@ exports[`StatsTestCases should print correct stats for split-chunks-runtime-spec "used-exports: asset used-exports-c.js 6.04 KiB [emitted] (name: c) asset used-exports-b.js 6.03 KiB [emitted] (name: b) - asset used-exports-332.js 422 bytes [emitted] + asset used-exports-356.js 422 bytes [emitted] asset used-exports-a.js 257 bytes [emitted] (name: a) Entrypoint a 257 bytes = used-exports-a.js - Entrypoint b 6.44 KiB = used-exports-332.js 422 bytes used-exports-b.js 6.03 KiB - Entrypoint c 6.45 KiB = used-exports-332.js 422 bytes used-exports-c.js 6.04 KiB - chunk (runtime: b) used-exports-b.js (b) 54 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] - runtime modules 2.75 KiB 4 modules - ./b.js 54 bytes [built] [code generated] - chunk (runtime: b, c) used-exports-332.js 72 bytes [initial] [rendered] split chunk (cache group: default) - ./objects.js 72 bytes [built] [code generated] + Entrypoint b 6.44 KiB = used-exports-356.js 422 bytes used-exports-b.js 6.03 KiB + Entrypoint c 6.45 KiB = used-exports-356.js 422 bytes used-exports-c.js 6.04 KiB chunk (runtime: c) used-exports-c.js (c) 59 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] runtime modules 2.75 KiB 4 modules ./c.js 59 bytes [built] [code generated] + chunk (runtime: b, c) used-exports-356.js 72 bytes [initial] [rendered] split chunk (cache group: default) + ./objects.js 72 bytes [built] [code generated] + chunk (runtime: b) used-exports-b.js (b) 54 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] + runtime modules 2.75 KiB 4 modules + ./b.js 54 bytes [built] [code generated] chunk (runtime: a) used-exports-a.js (a) 126 bytes [entry] [rendered] ./a.js + 1 modules 126 bytes [built] [code generated] used-exports (webpack x.x.x) compiled successfully in X ms no-used-exports: asset no-used-exports-c.js 6.04 KiB [emitted] (name: c) - asset no-used-exports-a.js 6.03 KiB [emitted] (name: a) asset no-used-exports-b.js 6.03 KiB [emitted] (name: b) - asset no-used-exports-332.js 443 bytes [emitted] - Entrypoint a 6.46 KiB = no-used-exports-332.js 443 bytes no-used-exports-a.js 6.03 KiB - Entrypoint b 6.46 KiB = no-used-exports-332.js 443 bytes no-used-exports-b.js 6.03 KiB - Entrypoint c 6.47 KiB = no-used-exports-332.js 443 bytes no-used-exports-c.js 6.04 KiB - chunk (runtime: b) no-used-exports-b.js (b) 54 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] - runtime modules 2.75 KiB 4 modules - ./b.js 54 bytes [built] [code generated] - chunk (runtime: a, b, c) no-used-exports-332.js 72 bytes [initial] [rendered] split chunk (cache group: default) - ./objects.js 72 bytes [built] [code generated] + asset no-used-exports-a.js 6.03 KiB [emitted] (name: a) + asset no-used-exports-356.js 443 bytes [emitted] + Entrypoint a 6.46 KiB = no-used-exports-356.js 443 bytes no-used-exports-a.js 6.03 KiB + Entrypoint b 6.46 KiB = no-used-exports-356.js 443 bytes no-used-exports-b.js 6.03 KiB + Entrypoint c 6.47 KiB = no-used-exports-356.js 443 bytes no-used-exports-c.js 6.04 KiB chunk (runtime: c) no-used-exports-c.js (c) 59 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] runtime modules 2.75 KiB 4 modules ./c.js 59 bytes [built] [code generated] + chunk (runtime: a, b, c) no-used-exports-356.js 72 bytes [initial] [rendered] split chunk (cache group: default) + ./objects.js 72 bytes [built] [code generated] + chunk (runtime: b) no-used-exports-b.js (b) 54 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] + runtime modules 2.75 KiB 4 modules + ./b.js 54 bytes [built] [code generated] chunk (runtime: a) no-used-exports-a.js (a) 54 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] runtime modules 2.75 KiB 4 modules ./a.js 54 bytes [built] [code generated] @@ -4687,20 +4687,20 @@ no-used-exports: global: asset global-c.js 6.04 KiB [emitted] (name: c) - asset global-a.js 6.03 KiB [emitted] (name: a) asset global-b.js 6.03 KiB [emitted] (name: b) - asset global-332.js 443 bytes [emitted] - Entrypoint a 6.46 KiB = global-332.js 443 bytes global-a.js 6.03 KiB - Entrypoint b 6.46 KiB = global-332.js 443 bytes global-b.js 6.03 KiB - Entrypoint c 6.47 KiB = global-332.js 443 bytes global-c.js 6.04 KiB - chunk (runtime: b) global-b.js (b) 54 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] - runtime modules 2.75 KiB 4 modules - ./b.js 54 bytes [built] [code generated] - chunk (runtime: a, b, c) global-332.js 72 bytes [initial] [rendered] split chunk (cache group: default) - ./objects.js 72 bytes [built] [code generated] + asset global-a.js 6.03 KiB [emitted] (name: a) + asset global-356.js 443 bytes [emitted] + Entrypoint a 6.46 KiB = global-356.js 443 bytes global-a.js 6.03 KiB + Entrypoint b 6.46 KiB = global-356.js 443 bytes global-b.js 6.03 KiB + Entrypoint c 6.47 KiB = global-356.js 443 bytes global-c.js 6.04 KiB chunk (runtime: c) global-c.js (c) 59 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] runtime modules 2.75 KiB 4 modules ./c.js 59 bytes [built] [code generated] + chunk (runtime: a, b, c) global-356.js 72 bytes [initial] [rendered] split chunk (cache group: default) + ./objects.js 72 bytes [built] [code generated] + chunk (runtime: b) global-b.js (b) 54 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] + runtime modules 2.75 KiB 4 modules + ./b.js 54 bytes [built] [code generated] chunk (runtime: a) global-a.js (a) 54 bytes (javascript) 2.75 KiB (runtime) [entry] [rendered] runtime modules 2.75 KiB 4 modules ./a.js 54 bytes [built] [code generated] @@ -4708,7 +4708,7 @@ global: `; exports[`StatsTestCases should print correct stats for tree-shaking 1`] = ` -"asset bundle.js 6.88 KiB [emitted] (name: main) +"asset bundle.js 6.87 KiB [emitted] (name: main) runtime modules 663 bytes 3 modules orphan modules 14 bytes [orphan] 1 module cacheable modules 782 bytes @@ -4758,39 +4758,39 @@ webpack x.x.x compiled with 1 warning in X ms" `; exports[`StatsTestCases should print correct stats for wasm-explorer-examples-sync 1`] = ` -"assets by path *.js 21.7 KiB - asset bundle.js 16.3 KiB [emitted] (name: main) - asset 325.bundle.js 3.89 KiB [emitted] - asset 795.bundle.js 557 bytes [emitted] - asset 526.bundle.js 364 bytes [emitted] (id hint: vendors) - asset 189.bundle.js 243 bytes [emitted] - asset 517.bundle.js 243 bytes [emitted] - asset 20.bundle.js 241 bytes [emitted] +"assets by path *.js 22.3 KiB + asset bundle.js 16.8 KiB [emitted] (name: main) + asset 88.bundle.js 3.89 KiB [emitted] + asset 536.bundle.js 557 bytes [emitted] + asset 296.bundle.js 364 bytes [emitted] (id hint: vendors) + asset 344.bundle.js 243 bytes [emitted] + asset 532.bundle.js 243 bytes [emitted] + asset 48.bundle.js 241 bytes [emitted] assets by path *.wasm 1.37 KiB - asset e3f145b183228cc640d7.module.wasm 531 bytes [emitted] [immutable] - asset 82d524821ee70d495948.module.wasm 290 bytes [emitted] [immutable] - asset ea450800640f54975338.module.wasm 156 bytes [emitted] [immutable] - asset ebbf27083d239c1ad5e3.module.wasm 154 bytes [emitted] [immutable] - asset ee97efb6a05a4e504238.module.wasm 154 bytes [emitted] [immutable] - asset 0301cb3f9f4151b567f5.module.wasm 120 bytes [emitted] [immutable] -chunk (runtime: main) 20.bundle.js 50 bytes (javascript) 531 bytes (webassembly) [rendered] - ./duff.wasm 50 bytes (javascript) 531 bytes (webassembly) [built] [code generated] -chunk (runtime: main) bundle.js (main) 586 bytes (javascript) 9.16 KiB (runtime) [entry] [rendered] - runtime modules 9.16 KiB 11 modules - ./index.js 586 bytes [built] [code generated] -chunk (runtime: main) 189.bundle.js 50 bytes (javascript) 156 bytes (webassembly) [rendered] + asset c75f9deff2c326ca999c.module.wasm 531 bytes [emitted] [immutable] + asset da46f9cd53d21065ba9c.module.wasm 290 bytes [emitted] [immutable] + asset b89f6d5281b41d173041.module.wasm 156 bytes [emitted] [immutable] + asset 2903ad30d0c24ad32500.module.wasm 154 bytes [emitted] [immutable] + asset 74e49d7e028be61b9158.module.wasm 154 bytes [emitted] [immutable] + asset 5d4899f8ed85806fc14d.module.wasm 120 bytes [emitted] [immutable] +chunk (runtime: main) 48.bundle.js 50 bytes (javascript) 156 bytes (webassembly) [rendered] ./Q_rsqrt.wasm 50 bytes (javascript) 156 bytes (webassembly) [built] [code generated] -chunk (runtime: main) 325.bundle.js 1.45 KiB (javascript) 154 bytes (webassembly) [rendered] +chunk (runtime: main) 88.bundle.js 1.45 KiB (javascript) 154 bytes (webassembly) [rendered] ./testFunction.wasm 50 bytes (javascript) 154 bytes (webassembly) [dependent] [built] [code generated] ./tests.js 1.4 KiB [built] [code generated] -chunk (runtime: main) 517.bundle.js 50 bytes (javascript) 120 bytes (webassembly) [rendered] - ./popcnt.wasm 50 bytes (javascript) 120 bytes (webassembly) [built] [code generated] -chunk (runtime: main) 526.bundle.js (id hint: vendors) 34 bytes [rendered] split chunk (cache group: defaultVendors) +chunk (runtime: main) 296.bundle.js (id hint: vendors) 34 bytes [rendered] split chunk (cache group: defaultVendors) ./node_modules/env.js 34 bytes [built] [code generated] -chunk (runtime: main) 795.bundle.js 110 bytes (javascript) 444 bytes (webassembly) [rendered] +chunk (runtime: main) 344.bundle.js 50 bytes (javascript) 120 bytes (webassembly) [rendered] + ./popcnt.wasm 50 bytes (javascript) 120 bytes (webassembly) [built] [code generated] +chunk (runtime: main) 532.bundle.js 50 bytes (javascript) 531 bytes (webassembly) [rendered] + ./duff.wasm 50 bytes (javascript) 531 bytes (webassembly) [built] [code generated] +chunk (runtime: main) 536.bundle.js 110 bytes (javascript) 444 bytes (webassembly) [rendered] ./fact.wasm 50 bytes (javascript) 154 bytes (webassembly) [built] [code generated] ./fast-math.wasm 60 bytes (javascript) 290 bytes (webassembly) [built] [code generated] -runtime modules 9.16 KiB 11 modules +chunk (runtime: main) bundle.js (main) 586 bytes (javascript) 9.59 KiB (runtime) [entry] [rendered] + runtime modules 9.59 KiB 11 modules + ./index.js 586 bytes [built] [code generated] +runtime modules 9.59 KiB 11 modules cacheable modules 2.31 KiB (javascript) 1.37 KiB (webassembly) webassembly modules 310 bytes (javascript) 1.37 KiB (webassembly) ./Q_rsqrt.wasm 50 bytes (javascript) 156 bytes (webassembly) [built] [code generated] @@ -4807,8 +4807,8 @@ webpack x.x.x compiled successfully in X ms" `; exports[`StatsTestCases should print correct stats for worker-public-path 1`] = ` -"asset main-96fbc03a7e45e354f81a.js 3.59 KiB [emitted] [immutable] (name: main) -asset 442-579eebb6602aecc20b13.js 219 bytes [emitted] [immutable] +"asset main-9c3c04147b0478dd8ad5.js 3.59 KiB [emitted] [immutable] (name: main) +asset 560-579eebb6602aecc20b13.js 219 bytes [emitted] [immutable] runtime modules 1.81 KiB 5 modules cacheable modules 250 bytes ./index.js 115 bytes [built] [code generated] diff --git a/test/__snapshots__/target-browserslist.unittest.js.snap b/test/__snapshots__/target-browserslist.unittest.js.snap index 68a9428670f..c2e35cf68fd 100644 --- a/test/__snapshots__/target-browserslist.unittest.js.snap +++ b/test/__snapshots__/target-browserslist.unittest.js.snap @@ -3,6 +3,7 @@ exports[`browserslist target ["and_chr 80"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": true, "const": true, @@ -32,6 +33,7 @@ Object { exports[`browserslist target ["and_ff 68"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": true, "const": true, @@ -61,6 +63,7 @@ Object { exports[`browserslist target ["and_qq 10.4"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": true, @@ -90,6 +93,7 @@ Object { exports[`browserslist target ["and_uc 12.12"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": true, @@ -119,6 +123,7 @@ Object { exports[`browserslist target ["android 4"] 1`] = ` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": false, @@ -148,6 +153,7 @@ Object { exports[`browserslist target ["android 4.1"] 1`] = ` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": false, @@ -177,6 +183,7 @@ Object { exports[`browserslist target ["android 4.4.3-4.4.4"] 1`] = ` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": false, @@ -206,6 +213,7 @@ Object { exports[`browserslist target ["android 81"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": true, "const": true, @@ -235,6 +243,7 @@ Object { exports[`browserslist target ["baidu 7.12"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": false, @@ -264,6 +273,7 @@ Object { exports[`browserslist target ["bb 10"] 1`] = ` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": false, @@ -293,6 +303,7 @@ Object { exports[`browserslist target ["chrome 80","node 12.19.0"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": null, "const": true, @@ -322,6 +333,7 @@ Object { exports[`browserslist target ["chrome 80"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": true, "const": true, @@ -351,6 +363,7 @@ Object { exports[`browserslist target ["edge 79"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": true, "const": true, @@ -380,6 +393,7 @@ Object { exports[`browserslist target ["firefox 68"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": true, "const": true, @@ -409,6 +423,7 @@ Object { exports[`browserslist target ["firefox 80","chrome 80"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": true, "const": true, @@ -438,6 +453,7 @@ Object { exports[`browserslist target ["ie 11"] 1`] = ` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": false, @@ -467,6 +483,7 @@ Object { exports[`browserslist target ["ie_mob 11"] 1`] = ` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": false, @@ -496,6 +513,7 @@ Object { exports[`browserslist target ["ios_saf 12.0-12.1"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": false, "browser": true, "const": true, @@ -525,6 +543,7 @@ Object { exports[`browserslist target ["kaios 2.5"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": true, @@ -554,6 +573,7 @@ Object { exports[`browserslist target ["node 0.10.0"] 1`] = ` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "browser": false, "const": false, @@ -583,6 +603,7 @@ Object { exports[`browserslist target ["node 0.12.0"] 1`] = ` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "browser": false, "const": false, @@ -612,6 +633,7 @@ Object { exports[`browserslist target ["node 10.0.0"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": false, "browser": false, "const": true, @@ -641,6 +663,7 @@ Object { exports[`browserslist target ["node 10.17.0"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": false, "const": true, @@ -670,6 +693,7 @@ Object { exports[`browserslist target ["node 12.19.0"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": false, "const": true, @@ -699,6 +723,7 @@ Object { exports[`browserslist target ["op_mini all"] 1`] = ` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": false, @@ -728,6 +753,7 @@ Object { exports[`browserslist target ["op_mob 54"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": true, "const": true, @@ -757,6 +783,7 @@ Object { exports[`browserslist target ["opera 54"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": true, "const": true, @@ -786,6 +813,7 @@ Object { exports[`browserslist target ["safari 10"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": false, @@ -815,6 +843,7 @@ Object { exports[`browserslist target ["safari 11"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": false, "browser": true, "const": true, @@ -844,6 +873,7 @@ Object { exports[`browserslist target ["safari 12.0"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": false, "browser": true, "const": true, @@ -873,6 +903,7 @@ Object { exports[`browserslist target ["safari 12.1"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": false, "browser": true, "const": true, @@ -902,6 +933,7 @@ Object { exports[`browserslist target ["safari 13"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": false, "browser": true, "const": true, @@ -931,6 +963,7 @@ Object { exports[`browserslist target ["safari TP"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": true, "const": true, @@ -960,6 +993,7 @@ Object { exports[`browserslist target ["samsung 4"] 1`] = ` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": false, @@ -989,6 +1023,7 @@ Object { exports[`browserslist target ["samsung 9.2"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": true, "const": true, @@ -1018,6 +1053,7 @@ Object { exports[`browserslist target ["samsung 11.1-11.2"] 1`] = ` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "browser": true, "const": true, @@ -1047,6 +1083,7 @@ Object { exports[`browserslist target ["unknown 50"] 1`] = ` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "browser": true, "const": false, diff --git a/test/cases/chunks/destructuring-assignment/dir2/a.js b/test/cases/chunks/destructuring-assignment/dir2/a.js new file mode 100644 index 00000000000..59aa6ffd125 --- /dev/null +++ b/test/cases/chunks/destructuring-assignment/dir2/a.js @@ -0,0 +1,2 @@ +exports.a = 1; +exports.b = 2; diff --git a/test/cases/chunks/destructuring-assignment/dir2/json/array.json b/test/cases/chunks/destructuring-assignment/dir2/json/array.json new file mode 100644 index 00000000000..eac5f7b46e0 --- /dev/null +++ b/test/cases/chunks/destructuring-assignment/dir2/json/array.json @@ -0,0 +1 @@ +["a"] \ No newline at end of file diff --git a/test/cases/chunks/destructuring-assignment/dir2/json/object.json b/test/cases/chunks/destructuring-assignment/dir2/json/object.json new file mode 100644 index 00000000000..cb5b2f69bab --- /dev/null +++ b/test/cases/chunks/destructuring-assignment/dir2/json/object.json @@ -0,0 +1 @@ +{"a": 1} diff --git a/test/cases/chunks/destructuring-assignment/dir2/json/primitive.json b/test/cases/chunks/destructuring-assignment/dir2/json/primitive.json new file mode 100644 index 00000000000..231f150c579 --- /dev/null +++ b/test/cases/chunks/destructuring-assignment/dir2/json/primitive.json @@ -0,0 +1 @@ +"a" diff --git a/test/cases/chunks/destructuring-assignment/index.js b/test/cases/chunks/destructuring-assignment/index.js index 626a65391e1..1725b877fdb 100644 --- a/test/cases/chunks/destructuring-assignment/index.js +++ b/test/cases/chunks/destructuring-assignment/index.js @@ -10,3 +10,14 @@ it("should get warning on using 'webpackExports' with destructuring assignment", expect(def).toBe(3); done(); }); + +it("should not tree-shake default export for exportsType=default module", async () => { + const { default: object } = await import("./dir2/json/object.json"); + const { default: array } = await import("./dir2/json/array.json"); + const { default: primitive } = await import("./dir2/json/primitive.json"); + expect(object).toEqual({ a: 1 }); + expect(array).toEqual(["a"]); + expect(primitive).toBe("a"); + const { default: a } = await import("./dir2/a"); + expect(a).toEqual({ a: 1, b: 2 }); +}); diff --git a/test/cases/chunks/inline-options/dir15/a.js b/test/cases/chunks/inline-options/dir15/a.js new file mode 100644 index 00000000000..59aa6ffd125 --- /dev/null +++ b/test/cases/chunks/inline-options/dir15/a.js @@ -0,0 +1,2 @@ +exports.a = 1; +exports.b = 2; diff --git a/test/cases/chunks/inline-options/dir15/json/array.json b/test/cases/chunks/inline-options/dir15/json/array.json new file mode 100644 index 00000000000..eac5f7b46e0 --- /dev/null +++ b/test/cases/chunks/inline-options/dir15/json/array.json @@ -0,0 +1 @@ +["a"] \ No newline at end of file diff --git a/test/cases/chunks/inline-options/dir15/json/object.json b/test/cases/chunks/inline-options/dir15/json/object.json new file mode 100644 index 00000000000..cb5b2f69bab --- /dev/null +++ b/test/cases/chunks/inline-options/dir15/json/object.json @@ -0,0 +1 @@ +{"a": 1} diff --git a/test/cases/chunks/inline-options/dir15/json/primitive.json b/test/cases/chunks/inline-options/dir15/json/primitive.json new file mode 100644 index 00000000000..231f150c579 --- /dev/null +++ b/test/cases/chunks/inline-options/dir15/json/primitive.json @@ -0,0 +1 @@ +"a" diff --git a/test/cases/chunks/inline-options/index.js b/test/cases/chunks/inline-options/index.js index b671187151b..61555301e20 100644 --- a/test/cases/chunks/inline-options/index.js +++ b/test/cases/chunks/inline-options/index.js @@ -180,6 +180,7 @@ if (process.env.NODE_ENV === "production") { } ); }); + it("should be able to load with webpackFetchPriorty high, low and auto", function () { return Promise.all([ import(/* webpackFetchPriority: "high"*/ "./dir14/a"), @@ -187,6 +188,21 @@ if (process.env.NODE_ENV === "production") { import(/* webpackFetchPriority: "auto"*/ "./dir14/c"), ]) }) + + it("should not tree-shake default export for exportsType=default module", async function () { + const jsonObject = await import(/* webpackExports: ["default"] */ "./dir15/json/object.json"); + const jsonArray = await import(/* webpackExports: ["default"] */ "./dir15/json/array.json"); + const jsonPrimitive = await import(/* webpackExports: ["default"] */ "./dir15/json/primitive.json"); + expect(jsonObject.default).toEqual({ a: 1 }); + expect(jsonObject.a).toEqual(1); + expect(jsonArray.default).toEqual(["a"]); + expect(jsonArray[0]).toBe("a"); + expect(jsonPrimitive.default).toBe("a"); + const a = await import(/* webpackExports: ["default"] */"./dir15/a"); + expect(a.default).toEqual({ a: 1, b: 2 }); + expect(a.a).toBe(1); + expect(a.b).toBe(2); + }) } function testChunkLoading(load, expectedSyncInitial, expectedSyncRequested) { diff --git a/test/cases/errors/import-module-cycle-multiple/1/a.json b/test/cases/errors/import-module-cycle-multiple/1/a.json new file mode 100644 index 00000000000..9a389c9696a --- /dev/null +++ b/test/cases/errors/import-module-cycle-multiple/1/a.json @@ -0,0 +1 @@ +"./a.json" diff --git a/test/cases/errors/import-module-cycle-multiple/2/a.json b/test/cases/errors/import-module-cycle-multiple/2/a.json new file mode 100644 index 00000000000..75e02a30f04 --- /dev/null +++ b/test/cases/errors/import-module-cycle-multiple/2/a.json @@ -0,0 +1 @@ +"./b.json" diff --git a/test/cases/errors/import-module-cycle-multiple/2/b.json b/test/cases/errors/import-module-cycle-multiple/2/b.json new file mode 100644 index 00000000000..9a389c9696a --- /dev/null +++ b/test/cases/errors/import-module-cycle-multiple/2/b.json @@ -0,0 +1 @@ +"./a.json" diff --git a/test/cases/errors/import-module-cycle-multiple/3/a.json b/test/cases/errors/import-module-cycle-multiple/3/a.json new file mode 100644 index 00000000000..75e02a30f04 --- /dev/null +++ b/test/cases/errors/import-module-cycle-multiple/3/a.json @@ -0,0 +1 @@ +"./b.json" diff --git a/test/cases/errors/import-module-cycle-multiple/3/b.json b/test/cases/errors/import-module-cycle-multiple/3/b.json new file mode 100644 index 00000000000..5a2d1989f77 --- /dev/null +++ b/test/cases/errors/import-module-cycle-multiple/3/b.json @@ -0,0 +1 @@ +"./c.json" diff --git a/test/cases/errors/import-module-cycle-multiple/3/c.json b/test/cases/errors/import-module-cycle-multiple/3/c.json new file mode 100644 index 00000000000..9a389c9696a --- /dev/null +++ b/test/cases/errors/import-module-cycle-multiple/3/c.json @@ -0,0 +1 @@ +"./a.json" diff --git a/test/cases/errors/import-module-cycle-multiple/4/a.json b/test/cases/errors/import-module-cycle-multiple/4/a.json new file mode 100644 index 00000000000..08a6371d338 --- /dev/null +++ b/test/cases/errors/import-module-cycle-multiple/4/a.json @@ -0,0 +1 @@ +["./b.json", "./b.json"] diff --git a/test/cases/errors/import-module-cycle-multiple/4/b.json b/test/cases/errors/import-module-cycle-multiple/4/b.json new file mode 100644 index 00000000000..5a2d1989f77 --- /dev/null +++ b/test/cases/errors/import-module-cycle-multiple/4/b.json @@ -0,0 +1 @@ +"./c.json" diff --git a/test/cases/errors/import-module-cycle-multiple/4/c.json b/test/cases/errors/import-module-cycle-multiple/4/c.json new file mode 100644 index 00000000000..fe51488c706 --- /dev/null +++ b/test/cases/errors/import-module-cycle-multiple/4/c.json @@ -0,0 +1 @@ +[] diff --git a/test/cases/errors/import-module-cycle-multiple/index.js b/test/cases/errors/import-module-cycle-multiple/index.js new file mode 100644 index 00000000000..054ea2e1af6 --- /dev/null +++ b/test/cases/errors/import-module-cycle-multiple/index.js @@ -0,0 +1,31 @@ +it("should error importModule when a cycle with 2 modules is requested", () => { + expect(require("./loader!./2/a")).toEqual([ + ["./b.json", [ + ["./a.json", "err: There is a circular build dependency, which makes it impossible to create this module"] + ]] + ]); +}); +it("should error importModule when a cycle with 3 modules is requested", () => { + expect(require("./loader!./3/a")).toEqual([ + ["./b.json", [ + ["./c.json", [ + ["./a.json", "err: There is a circular build dependency, which makes it impossible to create this module"] + ]] + ]] + ]); +}); +it("should error importModule when requesting itself", () => { + expect(require("./loader!./1/a")).toEqual([ + ["./a.json", "err: There is a circular build dependency, which makes it impossible to create this module"] + ]); +}); +it("should not report a cycle when importModule is used twice", () => { + expect(require("./loader!./4/a")).toEqual([ + ["./b.json", [ + ["./c.json", []] + ]], + ["./b.json", [ + ["./c.json", []] + ]] + ]); +}); diff --git a/test/cases/errors/import-module-cycle-multiple/loader.js b/test/cases/errors/import-module-cycle-multiple/loader.js new file mode 100644 index 00000000000..3d13b9953d3 --- /dev/null +++ b/test/cases/errors/import-module-cycle-multiple/loader.js @@ -0,0 +1,23 @@ +/** @type {import("../../../../").LoaderDefinitionFunction} */ +exports.default = function (source) { + const content = JSON.parse(source); + // content is one reference or an array of references + const refs = Array.isArray(content) ? content : [content]; + const callback = this.async(); + const importReferencedModules = async () => { + const loadedRefs = [] + for(const ref of refs) { + try { + const source = await this.importModule("../loader!" + ref); + loadedRefs.push([ref, source]); + } catch(err) { + loadedRefs.push([ref, `err: ${err && err.message}`]); + } + } + return loadedRefs; + } + + importReferencedModules().then((loadResults) => { + callback(null, JSON.stringify(loadResults)); + }); +}; diff --git a/test/cases/errors/import-module-cycle/1/a.json b/test/cases/errors/import-module-cycle/1/a.json new file mode 100644 index 00000000000..9a389c9696a --- /dev/null +++ b/test/cases/errors/import-module-cycle/1/a.json @@ -0,0 +1 @@ +"./a.json" diff --git a/test/cases/errors/import-module-cycle/2/a.json b/test/cases/errors/import-module-cycle/2/a.json new file mode 100644 index 00000000000..75e02a30f04 --- /dev/null +++ b/test/cases/errors/import-module-cycle/2/a.json @@ -0,0 +1 @@ +"./b.json" diff --git a/test/cases/errors/import-module-cycle/2/b.json b/test/cases/errors/import-module-cycle/2/b.json new file mode 100644 index 00000000000..9a389c9696a --- /dev/null +++ b/test/cases/errors/import-module-cycle/2/b.json @@ -0,0 +1 @@ +"./a.json" diff --git a/test/cases/errors/import-module-cycle/3/a.json b/test/cases/errors/import-module-cycle/3/a.json new file mode 100644 index 00000000000..75e02a30f04 --- /dev/null +++ b/test/cases/errors/import-module-cycle/3/a.json @@ -0,0 +1 @@ +"./b.json" diff --git a/test/cases/errors/import-module-cycle/3/b.json b/test/cases/errors/import-module-cycle/3/b.json new file mode 100644 index 00000000000..5a2d1989f77 --- /dev/null +++ b/test/cases/errors/import-module-cycle/3/b.json @@ -0,0 +1 @@ +"./c.json" diff --git a/test/cases/errors/import-module-cycle/3/c.json b/test/cases/errors/import-module-cycle/3/c.json new file mode 100644 index 00000000000..9a389c9696a --- /dev/null +++ b/test/cases/errors/import-module-cycle/3/c.json @@ -0,0 +1 @@ +"./a.json" diff --git a/test/cases/errors/import-module-cycle/index.js b/test/cases/errors/import-module-cycle/index.js new file mode 100644 index 00000000000..3d5f92f0087 --- /dev/null +++ b/test/cases/errors/import-module-cycle/index.js @@ -0,0 +1,15 @@ +it("should error importModule when a cycle with 2 modules is requested", () => { + expect(require("./loader!./2/a")).toMatch( + /^source: err: There is a circular build dependency/ + ); +}); +it("should error importModule when a cycle with 3 modules is requested", () => { + expect(require("./loader!./3/a")).toMatch( + /^source: source: err: There is a circular build dependency/ + ); +}); +it("should error importModule when requesting itself", () => { + expect(require("./loader!./1/a")).toMatch( + /^err: There is a circular build dependency/ + ); +}); diff --git a/test/cases/errors/import-module-cycle/loader.js b/test/cases/errors/import-module-cycle/loader.js new file mode 100644 index 00000000000..84022701942 --- /dev/null +++ b/test/cases/errors/import-module-cycle/loader.js @@ -0,0 +1,12 @@ +/** @type {import("../../../../").LoaderDefinitionFunction} */ +exports.default = function (source) { + const ref = JSON.parse(source); + const callback = this.async(); + this.importModule("../loader!" + ref, {}, (err, exports) => { + if (err) { + callback(null, JSON.stringify(`err: ${err && err.message}`)); + } else { + callback(null, JSON.stringify(`source: ${exports}`)); + } + }); +}; diff --git a/test/cases/inner-graph/extend-class/c.js b/test/cases/inner-graph/extend-class/c.js new file mode 100644 index 00000000000..9fbff09a7ca --- /dev/null +++ b/test/cases/inner-graph/extend-class/c.js @@ -0,0 +1,21 @@ +import { BaseError, BaseError1, BaseError2, BaseError3 } from "./dep2"; + +export class ExtendedError extends BaseError { + constructor(message) { + super(message); + } +} +export class ExtendedError1 extends BaseError1 { + constructor(message) { + super(message); + } +} +export class ExtendedError2 extends BaseError2 { + myMethod() {} +} +export class ExtendedError3 extends BaseError3 {} +export class ExtendedError4 extends Error { + constructor(message = 'ExtendedError') { + super(message); + } +} diff --git a/test/cases/inner-graph/extend-class/dep1.js b/test/cases/inner-graph/extend-class/dep1.js index 50b7759b648..cdbb374a8b4 100644 --- a/test/cases/inner-graph/extend-class/dep1.js +++ b/test/cases/inner-graph/extend-class/dep1.js @@ -1,4 +1,4 @@ -import {A, B, Z} from "./dep2"; +import { A, B, Z, W } from "./dep2"; export const A1 = class A1 extends A { render() {return new E();} @@ -20,3 +20,4 @@ class D { } export const isZ = (new Z1()) instanceof Z; +export { W }; diff --git a/test/cases/inner-graph/extend-class/dep2.js b/test/cases/inner-graph/extend-class/dep2.js index 29fd36dbb33..75343cd50cf 100644 --- a/test/cases/inner-graph/extend-class/dep2.js +++ b/test/cases/inner-graph/extend-class/dep2.js @@ -7,15 +7,34 @@ export function mixin1(_class) {return _class} export function mixin2(_class) {return _class} export function mixin3(_class) {return _class} export function mixin4(_class) {return _class} +export function mixin5(_class) {return _class} export function getField() { return "test" } +export class BaseError extends Error {} +export class BaseError1 extends Error {} +export class BaseError2 extends Error {} +export class BaseError3 extends Error {} +export class W {} +export class J {} +export class K {} +var SuperClass = class {}; +export { SuperClass }; export const exportsInfoForA = __webpack_exports_info__.A.used; export const exportsInfoForB = __webpack_exports_info__.B.used; export const exportsInfoForC = __webpack_exports_info__.C.used; export const exportsInfoForY = __webpack_exports_info__.Y.used; export const exportsInfoForZ = __webpack_exports_info__.Z.used; +export const exportsInfoForW = __webpack_exports_info__.W.used; +export const exportsInfoForJ = __webpack_exports_info__.J.used; +export const exportsInfoForK = __webpack_exports_info__.K.used; export const exportsInfoForMixin1 = __webpack_exports_info__.mixin1.used; export const exportsInfoForMixin2 = __webpack_exports_info__.mixin2.used; export const exportsInfoForMixin3 = __webpack_exports_info__.mixin3.used; export const exportsInfoForMixin4 = __webpack_exports_info__.mixin4.used; +export const exportsInfoForMixin5 = __webpack_exports_info__.mixin5.used; export const exportsInfoForgetField = __webpack_exports_info__.getField.used; +export const exportsInfoForBaseError = __webpack_exports_info__.BaseError.used; +export const exportsInfoForBaseError1 = __webpack_exports_info__.BaseError1.used; +export const exportsInfoForBaseError2 = __webpack_exports_info__.BaseError2.used; +export const exportsInfoForBaseError3 = __webpack_exports_info__.BaseError3.used; +export const exportsInfoForSuperClass = __webpack_exports_info__.SuperClass.used; diff --git a/test/cases/inner-graph/extend-class/index.js b/test/cases/inner-graph/extend-class/index.js index 20c6f6803b3..69f1c125ca2 100644 --- a/test/cases/inner-graph/extend-class/index.js +++ b/test/cases/inner-graph/extend-class/index.js @@ -4,21 +4,44 @@ import { exportsInfoForC, exportsInfoForY, exportsInfoForZ, + exportsInfoForW, + exportsInfoForJ, + exportsInfoForK, exportsInfoForMixin1, exportsInfoForMixin2, exportsInfoForMixin3, - exportsInfoForMixin4 + exportsInfoForMixin4, + exportsInfoForMixin5, + exportsInfoForBaseError, + exportsInfoForBaseError1, + exportsInfoForBaseError2, + exportsInfoForBaseError3, + exportsInfoForSuperClass } from "./dep2"; it("should load modules correctly", () => { require("./module1"); require("./module2"); require("./module3"); + require("./module4"); + require("./module5"); + require("./module6"); + require("./module7"); + require("./module8"); + require("./module9"); }); if (process.env.NODE_ENV === "production") { - it("B should not be used", () => { - expect(exportsInfoForB).toBe(false); + it("W and J should not be used", () => { + expect(exportsInfoForJ).toBe(false); + expect(exportsInfoForW).toBe(false); + }); + + it("Keep extends with constructor", () => { + expect(exportsInfoForBaseError).toBe(true); + expect(exportsInfoForBaseError1).toBe(true); + expect(exportsInfoForBaseError2).toBe(false); + expect(exportsInfoForBaseError3).toBe(false); }); } @@ -26,16 +49,29 @@ it("A should be used", () => { expect(exportsInfoForA).toBe(true); }); +it("B should be used", () => { + expect(exportsInfoForB).toBe(true); +}); + +it("K should be used", () => { + expect(exportsInfoForK).toBe(true); +}); + it("Z used, inner graph can not determine const usage", () => { expect(exportsInfoForZ).toBe(true); }); +it("SuperClass should be used", () => { + expect(exportsInfoForSuperClass).toBe(true); +}); + it("Pure super expression should be unused, another used", () => { if (process.env.NODE_ENV === "production") { - expect(exportsInfoForMixin1).toBe(false); expect(exportsInfoForMixin4).toBe(false); + expect(exportsInfoForMixin5).toBe(false); } + expect(exportsInfoForMixin1).toBe(true); expect(exportsInfoForMixin2).toBe(true); expect(exportsInfoForMixin3).toBe(true); expect(exportsInfoForC).toBe(true); diff --git a/test/cases/inner-graph/extend-class/module4.js b/test/cases/inner-graph/extend-class/module4.js new file mode 100644 index 00000000000..1e78b04f6c1 --- /dev/null +++ b/test/cases/inner-graph/extend-class/module4.js @@ -0,0 +1,3 @@ +import {ExtendedError4} from "./c.js"; + +export default new ExtendedError4() diff --git a/test/cases/inner-graph/extend-class/module5.js b/test/cases/inner-graph/extend-class/module5.js new file mode 100644 index 00000000000..c05aaf0def2 --- /dev/null +++ b/test/cases/inner-graph/extend-class/module5.js @@ -0,0 +1,3 @@ +import { W } from "./dep2"; + +class BaseW extends W {} diff --git a/test/cases/inner-graph/extend-class/module6.js b/test/cases/inner-graph/extend-class/module6.js new file mode 100644 index 00000000000..046e9df215d --- /dev/null +++ b/test/cases/inner-graph/extend-class/module6.js @@ -0,0 +1,4 @@ +import { J } from "./dep2"; + +class BaseJ extends J {} +class BaseBaseJ extends BaseJ {} diff --git a/test/cases/inner-graph/extend-class/module7.js b/test/cases/inner-graph/extend-class/module7.js new file mode 100644 index 00000000000..86c9beccffb --- /dev/null +++ b/test/cases/inner-graph/extend-class/module7.js @@ -0,0 +1,6 @@ +import { K } from "./dep2"; + +class BaseK extends K {} +class BaseBaseK extends BaseK {} + +export default new BaseBaseK(); diff --git a/test/cases/inner-graph/extend-class/module8.js b/test/cases/inner-graph/extend-class/module8.js new file mode 100644 index 00000000000..f2d076b0fe0 --- /dev/null +++ b/test/cases/inner-graph/extend-class/module8.js @@ -0,0 +1,9 @@ +import { mixin5 } from "./dep2"; + +class Bar extends /*#__PURE__*/ mixin5(null) { + static displayName = "Point"; +} + +function test() { + return Bar.displayName; +} diff --git a/test/cases/inner-graph/extend-class/module9.js b/test/cases/inner-graph/extend-class/module9.js new file mode 100644 index 00000000000..efc36d37579 --- /dev/null +++ b/test/cases/inner-graph/extend-class/module9.js @@ -0,0 +1,8 @@ +import { SuperClass } from "./dep2"; + +var UnusedClass = class extends SuperClass { + constructor() { + super(); + } + }, + unusedVariable = new UnusedClass(); diff --git a/test/compareStringsNumeric.unittest.js b/test/compareStringsNumeric.unittest.js new file mode 100644 index 00000000000..f55402fe350 --- /dev/null +++ b/test/compareStringsNumeric.unittest.js @@ -0,0 +1,94 @@ +const { compareStringsNumeric } = require("../lib/util/comparators.js"); + +/** + * @param {string} a string + * @param {string} b string + * @returns {-1|0|1} compare result + */ +const referenceComparer = (a, b) => { + const partsA = a.split(/(\d+)/); + const partsB = b.split(/(\d+)/); + const len = Math.min(partsA.length, partsB.length); + for (let i = 0; i < len; i++) { + const pA = partsA[i]; + const pB = partsB[i]; + if (i % 2 === 0) { + if (pA.length > pB.length) { + if (pA.slice(0, pB.length) > pB) return 1; + return -1; + } else if (pB.length > pA.length) { + if (pB.slice(0, pA.length) > pA) return -1; + return 1; + } else { + if (pA < pB) return -1; + if (pA > pB) return 1; + } + } else { + const nA = +pA; + const nB = +pB; + if (nA < nB) return -1; + if (nA > nB) return 1; + } + } + if (partsB.length < partsA.length) return 1; + if (partsB.length > partsA.length) return -1; + return 0; +}; + +describe(compareStringsNumeric.name, () => { + const testCases = [ + ["", "a", 1], + ["a", "", -1], + ["", "0", -1], + ["1", "", 1], + ["", "", 0], + ["a", "1", -1], + ["1", "a", 1], + ["_", "1", -1], + ["1", "_", 1], + ["a", "b", -1], + ["b", "a", 1], + ["a", "a", 0], + ["a1", "a2", -1], + ["a2", "a1", 1], + ["a1", "a1", 0], + ["ab1", "ab2", -1], + ["ab2", "ab1", 1], + ["ab1", "a1", -1], + ["a1", "ab1", 1], + ["a1", "a10", -1], + ["a10", "a1", 1], + ["a1", "a01", 0], + ["a1", "a1a", 1], + ["a1a", "a1", -1], + ["a1a", "a01a", 0], + ["a1a", "a1b", -1], + ["a1b", "a1a", 1], + ["a1a", "a1a1", -1], + ["a1a1", "a1a", 1], + ["a1a1", "a1a1", 0], + ["a1a1", "a1a2", -1], + ["a1a2", "a1a1", 1], + ["a1a1", "a1a01", 0], + ["a1a1", "a1a1a", 1], + ["a1a1a", "a1a1", -1], + ["a1a1a", "a1a1a", 0], + ["a1a1a", "a1a1b", -1], + ["a1a1b", "a1a1a", 1], + ["a1a1a", "a1a1a1", -1], + ["a1a1a1", "a1a1a", 1], + ["a1a1a1", "a1a1a1", 0], + ["a1a1a1", "a1a1a2", -1], + ["a1a1a2", "a1a1a1", 1], + ["a1a1a1", "a1a1a01", 0], + ["a1a1a1", "a1a1a1a", 1] + ]; + + for (const testCase of testCases) { + const [a, b, expected] = testCase; + it(`returns ${expected} when comparing "${a}" to "${b}"`, () => { + expect(referenceComparer(a, b)).toBe(expected); + expect(compareStringsNumeric(a, b)).toBe(expected); + }); + } +}); diff --git a/test/configCases/asset-emitted/normal/webpack.config.js b/test/configCases/asset-emitted/normal/webpack.config.js index 63eaa7b5db4..26033941418 100644 --- a/test/configCases/asset-emitted/normal/webpack.config.js +++ b/test/configCases/asset-emitted/normal/webpack.config.js @@ -19,11 +19,11 @@ module.exports = { ); compiler.hooks.afterEmit.tap("Test", () => { expect(files).toMatchInlineSnapshot(` -Object { - "662.bundle0.js": true, - "bundle0.js": true, -} -`); + Object { + "324.bundle0.js": true, + "bundle0.js": true, + } + `); }); } ] diff --git a/test/configCases/async-module/environment-not-support-async-warning/index.js b/test/configCases/async-module/environment-not-support-async-warning/index.js new file mode 100644 index 00000000000..b80f6c769f1 --- /dev/null +++ b/test/configCases/async-module/environment-not-support-async-warning/index.js @@ -0,0 +1,9 @@ +it("should have warnings for environment not support async/await when using asyncModule", () => { + return import("./reexport").then(({ number, getNumber, importRequest, moduleRequest, promiseRequest }) => { + expect(number).toBe(1); + expect(getNumber()).toBe(42); + expect(importRequest).toBe("import.js"); + expect(moduleRequest).toBe("module.js"); + expect(promiseRequest).toBe("promise.js"); + }); +}); diff --git a/test/configCases/async-module/environment-not-support-async-warning/reexport.js b/test/configCases/async-module/environment-not-support-async-warning/reexport.js new file mode 100644 index 00000000000..e4c330e84fe --- /dev/null +++ b/test/configCases/async-module/environment-not-support-async-warning/reexport.js @@ -0,0 +1,5 @@ +export { default as number } from "./tla"; +export { getNumber } from "./wasm.wat" +export { default as moduleRequest } from "external-module" +export { default as importRequest } from "external-import" +export { default as promiseRequest } from "external-promise" diff --git a/test/configCases/async-module/environment-not-support-async-warning/test.filter.js b/test/configCases/async-module/environment-not-support-async-warning/test.filter.js new file mode 100644 index 00000000000..bd7f4573a77 --- /dev/null +++ b/test/configCases/async-module/environment-not-support-async-warning/test.filter.js @@ -0,0 +1,5 @@ +var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); + +module.exports = function (config) { + return supportsWebAssembly(); +}; diff --git a/test/configCases/async-module/environment-not-support-async-warning/tla.js b/test/configCases/async-module/environment-not-support-async-warning/tla.js new file mode 100644 index 00000000000..7ff47b218ac --- /dev/null +++ b/test/configCases/async-module/environment-not-support-async-warning/tla.js @@ -0,0 +1 @@ +export default await Promise.resolve(1) diff --git a/test/configCases/async-module/environment-not-support-async-warning/warnings.js b/test/configCases/async-module/environment-not-support-async-warning/warnings.js new file mode 100644 index 00000000000..e0bb2da70fe --- /dev/null +++ b/test/configCases/async-module/environment-not-support-async-warning/warnings.js @@ -0,0 +1,27 @@ +module.exports = [ + [ + { moduleName: /tla\.js/ }, + /The generated code contains 'async\/await'/, + /"topLevelAwait"/ + ], + [ + { moduleName: /external \["import\.js","request"\]/ }, + /The generated code contains 'async\/await'/, + /"external import"/ + ], + [ + { moduleName: /external \["module\.js","request"\]/ }, + /The generated code contains 'async\/await'/, + /"external module"/ + ], + [ + { moduleName: /external "Promise\.resolve\('promise\.js'\)"/ }, + /The generated code contains 'async\/await'/, + /"external promise"/ + ], + [ + { moduleName: /wasm\.wat/ }, + /The generated code contains 'async\/await'/, + /"asyncWebAssembly"/ + ] +]; diff --git a/test/configCases/async-module/environment-not-support-async-warning/wasm.wat b/test/configCases/async-module/environment-not-support-async-warning/wasm.wat new file mode 100644 index 00000000000..d8081e18c3b --- /dev/null +++ b/test/configCases/async-module/environment-not-support-async-warning/wasm.wat @@ -0,0 +1,4 @@ +(module + (func $getNumber (export "getNumber") (result i32) + (i32.const 42))) + diff --git a/test/configCases/async-module/environment-not-support-async-warning/webpack.config.js b/test/configCases/async-module/environment-not-support-async-warning/webpack.config.js new file mode 100644 index 00000000000..81f034c466e --- /dev/null +++ b/test/configCases/async-module/environment-not-support-async-warning/webpack.config.js @@ -0,0 +1,27 @@ +/** @type {import("../../../../").Configuration} */ +module.exports = { + module: { + rules: [ + { + test: /\.wat$/, + loader: "wast-loader", + type: "webassembly/async" + } + ] + }, + output: { + environment: { + dynamicImport: true, + asyncFunction: false + }, + importFunctionName: "((name) => Promise.resolve({ request: name }))" + }, + externals: { + "external-module": ["module module.js", "request"], + "external-import": ["import import.js", "request"], + "external-promise": "promise Promise.resolve('promise.js')" + }, + experiments: { + asyncWebAssembly: true + } +}; diff --git a/test/configCases/chunk-index/issue-18008/A.js b/test/configCases/chunk-index/issue-18008/A.js new file mode 100644 index 00000000000..38498ca8aab --- /dev/null +++ b/test/configCases/chunk-index/issue-18008/A.js @@ -0,0 +1,3 @@ +import './m.css' + +export default import(/* webpackChunkName: 'shared' */ './shared') diff --git a/test/configCases/chunk-index/issue-18008/B-2.js b/test/configCases/chunk-index/issue-18008/B-2.js new file mode 100644 index 00000000000..d76708775e3 --- /dev/null +++ b/test/configCases/chunk-index/issue-18008/B-2.js @@ -0,0 +1 @@ +export default import(/* webpackChunkName: 'shared' */ './shared') diff --git a/test/configCases/chunk-index/issue-18008/B.js b/test/configCases/chunk-index/issue-18008/B.js new file mode 100644 index 00000000000..06d9beae119 --- /dev/null +++ b/test/configCases/chunk-index/issue-18008/B.js @@ -0,0 +1 @@ +export default import(/* webpackChunkName: 'B-2' */ './B-2') diff --git a/test/configCases/chunk-index/issue-18008/m.css b/test/configCases/chunk-index/issue-18008/m.css new file mode 100644 index 00000000000..42109d1e8e6 --- /dev/null +++ b/test/configCases/chunk-index/issue-18008/m.css @@ -0,0 +1,3 @@ +.m { + color: red; +} \ No newline at end of file diff --git a/test/configCases/chunk-index/issue-18008/main.js b/test/configCases/chunk-index/issue-18008/main.js new file mode 100644 index 00000000000..db0004aced8 --- /dev/null +++ b/test/configCases/chunk-index/issue-18008/main.js @@ -0,0 +1,4 @@ +it('should compile', async () => { + await (await import(/* webpackChunkName: 'A' */ './A')).default + await (await import(/* webpackChunkName: 'B' */ './B')).default +}) diff --git a/test/configCases/chunk-index/issue-18008/n.css b/test/configCases/chunk-index/issue-18008/n.css new file mode 100644 index 00000000000..d98c8a002b6 --- /dev/null +++ b/test/configCases/chunk-index/issue-18008/n.css @@ -0,0 +1,3 @@ +.n { + color: red; +} \ No newline at end of file diff --git a/test/configCases/chunk-index/issue-18008/shared.js b/test/configCases/chunk-index/issue-18008/shared.js new file mode 100644 index 00000000000..fa12217397f --- /dev/null +++ b/test/configCases/chunk-index/issue-18008/shared.js @@ -0,0 +1,2 @@ +import './m.css' +import './n.css' diff --git a/test/configCases/chunk-index/issue-18008/test.config.js b/test/configCases/chunk-index/issue-18008/test.config.js new file mode 100644 index 00000000000..3ea542cb9cb --- /dev/null +++ b/test/configCases/chunk-index/issue-18008/test.config.js @@ -0,0 +1,5 @@ +module.exports = { + findBundle: function (i, options) { + return ["main.js", "A.js", "shared.js", "B.js", "B-2.js"]; + } +}; diff --git a/test/configCases/chunk-index/issue-18008/webpack.config.js b/test/configCases/chunk-index/issue-18008/webpack.config.js new file mode 100644 index 00000000000..f8f8f9af1d7 --- /dev/null +++ b/test/configCases/chunk-index/issue-18008/webpack.config.js @@ -0,0 +1,65 @@ +/** @typedef {import("../../../../types").Compilation} Compilation */ +/** @typedef {import("../../../../types").Module} Module */ +/** @type {import("../../../../types").Configuration} */ +module.exports = { + entry: { + main: "./main.js" + }, + output: { + filename: "[name].js" + }, + optimization: { + splitChunks: false, + chunkIds: "named" + }, + plugins: [ + function () { + /** + * @param {Compilation} compilation compilation + * @returns {void} + */ + const handler = compilation => { + compilation.hooks.afterSeal.tap("testcase", () => { + const data = {}; + for (const [name, group] of compilation.namedChunkGroups) { + /** @type {Map} */ + const modules = new Map(); + for (const chunk of group.chunks) { + for (const module of compilation.chunkGraph.getChunkModulesIterable( + chunk + )) { + const preOrder = group.getModulePreOrderIndex(module); + if (typeof preOrder === "number") { + modules.set(module, preOrder); + } + } + } + const sortedModules = Array.from(modules).sort((a, b) => { + return a[1] - b[1]; + }); + const text = sortedModules + .map( + ([m, index]) => + `${index}: ${m.readableIdentifier( + compilation.requestShortener + )}` + ) + .join(", "); + data[name + "Index"] = text; + } + expect(data).toEqual({ + AIndex: "0: ./A.js, 1: css ./m.css", + "B-2Index": "0: ./B-2.js", + BIndex: "0: ./B.js", + mainIndex: "0: ./main.js", + sharedIndex: "0: ./shared.js, 1: css ./m.css, 2: css ./n.css" + }); + }); + }; + this.hooks.compilation.tap("testcase", handler); + } + ], + experiments: { + css: true + } +}; diff --git a/test/configCases/clean/lib-manifest-plugin/index.js b/test/configCases/clean/lib-manifest-plugin/index.js new file mode 100644 index 00000000000..bbd9de4153f --- /dev/null +++ b/test/configCases/clean/lib-manifest-plugin/index.js @@ -0,0 +1 @@ +it("should compile and run the test", function() {}); diff --git a/test/configCases/clean/lib-manifest-plugin/readdir.js b/test/configCases/clean/lib-manifest-plugin/readdir.js new file mode 100644 index 00000000000..b2f404e7f74 --- /dev/null +++ b/test/configCases/clean/lib-manifest-plugin/readdir.js @@ -0,0 +1,38 @@ +const fs = require('fs'); +const path = require('path'); + +function handlePath(path) { + return path.replace(/\\/g, "/"); +} + +module.exports = function readDir(from) { + const collectedFiles = []; + const collectedDirectories = []; + const stack = [from]; + let cursor; + + while ((cursor = stack.pop())) { + const stat = fs.statSync(cursor); + + if (stat.isDirectory()) { + const items = fs.readdirSync(cursor); + + if (from !== cursor) { + const relative = path.relative(from, cursor); + collectedDirectories.push(handlePath(relative)); + } + + for (let i = 0; i < items.length; i++) { + stack.push(path.join(cursor, items[i])); + } + } else { + const relative = path.relative(from, cursor); + collectedFiles.push(handlePath(relative)); + } + } + + return { + files: collectedFiles, + directories: collectedDirectories + }; +} diff --git a/test/configCases/clean/lib-manifest-plugin/webpack.config.js b/test/configCases/clean/lib-manifest-plugin/webpack.config.js new file mode 100644 index 00000000000..0efe44f4d54 --- /dev/null +++ b/test/configCases/clean/lib-manifest-plugin/webpack.config.js @@ -0,0 +1,33 @@ +const path = require("path"); +const readDir = require("./readdir"); +const webpack = require("../../../../"); + +/** @type {import("../../../../").Configuration} */ +module.exports = { + output: { + clean: true + }, + plugins: [ + compiler => { + compiler.hooks.thisCompilation.tap("Test", compilation => { + const outputPath = compilation.getPath(compiler.outputPath, {}); + new webpack.DllPlugin({ + name: "[name]_dll", + path: path.resolve(outputPath, "manifest.json") + }).apply(compiler); + }); + compiler.hooks.afterEmit.tap("Test", compilation => { + const outputPath = compilation.getPath(compiler.outputPath, {}); + expect(readDir(outputPath)).toMatchInlineSnapshot(` + Object { + "directories": Array [], + "files": Array [ + "manifest.json", + "bundle0.js", + ], + } + `); + }); + } + ] +}; diff --git a/test/configCases/code-generation/re-export-namespace-concat/index.js b/test/configCases/code-generation/re-export-namespace-concat/index.js index aa2dbb6b823..54875df4824 100644 --- a/test/configCases/code-generation/re-export-namespace-concat/index.js +++ b/test/configCases/code-generation/re-export-namespace-concat/index.js @@ -34,6 +34,10 @@ it("should use/preserve accessor form for import object and namespaces", functio const bb = obj1.up.down?.left.right; + const ww = require('./module1').obj1["bing"]?.bang; + const xx = require('./module1').obj1["pip"].pop(); + const yy = require('./module3')["m_2"]["m_1"]["obj1"]["tip"].top(); + data.nested.object3["unknownProperty"].depth = "deep"; (obj1)["aaa"].bbb; @@ -48,28 +52,32 @@ it("should use/preserve accessor form for import object and namespaces", functio // Imported objects and import namespaces should use dot notation. Any references to the properties of exports // should be preserved as either quotes or dot notation, depending on the original source. - expectSourceToContain(source, 'const x1 = module1_namespaceObject;'); - expectSourceToContain(source, 'const x2 = obj1;'); + expectSourceToContain(source, 'const x1 = module1;'); + expectSourceToContain(source, 'const x2 = module1.obj1;'); + + expectSourceToContain(source, 'const z1 = module1.obj1["plants"];'); + expectSourceToContain(source, 'const z2 = module1.obj1["funcs"]();'); + expectSourceToContain(source, 'const z3 = module1.obj1["pots"];'); + expectSourceToContain(source, 'const z4 = module1.obj1["subs"]();'); - expectSourceToContain(source, 'const z1 = obj1["plants"];'); - expectSourceToContain(source, 'const z2 = obj1["funcs"]();'); - expectSourceToContain(source, 'const z3 = obj1["pots"];'); - expectSourceToContain(source, 'const z4 = obj1["subs"]();'); + expectSourceToContain(source, 'const a = module2/* m_1.obj1 */.a.obj1["flip"].flap;'); + expectSourceToContain(source, 'const b = module2/* m_1.obj1 */.a.obj1.zip["zap"];'); + expectSourceToContain(source, 'const c = module2/* m_1.obj1 */.a.obj1["ding"].dong();'); + expectSourceToContain(source, 'const d = module2/* m_1.obj1 */.a.obj1.sing["song"]();'); - expectSourceToContain(source, 'const a = obj1["flip"].flap;'); - expectSourceToContain(source, 'const b = obj1.zip["zap"];'); - expectSourceToContain(source, 'const c = obj1["ding"].dong();'); - expectSourceToContain(source, 'const d = obj1.sing["song"]();'); + expectSourceToContain(source, 'const aa = module3/* m_2.m_1.obj1 */.a.a.obj1["zoom"];'); - expectSourceToContain(source, 'const aa = obj1["zoom"];'); + expectSourceToContain(source, 'const bb = module1.obj1.up.down?.left.right;'); - expectSourceToContain(source, 'const bb = obj1.up.down?.left.right;'); + expectSourceToContain(source, 'const ww = (__webpack_require__(/*! ./module1 */ 688).obj1)["bing"]?.bang;'); + expectSourceToContain(source, 'const xx = (__webpack_require__(/*! ./module1 */ 688).obj1)["pip"].pop();'); + expectSourceToContain(source, 'const yy = (__webpack_require__(/*! ./module3 */ 989)/* .m_2.m_1.obj1 */ .a.a.obj1)["tip"].top();'); expectSourceToContain(source, 'data_namespaceObject.a.a["unknownProperty"].depth = "deep";'); - expectSourceToContain(source, '(obj1)["aaa"].bbb;'); - expectSourceToContain(source, '(obj1)["ccc"].ddd;'); - expectSourceToContain(source, '(obj1["eee"]).fff;'); - expectSourceToContain(source, '(obj1["ggg"]).hhh;'); - expectSourceToContain(source, '((obj1)["iii"]).jjj;'); + expectSourceToContain(source, '(module1.obj1)["aaa"].bbb;'); + expectSourceToContain(source, '(module1.obj1)["ccc"].ddd;'); + expectSourceToContain(source, '(module1.obj1["eee"]).fff;'); + expectSourceToContain(source, '(module1.obj1["ggg"]).hhh;'); + expectSourceToContain(source, '((module1.obj1)["iii"]).jjj;'); }); diff --git a/test/configCases/code-generation/re-export-namespace/index.js b/test/configCases/code-generation/re-export-namespace/index.js index d41eb1f4d32..c10a78ff870 100644 --- a/test/configCases/code-generation/re-export-namespace/index.js +++ b/test/configCases/code-generation/re-export-namespace/index.js @@ -34,6 +34,10 @@ it("should use/preserve accessor form for import object and namespaces", functio const bb = obj1.up.down?.left.right; + const ww = require('./module1').obj1["bing"]?.bang; + const xx = require('./module1').obj1["pip"].pop(); + const yy = require('./module3')["m_2"]["m_1"]["obj1"]["tip"].top(); + data.nested.object3["unknownProperty"].depth = "deep"; (obj1)["aaa"].bbb; @@ -65,6 +69,10 @@ it("should use/preserve accessor form for import object and namespaces", functio expectSourceToContain(source, 'const bb = _module1__WEBPACK_IMPORTED_MODULE_0__.obj1.up.down?.left.right;'); + expectSourceToContain(source, 'const ww = (__webpack_require__(/*! ./module1 */ 688).obj1)["bing"]?.bang;'); + expectSourceToContain(source, 'const xx = (__webpack_require__(/*! ./module1 */ 688).obj1)["pip"].pop();'); + expectSourceToContain(source, 'const yy = (__webpack_require__(/*! ./module3 */ 989).m_2.m_1.obj1)["tip"].top();'); + expectSourceToContain(source, '_data__WEBPACK_IMPORTED_MODULE_3__.nested.object3["unknownProperty"].depth = "deep";'); expectSourceToContain(source, '(_module1__WEBPACK_IMPORTED_MODULE_0__.obj1)["aaa"].bbb;'); diff --git a/test/configCases/container/1-container-full/webpack.config.js b/test/configCases/container/1-container-full/webpack.config.js index 049f843e7eb..0c9d66c16d2 100644 --- a/test/configCases/container/1-container-full/webpack.config.js +++ b/test/configCases/container/1-container-full/webpack.config.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line node/no-unpublished-require const { ModuleFederationPlugin } = require("../../../../").container; const common = { diff --git a/test/configCases/container/2-container-full/webpack.config.js b/test/configCases/container/2-container-full/webpack.config.js index 72e7ba1eb5a..8f8dc9aac55 100644 --- a/test/configCases/container/2-container-full/webpack.config.js +++ b/test/configCases/container/2-container-full/webpack.config.js @@ -1,4 +1,4 @@ -// eslint-disable-next-line node/no-unpublished-require +// eslint-disable-next-line n/no-unpublished-require const { ModuleFederationPlugin } = require("../../../../").container; /** @type {import("../../../../").Configuration} */ diff --git a/test/configCases/container/3-container-full/webpack.config.js b/test/configCases/container/3-container-full/webpack.config.js index ed46429112e..a20051ec9af 100644 --- a/test/configCases/container/3-container-full/webpack.config.js +++ b/test/configCases/container/3-container-full/webpack.config.js @@ -1,4 +1,4 @@ -// eslint-disable-next-line node/no-unpublished-require +// eslint-disable-next-line n/no-unpublished-require const { ModuleFederationPlugin } = require("../../../../").container; /** @type {import("../../../../").Configuration} */ diff --git a/test/configCases/container/exposed-overridables/webpack.config.js b/test/configCases/container/exposed-overridables/webpack.config.js index 2e5f55e1ee0..cc5aa51bb95 100644 --- a/test/configCases/container/exposed-overridables/webpack.config.js +++ b/test/configCases/container/exposed-overridables/webpack.config.js @@ -1,4 +1,4 @@ -// eslint-disable-next-line node/no-unpublished-require +// eslint-disable-next-line n/no-unpublished-require const { ModuleFederationPlugin } = require("../../../../").container; /** @type {import("../../../../").Configuration} */ diff --git a/test/configCases/container/module-federation-with-shareScope/webpack.config.js b/test/configCases/container/module-federation-with-shareScope/webpack.config.js index c7c7c547e5a..218ebc25ddb 100644 --- a/test/configCases/container/module-federation-with-shareScope/webpack.config.js +++ b/test/configCases/container/module-federation-with-shareScope/webpack.config.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line node/no-unpublished-require const { ModuleFederationPlugin } = require("../../../../").container; const common = { diff --git a/test/configCases/css/css-modules-broken-keyframes/index.js b/test/configCases/css/css-modules-broken-keyframes/index.js index a94e3dcf226..70ad95d873f 100644 --- a/test/configCases/css/css-modules-broken-keyframes/index.js +++ b/test/configCases/css/css-modules-broken-keyframes/index.js @@ -2,13 +2,11 @@ const prod = process.env.NODE_ENV === "production"; it("should allow to create css modules", done => { prod - ? __non_webpack_require__("./249.bundle0.js") + ? __non_webpack_require__("./848.bundle0.js") : __non_webpack_require__("./use-style_js.bundle0.js"); import("./use-style.js").then(({ default: x }) => { try { - expect(x).toEqual({ - class: prod ? "my-app-274-S" : "./style.module.css-class", - }); + expect(x).toMatchSnapshot(prod ? "prod" : "dev"); } catch (e) { return done(e); } diff --git a/test/configCases/css/css-modules-in-node/index.js b/test/configCases/css/css-modules-in-node/index.js index 2977d17e1dd..935999b86c9 100644 --- a/test/configCases/css/css-modules-in-node/index.js +++ b/test/configCases/css/css-modules-in-node/index.js @@ -3,104 +3,7 @@ const prod = process.env.NODE_ENV === "production"; it("should allow to create css modules", done => { import("../css-modules/use-style.js").then(({ default: x }) => { try { - expect(x).toEqual({ - global: undefined, - class: prod ? "my-app-274-S" : "./style.module.css-class", - currentWmultiParams: prod ? "my-app-274-yK" : "./style.module.css-local12", - futureWmultiParams: prod ? "my-app-274-Y4" : "./style.module.css-local14", - hasWmultiParams: prod ? "my-app-274-PK" : "./style.module.css-local11", - matchesWmultiParams: prod ? "my-app-274-$Y" : "./style.module.css-local9", - mozAnyWmultiParams: prod ? "my-app-274-TT" : "./style.module.css-local15", - pastWmultiParams: prod ? "my-app-274-P_" : "./style.module.css-local13", - webkitAnyWmultiParams: prod ? "my-app-274-rT" : "./style.module.css-local16", - whereWmultiParams: prod ? "my-app-274-ie" : "./style.module.css-local10", - local: prod - ? "my-app-274-Zw my-app-274-yl my-app-274-J_ my-app-274-gc" - : "./style.module.css-local1 ./style.module.css-local2 ./style.module.css-local3 ./style.module.css-local4", - local2: prod - ? "my-app-274-Xg my-app-274-AY" - : "./style.module.css-local5 ./style.module.css-local6", - nested: prod - ? "my-app-274-RX undefined my-app-274-X2" - : "./style.module.css-nested1 undefined ./style.module.css-nested3", - notWmultiParams: prod - ? "my-app-274-Kw" - : "./style.module.css-local7", - isWmultiParams: prod - ? "my-app-274-rw" - : "./style.module.css-local8", - ident: prod ? "my-app-274-yR" : "./style.module.css-ident", - keyframes: prod ? "my-app-274-y3" : "./style.module.css-localkeyframes", - animation: prod ? "my-app-274-oQ" : "./style.module.css-animation", - vars: prod - ? "--my-app-274-y4 my-app-274-gR undefined my-app-274-xk" - : "--./style.module.css-local-color ./style.module.css-vars undefined ./style.module.css-globalVars", - media: prod - ? "my-app-274-w7" - : "./style.module.css-wideScreenClass", - mediaWithOperator: prod - ? "my-app-274-J" - : "./style.module.css-narrowScreenClass", - supports: prod - ? "my-app-274-T$" - : "./style.module.css-displayGridInSupports", - supportsWithOperator: prod - ? "my-app-274-zz" - : "./style.module.css-floatRightInNegativeSupports", - mediaInSupports: prod - ? "my-app-274-Kr" - : "./style.module.css-displayFlexInMediaInSupports", - supportsInMedia: prod - ? "my-app-274-SQ" - : "./style.module.css-displayFlexInSupportsInMedia", - displayFlexInSupportsInMediaUpperCase: prod - ? "my-app-274-XM" - : "./style.module.css-displayFlexInSupportsInMediaUpperCase", - keyframesUPPERCASE: prod - ? "my-app-274-T4" - : "./style.module.css-localkeyframesUPPERCASE", - localkeyframes2UPPPERCASE: prod - ? "my-app-274-Xi" - : "./style.module.css-localkeyframes2UPPPERCASE", - VARS: prod - ? "--my-app-274-DJ my-app-274-ms undefined my-app-274-cU" - : "--./style.module.css-LOCAL-COLOR ./style.module.css-VARS undefined ./style.module.css-globalVarsUpperCase", - inSupportScope: prod - ? "my-app-274-FO" - : "./style.module.css-inSupportScope", - animationName: prod - ? "my-app-274-w3" - : "./style.module.css-animationName", - mozAnimationName: prod - ? "my-app-274-t6" - : "./style.module.css-mozAnimationName", - myColor: prod - ? "--my-app-274-lC" - : "--./style.module.css-my-color", - paddingLg: prod - ? "my-app-274-FP" - : "./style.module.css-padding-lg", - paddingSm: prod - ? "my-app-274-zE" - : "./style.module.css-padding-sm", - classLocalScope: prod - ? "my-app-274-gz" - : "./style.module.css-class-local-scope", - inLocalGlobalScope: prod - ? "my-app-274-Zv" - : "./style.module.css-in-local-global-scope", - classInContainer: prod - ? "my-app-274-Gp" - : "./style.module.css-class-in-container", - deepClassInContainer: prod - ? "my-app-274-rn" - : "./style.module.css-deep-class-in-container", - cssModuleWithCustomFileExtension: prod - ? "my-app-444-s" - : "./style.module.my-css-myCssClass", - notAValidCssModuleExtension: true, - UsedClassName: prod ? "my-app-627-Q3" : "./identifiers.module.css-UsedClassName", - }); + expect(x).toMatchSnapshot(prod ? "prod" : "dev"); } catch (e) { return done(e); } @@ -111,17 +14,9 @@ it("should allow to create css modules", done => { import * as style from "../css-modules/style.module.css"; it("should allow to import css modules", () => { - expect(style.class).toBe(prod ? "my-app-274-S" : "./style.module.css-class"); - expect(style.local1).toBe( - prod ? "my-app-274-Zw" : "./style.module.css-local1" - ); - expect(style.local2).toBe( - prod ? "my-app-274-yl" : "./style.module.css-local2" - ); - expect(style.local3).toBe( - prod ? "my-app-274-J_" : "./style.module.css-local3" - ); - expect(style.local4).toBe( - prod ? "my-app-274-gc" : "./style.module.css-local4" - ); + expect(style.class).toMatchSnapshot(prod ? "class-prod" : "class-dev"); + expect(style.local1).toMatchSnapshot(prod ? "local1-prod" : "local1-dev"); + expect(style.local2).toMatchSnapshot(prod ? "local2-prod" : "local2-dev"); + expect(style.local3).toMatchSnapshot(prod ? "local3-prod" : "local3-dev"); + expect(style.local4).toMatchSnapshot(prod ? "local4-prod" : "local4-dev"); }); diff --git a/test/configCases/css/css-modules/index.js b/test/configCases/css/css-modules/index.js index 9a88a8b3153..c25c5633945 100644 --- a/test/configCases/css/css-modules/index.js +++ b/test/configCases/css/css-modules/index.js @@ -2,124 +2,15 @@ const prod = process.env.NODE_ENV === "production"; it("should allow to create css modules", done => { prod - ? __non_webpack_require__("./249.bundle1.js") + ? __non_webpack_require__("./848.bundle1.js") : __non_webpack_require__("./use-style_js.bundle0.js"); import("./use-style.js").then(({ default: x }) => { try { - expect(x).toEqual({ - global: undefined, - class: prod ? "my-app-274-S" : "./style.module.css-class", - currentWmultiParams: prod - ? "my-app-274-yK" - : "./style.module.css-local12", - futureWmultiParams: prod - ? "my-app-274-Y4" - : "./style.module.css-local14", - hasWmultiParams: prod ? "my-app-274-PK" : "./style.module.css-local11", - matchesWmultiParams: prod - ? "my-app-274-$Y" - : "./style.module.css-local9", - mozAnyWmultiParams: prod - ? "my-app-274-TT" - : "./style.module.css-local15", - pastWmultiParams: prod ? "my-app-274-P_" : "./style.module.css-local13", - webkitAnyWmultiParams: prod - ? "my-app-274-rT" - : "./style.module.css-local16", - whereWmultiParams: prod - ? "my-app-274-ie" - : "./style.module.css-local10", - local: prod - ? "my-app-274-Zw my-app-274-yl my-app-274-J_ my-app-274-gc" - : "./style.module.css-local1 ./style.module.css-local2 ./style.module.css-local3 ./style.module.css-local4", - local2: prod - ? "my-app-274-Xg my-app-274-AY" - : "./style.module.css-local5 ./style.module.css-local6", - nested: prod - ? "my-app-274-RX undefined my-app-274-X2" - : "./style.module.css-nested1 undefined ./style.module.css-nested3", - notWmultiParams: prod - ? "my-app-274-Kw" - : "./style.module.css-local7", - isWmultiParams: prod - ? "my-app-274-rw" - : "./style.module.css-local8", - ident: prod ? "my-app-274-yR" : "./style.module.css-ident", - keyframes: prod ? "my-app-274-y3" : "./style.module.css-localkeyframes", - animation: prod ? "my-app-274-oQ" : "./style.module.css-animation", - vars: prod - ? "--my-app-274-y4 my-app-274-gR undefined my-app-274-xk" - : "--./style.module.css-local-color ./style.module.css-vars undefined ./style.module.css-globalVars", - media: prod - ? "my-app-274-w7" - : "./style.module.css-wideScreenClass", - mediaWithOperator: prod - ? "my-app-274-J" - : "./style.module.css-narrowScreenClass", - supports: prod - ? "my-app-274-T$" - : "./style.module.css-displayGridInSupports", - supportsWithOperator: prod - ? "my-app-274-zz" - : "./style.module.css-floatRightInNegativeSupports", - mediaInSupports: prod - ? "my-app-274-Kr" - : "./style.module.css-displayFlexInMediaInSupports", - supportsInMedia: prod - ? "my-app-274-SQ" - : "./style.module.css-displayFlexInSupportsInMedia", - displayFlexInSupportsInMediaUpperCase: prod - ? "my-app-274-XM" - : "./style.module.css-displayFlexInSupportsInMediaUpperCase", - keyframesUPPERCASE: prod - ? "my-app-274-T4" - : "./style.module.css-localkeyframesUPPERCASE", - localkeyframes2UPPPERCASE: prod - ? "my-app-274-Xi" - : "./style.module.css-localkeyframes2UPPPERCASE", - VARS: prod - ? "--my-app-274-DJ my-app-274-ms undefined my-app-274-cU" - : "--./style.module.css-LOCAL-COLOR ./style.module.css-VARS undefined ./style.module.css-globalVarsUpperCase", - inSupportScope: prod - ? "my-app-274-FO" - : "./style.module.css-inSupportScope", - animationName: prod - ? "my-app-274-w3" - : "./style.module.css-animationName", - mozAnimationName: prod - ? "my-app-274-t6" - : "./style.module.css-mozAnimationName", - myColor: prod - ? "--my-app-274-lC" - : "--./style.module.css-my-color", - paddingLg: prod - ? "my-app-274-FP" - : "./style.module.css-padding-lg", - paddingSm: prod - ? "my-app-274-zE" - : "./style.module.css-padding-sm", - classLocalScope: prod - ? "my-app-274-gz" - : "./style.module.css-class-local-scope", - inLocalGlobalScope: prod - ? "my-app-274-Zv" - : "./style.module.css-in-local-global-scope", - classInContainer: prod - ? "my-app-274-Gp" - : "./style.module.css-class-in-container", - deepClassInContainer: prod - ? "my-app-274-rn" - : "./style.module.css-deep-class-in-container", - cssModuleWithCustomFileExtension: prod - ? "my-app-444-s" - : "./style.module.my-css-myCssClass", - notAValidCssModuleExtension: true, - UsedClassName: prod ? "my-app-627-Q3" : "./identifiers.module.css-UsedClassName", - }); + expect(x).toMatchSnapshot(prod ? "prod" : "dev"); const fs = __non_webpack_require__("fs"); const path = __non_webpack_require__("path"); - const cssOutputFilename = prod ? "249.bundle1.css" : "use-style_js.bundle0.css"; + const cssOutputFilename = prod ? "848.bundle1.css" : "use-style_js.bundle0.css"; const cssContent = fs.readFileSync( path.join(__dirname, cssOutputFilename), diff --git a/test/configCases/css/css-modules/test.config.js b/test/configCases/css/css-modules/test.config.js index b6aaa9c8b8e..1267091793a 100644 --- a/test/configCases/css/css-modules/test.config.js +++ b/test/configCases/css/css-modules/test.config.js @@ -2,6 +2,6 @@ module.exports = { findBundle: function (i, options) { return i === 0 ? ["./use-style_js.bundle0.js", "bundle0.js"] - : ["./249.bundle1.js", "bundle1.js"]; + : ["./848.bundle1.js", "bundle1.js"]; } }; diff --git a/test/configCases/css/exports-only-generator-options/index.js b/test/configCases/css/exports-only-generator-options/index.js new file mode 100644 index 00000000000..1d827846c58 --- /dev/null +++ b/test/configCases/css/exports-only-generator-options/index.js @@ -0,0 +1,26 @@ +it("should not have .css file", (done) => { + __non_webpack_require__("./exports_style_module_css.bundle0.js"); + __non_webpack_require__("./exports_style_module_css_exportsOnly.bundle0.js"); + Promise.all([ + import("../exports/style.module.css"), + import("../exports/style.module.css?module"), + import("../exports/style.module.css?exportsOnly"), + ]).then(([style1, style2, style3]) => { + const ns = nsObj({ + a: "a", + abc: "a b c", + comments: "abc def", + "white space": "abc\n\tdef", + default: "default" + }); + expect(style1).toEqual(ns); + expect(style2).toEqual(ns); + expect(style3).toEqual(ns); + }).then(() => { + const fs = __non_webpack_require__("fs"); + const path = __non_webpack_require__("path"); + expect(fs.existsSync(path.resolve(__dirname, "exports_style_module_css.bundle0.css"))).toBe(false); + expect(fs.existsSync(path.resolve(__dirname, "exports_style_module_css_exportsOnly.bundle0.css"))).toBe(false); + done() + }).catch(e => done(e)) +}); diff --git a/test/configCases/css/exports-only-generator-options/webpack.config.js b/test/configCases/css/exports-only-generator-options/webpack.config.js new file mode 100644 index 00000000000..45c7608a848 --- /dev/null +++ b/test/configCases/css/exports-only-generator-options/webpack.config.js @@ -0,0 +1,36 @@ +/** @type {import("../../../../").Configuration} */ +module.exports = [ + { + target: "web", + mode: "development", + module: { + generator: { + css: { + exportsOnly: true + }, + "css/module": { + exportsOnly: false + } + }, + rules: [ + { + resourceQuery: /\?module/, + type: "css/module" + }, + { + resourceQuery: /\?exportsOnly/, + generator: { + exportsOnly: true + }, + type: "css" + } + ] + }, + experiments: { + css: true + }, + node: { + __dirname: false + } + } +]; diff --git a/test/configCases/css/large/index.js b/test/configCases/css/large/index.js index 4af1d3654d6..bf5d3cb8272 100644 --- a/test/configCases/css/large/index.js +++ b/test/configCases/css/large/index.js @@ -2,15 +2,11 @@ const prod = process.env.NODE_ENV === "production"; it("should allow to create css modules", done => { prod - ? __non_webpack_require__("./249.bundle1.js") + ? __non_webpack_require__("./848.bundle1.js") : __non_webpack_require__("./use-style_js.bundle0.js"); import("./use-style.js").then(({ default: x }) => { try { - expect(x).toEqual({ - placeholder: prod - ? "252-uhHx" - : "my-app-./tailwind.module.css-placeholder-gray-700" - }); + expect(x).toMatchSnapshot(prod ? "prod" : "dev"); } catch (e) { return done(e); } diff --git a/test/configCases/css/named-exports-parser-options/index.js b/test/configCases/css/named-exports-parser-options/index.js new file mode 100644 index 00000000000..987c5d8f358 --- /dev/null +++ b/test/configCases/css/named-exports-parser-options/index.js @@ -0,0 +1,22 @@ +import * as style1 from "./style.module.css" +import style2 from "./style.module.css?default" +import * as style3 from "./style.module.css?named" + +it("should able to import with different namedExports", () => { + expect(style1).toEqual(nsObj({ class: './style.module.css-class' })); + expect(style2).toEqual(nsObj({ class: './style.module.css?default-class' })); + expect(style3).toEqual(nsObj({ class: './style.module.css?named-class' })); +}); + +it("should able to import with different namedExports (async)", (done) => { + Promise.all([ + import("./style.module.css"), + import("./style.module.css?default"), + import("./style.module.css?named"), + ]).then(([style1, style2, style3]) => { + expect(style1).toEqual(nsObj({ class: './style.module.css-class' })); + expect(style2).toEqual(nsObj({ default: nsObj({ class: './style.module.css?default-class' }) })); + expect(style3).toEqual(nsObj({ class: './style.module.css?named-class' })); + done() + }, done) +}); diff --git a/test/configCases/css/named-exports-parser-options/style.module.css b/test/configCases/css/named-exports-parser-options/style.module.css new file mode 100644 index 00000000000..626e93720d0 --- /dev/null +++ b/test/configCases/css/named-exports-parser-options/style.module.css @@ -0,0 +1,3 @@ +.class { + color: red; +} diff --git a/test/configCases/css/named-exports-parser-options/webpack.config.js b/test/configCases/css/named-exports-parser-options/webpack.config.js new file mode 100644 index 00000000000..50b4c7745cf --- /dev/null +++ b/test/configCases/css/named-exports-parser-options/webpack.config.js @@ -0,0 +1,26 @@ +/** @type {import("../../../../").Configuration} */ +module.exports = { + target: "node", + mode: "development", + module: { + rules: [ + { + resourceQuery: /\?default/, + parser: { + namedExports: false + }, + type: "css/module" + }, + { + resourceQuery: /\?named/, + parser: { + namedExports: true + }, + type: "css/module" + } + ] + }, + experiments: { + css: true + } +}; diff --git a/test/configCases/css/prefer-relative-css-import/bar.modules.css b/test/configCases/css/prefer-relative-css-import/bar.modules.css new file mode 100644 index 00000000000..212af39cfba --- /dev/null +++ b/test/configCases/css/prefer-relative-css-import/bar.modules.css @@ -0,0 +1,7 @@ +body { + color: red; +} + +.bar { + color: red; +} diff --git a/test/configCases/css/prefer-relative-css-import/foo.css b/test/configCases/css/prefer-relative-css-import/foo.css new file mode 100644 index 00000000000..bb644f91459 --- /dev/null +++ b/test/configCases/css/prefer-relative-css-import/foo.css @@ -0,0 +1,7 @@ +body { + background: red; +} + +.foo { + color: red; +} diff --git a/test/configCases/css/prefer-relative-css-import/index.js b/test/configCases/css/prefer-relative-css-import/index.js new file mode 100644 index 00000000000..cb4c7ea1e9c --- /dev/null +++ b/test/configCases/css/prefer-relative-css-import/index.js @@ -0,0 +1,14 @@ +import * as styles1 from "./style.less"; +import * as styles2 from "./style.modules.less"; + +it("should prefer relative", () => { + expect(styles1).toEqual(nsObj({})); + expect(styles2).toEqual(nsObj({ + "style-module": "./style.modules.less-style-module", + })); + + const style = getComputedStyle(document.body); + + expect(style.getPropertyValue("background")).toBe(" red"); + expect(style.getPropertyValue("color")).toBe(" red"); +}); diff --git a/test/configCases/css/prefer-relative-css-import/node_modules/bar.modules.css/package.json b/test/configCases/css/prefer-relative-css-import/node_modules/bar.modules.css/package.json new file mode 100644 index 00000000000..bfdbb88698b --- /dev/null +++ b/test/configCases/css/prefer-relative-css-import/node_modules/bar.modules.css/package.json @@ -0,0 +1,4 @@ +{ + "name": "bar.modules.css", + "main": "style.css" +} diff --git a/test/configCases/css/prefer-relative-css-import/node_modules/bar.modules.css/style.css b/test/configCases/css/prefer-relative-css-import/node_modules/bar.modules.css/style.css new file mode 100644 index 00000000000..36505138bc9 --- /dev/null +++ b/test/configCases/css/prefer-relative-css-import/node_modules/bar.modules.css/style.css @@ -0,0 +1,3 @@ +body { + color: blue; +} diff --git a/test/configCases/css/prefer-relative-css-import/node_modules/foo.css/package.json b/test/configCases/css/prefer-relative-css-import/node_modules/foo.css/package.json new file mode 100644 index 00000000000..f273efd2294 --- /dev/null +++ b/test/configCases/css/prefer-relative-css-import/node_modules/foo.css/package.json @@ -0,0 +1,4 @@ +{ + "name": "foo.css", + "main": "style.css" +} diff --git a/test/configCases/css/prefer-relative-css-import/node_modules/foo.css/style.css b/test/configCases/css/prefer-relative-css-import/node_modules/foo.css/style.css new file mode 100644 index 00000000000..eedeb9d0ff9 --- /dev/null +++ b/test/configCases/css/prefer-relative-css-import/node_modules/foo.css/style.css @@ -0,0 +1,3 @@ +body { + background: blue; +} diff --git a/test/configCases/css/prefer-relative-css-import/style.less b/test/configCases/css/prefer-relative-css-import/style.less new file mode 100644 index 00000000000..7aed5ec6680 --- /dev/null +++ b/test/configCases/css/prefer-relative-css-import/style.less @@ -0,0 +1,5 @@ +@import 'foo.css'; + +.style { + color: red; +} diff --git a/test/configCases/css/prefer-relative-css-import/style.modules.less b/test/configCases/css/prefer-relative-css-import/style.modules.less new file mode 100644 index 00000000000..69dc14ca454 --- /dev/null +++ b/test/configCases/css/prefer-relative-css-import/style.modules.less @@ -0,0 +1,5 @@ +@import 'bar.modules.css'; + +.style-module { + color: red; +} diff --git a/test/configCases/css/prefer-relative-css-import/test.config.js b/test/configCases/css/prefer-relative-css-import/test.config.js new file mode 100644 index 00000000000..0590757288f --- /dev/null +++ b/test/configCases/css/prefer-relative-css-import/test.config.js @@ -0,0 +1,8 @@ +module.exports = { + moduleScope(scope) { + const link = scope.window.document.createElement("link"); + link.rel = "stylesheet"; + link.href = "bundle0.css"; + scope.window.document.head.appendChild(link); + } +}; diff --git a/test/configCases/css/prefer-relative-css-import/webpack.config.js b/test/configCases/css/prefer-relative-css-import/webpack.config.js new file mode 100644 index 00000000000..b4ebfb3d73f --- /dev/null +++ b/test/configCases/css/prefer-relative-css-import/webpack.config.js @@ -0,0 +1,17 @@ +/** @type {import("../../../../").Configuration} */ +module.exports = { + target: "web", + mode: "development", + module: { + rules: [ + { + test: /\.less$/, + use: "less-loader", + type: "css/auto" + } + ] + }, + experiments: { + css: true + } +}; diff --git a/test/configCases/custom-source-type/localization/index.js b/test/configCases/custom-source-type/localization/index.js index 80cefc0b47c..14a82c66f24 100644 --- a/test/configCases/custom-source-type/localization/index.js +++ b/test/configCases/custom-source-type/localization/index.js @@ -4,13 +4,13 @@ it("should generate the correct output files", () => { __STATS__.children[INDEX].assets.map(asset => asset.name).sort() ).toEqual( [ - NORMAL1 && `634.bundle${INDEX}.js`, - NORMAL2 && `882.bundle${INDEX}.js`, + NORMAL2 && `220.bundle${INDEX}.js`, + NORMAL1 && `752.bundle${INDEX}.js`, `bundle${INDEX}.js`, - CONTENT2 && "localization-264.js", - "localization-530.js", - NORMAL1 && "localization-634.js", - NORMAL2 && "localization-882.js" + NORMAL2 && "localization-220.js", + CONTENT2 && "localization-372.js", + NORMAL1 && "localization-752.js", + "localization-832.js" ].filter(Boolean) ); }); @@ -37,7 +37,7 @@ if (NORMAL1) { it("should still load normal chunks", () => { if (TARGET === "web") { Promise.resolve().then(() => { - __non_webpack_require__(`./634.bundle${INDEX}.js`); + __non_webpack_require__(`./752.bundle${INDEX}.js`); }); } @@ -51,7 +51,7 @@ if (NORMAL2) { it("should still another load normal chunks", () => { if (TARGET === "web") { Promise.resolve().then(() => { - __non_webpack_require__(`./882.bundle${INDEX}.js`); + __non_webpack_require__(`./220.bundle${INDEX}.js`); }); } diff --git a/test/configCases/dll-plugin-entry/1-use-dll/webpack.config.js b/test/configCases/dll-plugin-entry/1-use-dll/webpack.config.js index 461b1dc69d6..4cb0ca0bb40 100644 --- a/test/configCases/dll-plugin-entry/1-use-dll/webpack.config.js +++ b/test/configCases/dll-plugin-entry/1-use-dll/webpack.config.js @@ -7,7 +7,8 @@ module.exports = { }, plugins: [ new webpack.DllReferencePlugin({ - manifest: require("../../../js/config/dll-plugin-entry/manifest0.json"), // eslint-disable-line node/no-missing-require + // eslint-disable-next-line n/no-missing-require + manifest: require("../../../js/config/dll-plugin-entry/manifest0.json"), name: "../0-create-dll/dll.js", scope: "dll", sourceType: "commonjs2" diff --git a/test/configCases/dll-plugin-entry/2-error-non-entry/webpack.config.js b/test/configCases/dll-plugin-entry/2-error-non-entry/webpack.config.js index 461b1dc69d6..4cb0ca0bb40 100644 --- a/test/configCases/dll-plugin-entry/2-error-non-entry/webpack.config.js +++ b/test/configCases/dll-plugin-entry/2-error-non-entry/webpack.config.js @@ -7,7 +7,8 @@ module.exports = { }, plugins: [ new webpack.DllReferencePlugin({ - manifest: require("../../../js/config/dll-plugin-entry/manifest0.json"), // eslint-disable-line node/no-missing-require + // eslint-disable-next-line n/no-missing-require + manifest: require("../../../js/config/dll-plugin-entry/manifest0.json"), name: "../0-create-dll/dll.js", scope: "dll", sourceType: "commonjs2" diff --git a/test/configCases/dll-plugin-side-effects/1-use-dll/webpack.config.js b/test/configCases/dll-plugin-side-effects/1-use-dll/webpack.config.js index 14b447481e5..62558963d36 100644 --- a/test/configCases/dll-plugin-side-effects/1-use-dll/webpack.config.js +++ b/test/configCases/dll-plugin-side-effects/1-use-dll/webpack.config.js @@ -4,7 +4,8 @@ var webpack = require("../../../../"); module.exports = { plugins: [ new webpack.DllReferencePlugin({ - manifest: require("../../../js/config/dll-plugin-side-effects/manifest0.json"), // eslint-disable-line node/no-missing-require + // eslint-disable-next-line n/no-missing-require + manifest: require("../../../js/config/dll-plugin-side-effects/manifest0.json"), name: "../0-create-dll/dll.js", scope: "dll", sourceType: "commonjs2" diff --git a/test/configCases/dll-plugin/1-issue-10475/webpack.config.js b/test/configCases/dll-plugin/1-issue-10475/webpack.config.js index d1cf3a50e8b..38803383176 100644 --- a/test/configCases/dll-plugin/1-issue-10475/webpack.config.js +++ b/test/configCases/dll-plugin/1-issue-10475/webpack.config.js @@ -4,7 +4,8 @@ var webpack = require("../../../../"); module.exports = { plugins: [ new webpack.DllReferencePlugin({ - manifest: require("../../../js/config/dll-plugin/issue-10475.json"), // eslint-disable-line node/no-missing-require + // eslint-disable-next-line n/no-missing-require + manifest: require("../../../js/config/dll-plugin/issue-10475.json"), name: "../0-issue-10475/dll.js", scope: "dll", sourceType: "commonjs2" diff --git a/test/configCases/dll-plugin/1-use-dll/webpack.config.js b/test/configCases/dll-plugin/1-use-dll/webpack.config.js index dc432da78a6..92f315cf121 100644 --- a/test/configCases/dll-plugin/1-use-dll/webpack.config.js +++ b/test/configCases/dll-plugin/1-use-dll/webpack.config.js @@ -7,7 +7,8 @@ module.exports = { }, plugins: [ new webpack.DllReferencePlugin({ - manifest: require("../../../js/config/dll-plugin/manifest0.json"), // eslint-disable-line node/no-missing-require + // eslint-disable-next-line n/no-missing-require + manifest: require("../../../js/config/dll-plugin/manifest0.json"), name: "../0-create-dll/dll.js", scope: "dll", sourceType: "commonjs2", diff --git a/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js b/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js index 0f50727568e..b7d736bfd25 100644 --- a/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js +++ b/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js @@ -26,7 +26,8 @@ module.exports = { }, plugins: [ new webpack.DllReferencePlugin({ - manifest: require("../../../js/config/dll-plugin/manifest0.json"), // eslint-disable-line node/no-missing-require + // eslint-disable-next-line n/no-missing-require + manifest: require("../../../js/config/dll-plugin/manifest0.json"), name: "../0-create-dll/dll.js", context: path.resolve(__dirname, "../0-create-dll"), sourceType: "commonjs2" diff --git a/test/configCases/dll-plugin/3-use-dll-with-hashid/webpack.config.js b/test/configCases/dll-plugin/3-use-dll-with-hashid/webpack.config.js index a065fa62528..4df22aed053 100644 --- a/test/configCases/dll-plugin/3-use-dll-with-hashid/webpack.config.js +++ b/test/configCases/dll-plugin/3-use-dll-with-hashid/webpack.config.js @@ -23,7 +23,8 @@ module.exports = { }, plugins: [ new webpack.DllReferencePlugin({ - manifest: require("../../../js/config/dll-plugin/manifest0.json"), // eslint-disable-line node/no-missing-require + // eslint-disable-next-line n/no-missing-require + manifest: require("../../../js/config/dll-plugin/manifest0.json"), name: "../0-create-dll/dll.js", context: path.resolve(__dirname, "../0-create-dll"), sourceType: "commonjs2" diff --git a/test/configCases/dll-plugin/4-use-dll-with-contenthash/webpack.config.js b/test/configCases/dll-plugin/4-use-dll-with-contenthash/webpack.config.js index 6ea85deee54..370e97826f2 100644 --- a/test/configCases/dll-plugin/4-use-dll-with-contenthash/webpack.config.js +++ b/test/configCases/dll-plugin/4-use-dll-with-contenthash/webpack.config.js @@ -7,7 +7,8 @@ module.exports = { }, plugins: [ new webpack.DllReferencePlugin({ - manifest: require("../../../js/config/dll-plugin/manifest0.json"), // eslint-disable-line node/no-missing-require + // eslint-disable-next-line n/no-missing-require + manifest: require("../../../js/config/dll-plugin/manifest0.json"), name: "../0-create-dll-with-contenthash/dll.js", scope: "dll", sourceType: "commonjs2", diff --git a/test/configCases/ecmaVersion/browserslist-config-env/webpack.config.js b/test/configCases/ecmaVersion/browserslist-config-env/webpack.config.js index 9f8e4ec3dcc..0d7cff2980a 100644 --- a/test/configCases/ecmaVersion/browserslist-config-env/webpack.config.js +++ b/test/configCases/ecmaVersion/browserslist-config-env/webpack.config.js @@ -9,6 +9,7 @@ module.exports = { expect(compilation.outputOptions.environment).toMatchInlineSnapshot(` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "const": false, "destructuring": false, diff --git a/test/configCases/ecmaVersion/browserslist-config/webpack.config.js b/test/configCases/ecmaVersion/browserslist-config/webpack.config.js index f92c521eff8..cf6c92ffc7a 100644 --- a/test/configCases/ecmaVersion/browserslist-config/webpack.config.js +++ b/test/configCases/ecmaVersion/browserslist-config/webpack.config.js @@ -9,6 +9,7 @@ module.exports = { expect(compilation.outputOptions.environment).toMatchInlineSnapshot(` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "const": false, "destructuring": false, diff --git a/test/configCases/ecmaVersion/browserslist-query/webpack.config.js b/test/configCases/ecmaVersion/browserslist-query/webpack.config.js index f0db5d3e844..cd12757bd1e 100644 --- a/test/configCases/ecmaVersion/browserslist-query/webpack.config.js +++ b/test/configCases/ecmaVersion/browserslist-query/webpack.config.js @@ -7,6 +7,7 @@ module.exports = { expect(compilation.outputOptions.environment).toMatchInlineSnapshot(` Object { "arrowFunction": false, + "asyncFunction": false, "bigIntLiteral": false, "const": false, "destructuring": false, diff --git a/test/configCases/ecmaVersion/browserslist/webpack.config.js b/test/configCases/ecmaVersion/browserslist/webpack.config.js index 801640dd208..b12963fb939 100644 --- a/test/configCases/ecmaVersion/browserslist/webpack.config.js +++ b/test/configCases/ecmaVersion/browserslist/webpack.config.js @@ -7,6 +7,7 @@ module.exports = { expect(compilation.outputOptions.environment).toMatchInlineSnapshot(` Object { "arrowFunction": true, + "asyncFunction": true, "bigIntLiteral": true, "const": true, "destructuring": true, diff --git a/test/configCases/externals/global/index.js b/test/configCases/externals/global/index.js index 821f2376eb2..b8a5d8b0009 100644 --- a/test/configCases/externals/global/index.js +++ b/test/configCases/externals/global/index.js @@ -5,7 +5,7 @@ afterEach(done => { it("should move externals in chunks into entry chunk", function() { global.EXTERNAL_TEST_GLOBAL = 42; - // eslint-disable-next-line node/no-missing-require + // eslint-disable-next-line n/no-missing-require const result = require("external"); expect(result).toBe(42); }); diff --git a/test/configCases/externals/non-amd-externals-amd/index.js b/test/configCases/externals/non-amd-externals-amd/index.js new file mode 100644 index 00000000000..dda9ae39696 --- /dev/null +++ b/test/configCases/externals/non-amd-externals-amd/index.js @@ -0,0 +1,33 @@ +var fs = require("fs"); +var path = require("path"); + +var dependencyArrayRegex = /define\((\[[^\]]*\]), (function)?\(/; +var source = fs.readFileSync(path.join(__dirname, "bundle0.js"), "utf-8"); +var [, deps] = dependencyArrayRegex.exec(source); + +it("should correctly import a AMD external", function() { + var external = require("external0"); + expect(external).toBe("module 0"); +}); + +it("should contain the AMD external in the dependency array", function() { + expect(deps).toContain("\"external0\""); +}); + +it("should correctly import a non-AMD external", function() { + var external = require("external1"); + expect(external).toBe("abc"); +}); + +it("should not contain the non-AMD external in the dependency array", function() { + expect(deps).not.toContain("\"external1\""); +}); + +it("should correctly import a asset external", function() { + var asset = new URL("#hash", import.meta.url); + expect(asset.href).toBe(__webpack_base_uri__ + "#hash"); +}); + +it("should not contain asset external in the dependency array", function() { + expect(deps).not.toContain("\"#hash\""); +}); diff --git a/test/configCases/externals/non-amd-externals-amd/test.config.js b/test/configCases/externals/non-amd-externals-amd/test.config.js new file mode 100644 index 00000000000..680a119a5a8 --- /dev/null +++ b/test/configCases/externals/non-amd-externals-amd/test.config.js @@ -0,0 +1,5 @@ +module.exports = { + modules: { + external0: "module 0" + } +}; diff --git a/test/configCases/externals/non-amd-externals-amd/webpack.config.js b/test/configCases/externals/non-amd-externals-amd/webpack.config.js new file mode 100644 index 00000000000..119fba2ec7d --- /dev/null +++ b/test/configCases/externals/non-amd-externals-amd/webpack.config.js @@ -0,0 +1,26 @@ +const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ +module.exports = { + output: { + libraryTarget: "amd" + }, + externals: { + external0: "external0", + external1: "var 'abc'" + }, + node: { + __dirname: false, + __filename: false + }, + target: "web", + externalsPresets: { + node: true + }, + plugins: [ + new webpack.BannerPlugin({ + raw: true, + banner: + "function define(deps, fn) { fn(...deps.map(dep => require(dep))); }\n" + }) + ] +}; diff --git a/test/configCases/externals/this/index.js b/test/configCases/externals/this/index.js index ba8c1a9f804..f121aac4629 100644 --- a/test/configCases/externals/this/index.js +++ b/test/configCases/externals/this/index.js @@ -5,7 +5,7 @@ afterEach(done => { it("should import an external value assigned to global this", function() { (function() { this.EXTERNAL_TEST_GLOBAL = 42; })(); - // eslint-disable-next-line node/no-missing-require + // eslint-disable-next-line n/no-missing-require const result = require("external"); expect(result).toBe(42); }); diff --git a/test/configCases/inner-graph/issue-17565/module.js b/test/configCases/inner-graph/issue-17565/module.js new file mode 100644 index 00000000000..c98eb025b40 --- /dev/null +++ b/test/configCases/inner-graph/issue-17565/module.js @@ -0,0 +1,60 @@ +import { A, B, C1, C2, C3, Err } from "./test"; + +var arr1 = A, + cls = class extends Error {}, + cls1 = class { + constructor(t) { + if (!arr1.includes(t.version)) throw "invalid parquet version"; + } + async *[Symbol.asyncIterator]() { + yield ""; + } + }; + +var arr2 = B; +var cls2 = class extends Error {}, + cls3 = class { + constructor(t) { + if (!arr2.includes(t.version)) throw "invalid parquet version"; + } + async *[Symbol.asyncIterator]() { + yield ""; + } + }; + +var arr3 = C1; +var cls4 = class { + constructor() {} + }, + cls5 = class { + constructor(t) { + if (!arr3.includes(t.version)) throw "invalid parquet version"; + } + async *[Symbol.asyncIterator]() { + yield ""; + } + }; + +var arr4 = C2; +var cls6 = class { + foo = [1, 2]; + }, + cls7 = class { + constructor(t) { + if (!arr4.includes(t.version)) throw "invalid parquet version"; + } + async *[Symbol.asyncIterator]() { + yield ""; + } + }; + +var arr5 = C3; +var cls8 = class extends Err {}, + cls9 = class { + constructor(t) {} + async *[Symbol.asyncIterator]() { + yield ""; + } + }; + +export { cls1, cls3, cls5, cls7, cls9 } diff --git a/test/configCases/inner-graph/issue-17565/test.filter.js b/test/configCases/inner-graph/issue-17565/test.filter.js new file mode 100644 index 00000000000..25a2a20eb28 --- /dev/null +++ b/test/configCases/inner-graph/issue-17565/test.filter.js @@ -0,0 +1,5 @@ +var supportsClassFields = require("../../../helpers/supportsClassFields"); + +module.exports = function (config) { + return supportsClassFields(); +}; diff --git a/test/configCases/inner-graph/issue-17565/webpack.config.js b/test/configCases/inner-graph/issue-17565/webpack.config.js new file mode 100644 index 00000000000..8f29d9f872a --- /dev/null +++ b/test/configCases/inner-graph/issue-17565/webpack.config.js @@ -0,0 +1,16 @@ +const createTestCases = require("../_helpers/createTestCases"); + +module.exports = createTestCases({ + nothing: { + usedExports: [], + expect: { + "./test": ["A", "B", "C1", "C2"] + } + }, + all: { + usedExports: ["cls1", "cls3", "cls5", "cls7", "cls9"], + expect: { + "./test": ["A", "B", "C1", "C2"] + } + } +}); diff --git a/test/configCases/mangle/mangle-with-object-prop/index.js b/test/configCases/mangle/mangle-with-object-prop/index.js index a1b4cbf45b0..d32067e59e7 100644 --- a/test/configCases/mangle/mangle-with-object-prop/index.js +++ b/test/configCases/mangle/mangle-with-object-prop/index.js @@ -22,7 +22,7 @@ it("should mangle names and remove exports even with toString named export (ESM) .sort() ).toEqual( OPTIMIZATION === "deterministic" - ? [1, 2, 2, 2, 2, 2, 2] + ? [1, 1, 2, 2, 2, 2, 2] : [1, 1, 1, 1, 1, 1, 1] ); }); @@ -43,7 +43,7 @@ it("should mangle names and remove exports even with toString named export (CJS) .sort() ).toEqual( OPTIMIZATION === "deterministic" - ? [1, 2, 2, 2, 2, 2, 2, 8] + ? [1, 1, 2, 2, 2, 2, 2, 8] : [1, 1, 1, 1, 1, 1, 1, 8] ); }); diff --git a/test/configCases/output-module/node-globals/cjs/file.js b/test/configCases/output-module/node-globals/cjs/file.js new file mode 100644 index 00000000000..be625d98678 --- /dev/null +++ b/test/configCases/output-module/node-globals/cjs/file.js @@ -0,0 +1,6 @@ +const fileURLToPath = ""; +const file = __filename; +const dir = __dirname; +const dir2 = `${__dirname}/`; + +module.exports = { file, dir, dir2 }; diff --git a/test/configCases/output-module/node-globals/cjs/package.json b/test/configCases/output-module/node-globals/cjs/package.json new file mode 100644 index 00000000000..ea5acf78f52 --- /dev/null +++ b/test/configCases/output-module/node-globals/cjs/package.json @@ -0,0 +1,4 @@ +{ + "name": "cjs", + "type": "commonjs" +} diff --git a/test/configCases/output-module/node-globals/index.js b/test/configCases/output-module/node-globals/index.js new file mode 100644 index 00000000000..350b3ba69bd --- /dev/null +++ b/test/configCases/output-module/node-globals/index.js @@ -0,0 +1,10 @@ +import { dir, dir2, file } from './cjs/file.js' + +it("should generate correct __dirname", () => { + expect(dir).toMatch(/[\\/]node-globals$/); + expect(dir2).toMatch(/[\\/]node-globals\/$/); +}); + +it("should generate correct __filename", () => { + expect(file).toMatch(/[\\/]main.mjs$/); +}); diff --git a/test/configCases/output-module/node-globals/test.config.js b/test/configCases/output-module/node-globals/test.config.js new file mode 100644 index 00000000000..1192a7afc60 --- /dev/null +++ b/test/configCases/output-module/node-globals/test.config.js @@ -0,0 +1,5 @@ +module.exports = { + findBundle() { + return "./main.mjs"; + } +}; diff --git a/test/configCases/output-module/node-globals/webpack.config.js b/test/configCases/output-module/node-globals/webpack.config.js new file mode 100644 index 00000000000..aac123421e6 --- /dev/null +++ b/test/configCases/output-module/node-globals/webpack.config.js @@ -0,0 +1,14 @@ +/** @type {import("../../../../").Configuration} */ +module.exports = { + entry: { + main: "./index.js" + }, + output: { + filename: "[name].mjs", + module: true + }, + experiments: { + outputModule: true + }, + target: "node14" +}; diff --git a/test/configCases/process-assets/html-plugin/webpack.config.js b/test/configCases/process-assets/html-plugin/webpack.config.js index f1b74d57ee8..98abbd4842e 100644 --- a/test/configCases/process-assets/html-plugin/webpack.config.js +++ b/test/configCases/process-assets/html-plugin/webpack.config.js @@ -65,8 +65,8 @@ class HtmlPlugin { contenthash: Array.isArray(assetInfo.contenthash) ? [...new Set([...assetInfo.contenthash, integrity])] : assetInfo.contenthash - ? [assetInfo.contenthash, integrity] - : integrity + ? [assetInfo.contenthash, integrity] + : integrity }) ); return `