mirror of https://github.com/webpack/webpack.git
				
				
				
			Merge branch 'master' into crossorigin-attr
This commit is contained in:
		
						commit
						009fe74f22
					
				
							
								
								
									
										20
									
								
								.eslintrc.js
								
								
								
								
							
							
						
						
									
										20
									
								
								.eslintrc.js
								
								
								
								
							|  | @ -1,6 +1,6 @@ | |||
| module.exports = { | ||||
| 	root: true, | ||||
| 	plugins: ["prettier", "node"], | ||||
| 	plugins: ["prettier", "node", "jest"], | ||||
| 	extends: ["eslint:recommended", "plugin:node/recommended", "plugin:prettier/recommended"], | ||||
| 	env: { | ||||
| 		node: true, | ||||
|  | @ -13,7 +13,6 @@ module.exports = { | |||
| 		"prettier/prettier": "error", | ||||
| 		"no-undef": "error", | ||||
| 		"no-extra-semi": "error", | ||||
| 		"semi": "error", | ||||
| 		"no-template-curly-in-string": "error", | ||||
| 		"no-caller": "error", | ||||
| 		"no-control-regex": "off", | ||||
|  | @ -30,7 +29,20 @@ module.exports = { | |||
| 		"no-loop-func": "warn", | ||||
| 		"indent": "off", | ||||
| 		"no-console": "off", | ||||
| 		"valid-jsdoc": "error", | ||||
| 		"valid-jsdoc": ["error", { | ||||
| 			"prefer": { | ||||
| 				"return": "returns", | ||||
| 				"memberof": "DONTUSE", | ||||
| 				"class": "DONTUSE", | ||||
| 				"inheritdoc": "DONTUSE", | ||||
| 				"description": "DONTUSE", | ||||
| 				"readonly": "DONTUSE" | ||||
| 			}, | ||||
| 			"preferType": { | ||||
| 				"*": "any" | ||||
| 			}, | ||||
| 			"requireReturnType": true | ||||
| 		}], | ||||
| 		"node/no-unsupported-features": "error", | ||||
| 		"node/no-deprecated-api": "error", | ||||
| 		"node/no-missing-import": "error", | ||||
|  | @ -56,7 +68,7 @@ module.exports = { | |||
| 		{ | ||||
| 			files: ["test/**/*.js"], | ||||
| 			env: { | ||||
| 				mocha: true, | ||||
| 				"jest/globals": true | ||||
| 			} | ||||
| 		} | ||||
| 	] | ||||
|  |  | |||
|  | @ -0,0 +1,40 @@ | |||
| --- | ||||
| name: Bug report | ||||
| about: Create a report to help us improve | ||||
| 
 | ||||
| --- | ||||
| 
 | ||||
| <!-- Please don't delete this template or we'll close your issue --> | ||||
| <!-- Before creating an issue please make sure you are using the latest version of webpack. --> | ||||
| 
 | ||||
| # Bug report | ||||
| 
 | ||||
| <!-- Please ask questions on StackOverflow or the webpack Gitter. --> | ||||
| <!-- https://stackoverflow.com/questions/ask?tags=webpack --> | ||||
| <!-- https://gitter.im/webpack/webpack --> | ||||
| <!-- Issues which contain questions or support requests will be closed. --> | ||||
| 
 | ||||
| **What is the current behavior?** | ||||
| 
 | ||||
| 
 | ||||
| **If the current behavior is a bug, please provide the steps to reproduce.** | ||||
| 
 | ||||
| 
 | ||||
| <!-- A great way to do this is to provide your configuration via a GitHub repo. --> | ||||
| <!-- Best provide a minimal reproduceable repo with instructions --> | ||||
| <!-- Repos with too many files or long configs are not suitable --> | ||||
| <!-- Please only add small snippets of code directly into the issue --> | ||||
| <!-- https://gist.github.com is a good place for longer code snippets --> | ||||
| <!-- If your issue is caused by a plugin or loader file the issue on the plugin/loader repo instead. --> | ||||
| 
 | ||||
| **What is the expected behavior?** | ||||
| 
 | ||||
| 
 | ||||
| <!-- "It should work" is not a good explaination --> | ||||
| <!-- Explain how exactly you expecting it to behave --> | ||||
| 
 | ||||
| **Other relevant information:** | ||||
| webpack version:   | ||||
| Node.js version:  | ||||
| Operating System:  | ||||
| Additional tools: | ||||
|  | @ -0,0 +1,27 @@ | |||
| --- | ||||
| name: Feature request | ||||
| about: Suggest an idea for this project | ||||
| 
 | ||||
| --- | ||||
| 
 | ||||
| <!-- Please don't delete this template or we'll close your issue --> | ||||
| 
 | ||||
| ## Feature request | ||||
| 
 | ||||
| <!-- Issues which contain questions or support requests will be closed. --> | ||||
| <!-- Before creating an issue please make sure you are using the latest version of webpack. --> | ||||
| <!-- Check if this feature need to be implemented in a plugin or loader instead --> | ||||
| <!-- If yes: file the issue on the plugin/loader repo --> | ||||
| <!-- Features related to the development server should be filed on this repo instead --> | ||||
| 
 | ||||
| **What is the expected behavior?** | ||||
| 
 | ||||
| 
 | ||||
| **What is motivation or use case for adding/changing the behavior?** | ||||
| 
 | ||||
| 
 | ||||
| **How should this be implemented in your opinion?** | ||||
| 
 | ||||
| 
 | ||||
| **Are you willing to work on this yourself?** | ||||
| yes | ||||
|  | @ -0,0 +1,9 @@ | |||
| --- | ||||
| name: Other | ||||
| about: Something else | ||||
| 
 | ||||
| --- | ||||
| 
 | ||||
| <!-- Bug reports and Feature requests must use other templates, or will be closed --> | ||||
| <!-- Please ask questions on StackOverflow or the webpack Gitter (https://gitter.im/webpack/webpack). --> | ||||
| <!-- Issues which contain questions or support requests will be closed. --> | ||||
|  | @ -1,4 +1,9 @@ | |||
| <!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. --> | ||||
| <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> | ||||
| <!-- Try to link to an open issue for more information. --> | ||||
| 
 | ||||
| 
 | ||||
| <!-- In addition to that please answer these questions: --> | ||||
| 
 | ||||
| **What kind of change does this PR introduce?** | ||||
| 
 | ||||
|  | @ -8,17 +13,11 @@ | |||
| 
 | ||||
| <!-- Note that we won't merge your changes if you don't add tests --> | ||||
| 
 | ||||
| **If relevant, link to documentation update:** | ||||
| 
 | ||||
| <!-- Link PR from webpack/webpack.js.org here, or N/A --> | ||||
| 
 | ||||
| **Summary** | ||||
| 
 | ||||
| <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> | ||||
| <!-- Try to link to an open issue for more information. --> | ||||
| 
 | ||||
| **Does this PR introduce a breaking change?** | ||||
| 
 | ||||
| <!-- If this PR introduces a breaking change, please describe the impact and a migration path for existing applications. --> | ||||
| 
 | ||||
| **Other information** | ||||
| **What needs to be documented once your changes are merged?** | ||||
| 
 | ||||
| <!-- List all the information that needs to be added to the documentation after merge --> | ||||
| <!-- When your changes are merged you will be asked to contribute this to the documentation --> | ||||
|  |  | |||
|  | @ -10,4 +10,5 @@ | |||
| *.log | ||||
| .idea | ||||
| .vscode | ||||
| .eslintcache | ||||
| package-lock.json | ||||
|  |  | |||
							
								
								
									
										38
									
								
								.travis.yml
								
								
								
								
							
							
						
						
									
										38
									
								
								.travis.yml
								
								
								
								
							|  | @ -10,25 +10,41 @@ branches: | |||
| cache: | ||||
|   yarn: true | ||||
| 
 | ||||
| stages: | ||||
|  - basic | ||||
|  - advanced | ||||
|  - versions | ||||
| 
 | ||||
| matrix: | ||||
|   include: | ||||
|     - os: linux | ||||
|       node_js: "8" | ||||
|       node_js: "10" | ||||
|       env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=basic | ||||
|       stage: basic | ||||
|     - os: linux | ||||
|       node_js: "10" | ||||
|       env: NO_WATCH_TESTS=1 JOB_PART=lint | ||||
|       stage: advanced | ||||
|     - os: linux | ||||
|       node_js: "8" | ||||
|       env: NO_WATCH_TESTS=1 JOB_PART=integration | ||||
|       node_js: "10" | ||||
|       env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=integration | ||||
|       stage: advanced | ||||
|     - os: linux | ||||
|       node_js: "8" | ||||
|       node_js: "10" | ||||
|       env: NO_WATCH_TESTS=1 JOB_PART=unit | ||||
|       stage: advanced | ||||
|     - os: osx | ||||
|       node_js: "10" | ||||
|       env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=integration | ||||
|       stage: versions | ||||
|     - os: linux | ||||
|       node_js: "8" | ||||
|       env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=integration | ||||
|       stage: versions | ||||
|     - os: linux | ||||
|       node_js: "6" | ||||
|       env: NO_WATCH_TESTS=1 JOB_PART=integration | ||||
|     - os: osx | ||||
|       node_js: "8" | ||||
|       env: NO_WATCH_TESTS=1 JOB_PART=integration | ||||
|   allow_failures: | ||||
|     - os: osx | ||||
|       env: NO_WATCH_TESTS=1 JEST=--maxWorkers=2 JOB_PART=integration | ||||
|       stage: versions | ||||
|   fast_finish: true | ||||
| 
 | ||||
| install: | ||||
|  | @ -40,7 +56,7 @@ script: npm run travis:$JOB_PART | |||
| 
 | ||||
| after_success: | ||||
|   - cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose | ||||
|   - bash <(curl -s https://codecov.io/bash) -F $JOB_PART | ||||
|   - bash <(curl -s https://codecov.io/bash) -F $JOB_PART -X gcov | ||||
|   - rm -rf ./coverage | ||||
| 
 | ||||
| notifications: | ||||
|  |  | |||
|  | @ -11,17 +11,23 @@ Most of the time, if webpack is not working correctly for you it is a simple con | |||
| 
 | ||||
| If you are still having difficulty after looking over your configuration carefully, please post | ||||
| a question to [StackOverflow with the webpack tag](http://stackoverflow.com/tags/webpack). Questions | ||||
| that include your webpack.config.js and relevant files are more likely to receive responses. | ||||
| that include your webpack.config.js, relevant files, and the full error message are more likely to receive responses. | ||||
| 
 | ||||
| **If you have discovered a bug or have a feature suggestion, please [create an issue on GitHub](https://github.com/webpack/webpack/issues/new).** | ||||
| 
 | ||||
| Do you want to fix an issue?  Look at the issues with a tag of [X5: work required (PR / Help Wanted)](https://github.com/webpack/webpack/labels/X5%3A%20work%20required%20%28PR%20%2F%20Help%20Wanted%29).  Each issue should be tagged with a difficulty tag - | ||||
| 
 | ||||
| - D0: My First Commit (Contribution Difficulty) | ||||
| - D1: Easy (Contribution Difficulty) | ||||
| - D2: Medium (Contribution Difficulty) | ||||
| - D3: Hard (Contribution Difficulty) | ||||
| 
 | ||||
| ## Contributing to the webpack ecosystem | ||||
| 
 | ||||
| If you have created your own loader/plugin please include it on the relevant | ||||
| documentation pages: | ||||
| If you have created your own loader/plugin please include it on the relevant documentation pages: | ||||
| 
 | ||||
| [List of loaders](https://webpack.js.org/loaders/) or [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#loaders) | ||||
| [List of plugins](https://webpack.js.org/plugins) or [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#webpack-plugins) | ||||
| - [List of loaders](https://webpack.js.org/loaders/) or [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#loaders) | ||||
| - [List of plugins](https://webpack.js.org/plugins) or [awesome-webpack](https://github.com/webpack-contrib/awesome-webpack#webpack-plugins) | ||||
| 
 | ||||
| ## Setup | ||||
| 
 | ||||
|  | @ -43,7 +49,7 @@ Some things that will increase the chance that your pull request is accepted: | |||
| 
 | ||||
| webpack is insanely feature rich and documentation is a huge time sink. We | ||||
| greatly appreciate any time spent fixing typos or clarifying sections in the | ||||
| documentation. | ||||
| documentation. [See a list of issues with the documentation tag.](https://github.com/webpack/webpack/labels/documentation) | ||||
| 
 | ||||
| ## Discussions | ||||
| 
 | ||||
|  |  | |||
|  | @ -287,6 +287,8 @@ We consider webpack to be a low-level tool used not only individually but also l | |||
| 
 | ||||
| If you're just getting started, take a look at [our new docs and concepts page](https://webpack.js.org/concepts/). This has a high level overview that is great for beginners!! | ||||
| 
 | ||||
| Looking for webpack 1 docs? Please check out the old [wiki](https://github.com/webpack/docs/wiki/contents), but note that this deprecated version is no longer supported. | ||||
| 
 | ||||
| If you want to discuss something or just need help, [here is our Gitter room](https://gitter.im/webpack/webpack) where there are always individuals looking to help out! | ||||
| 
 | ||||
| If you are still having difficulty, we would love for you to post | ||||
|  |  | |||
|  | @ -0,0 +1,9 @@ | |||
| # Reporting Security Issues | ||||
| 
 | ||||
| If you discover a security issue in webpack, please report it by sending an | ||||
| email to [webpack@opencollective.com](mailto:webpack@opencollective.com). | ||||
| 
 | ||||
| This will allow us to assess the risk, and make a fix available before we add a | ||||
| bug report to the GitHub repository. | ||||
| 
 | ||||
| Thanks for helping make webpack safe for everyone. | ||||
							
								
								
									
										60
									
								
								_SETUP.md
								
								
								
								
							
							
						
						
									
										60
									
								
								_SETUP.md
								
								
								
								
							|  | @ -10,19 +10,73 @@ That's all. | |||
| 
 | ||||
| ## Setup manually | ||||
| 
 | ||||
| Setup your local webpack repository | ||||
| ### Setup your local webpack repository | ||||
| 
 | ||||
| ```bash | ||||
| git clone https://github.com/webpack/webpack.git | ||||
| cd webpack | ||||
| npm install -g yarn | ||||
| yarn install | ||||
| yarn | ||||
| yarn link | ||||
| yarn link webpack | ||||
| ``` | ||||
| 
 | ||||
| To run the entire test suite use: | ||||
| ### To run the entire test suite use | ||||
| 
 | ||||
| ```bash | ||||
| yarn test | ||||
| ``` | ||||
| 
 | ||||
| ### To run only intergration tests use | ||||
| 
 | ||||
| ```bash | ||||
| yarn test:integration | ||||
| ``` | ||||
| 
 | ||||
| or in watch mode | ||||
| 
 | ||||
| ```bash | ||||
| yarn test:integration --watch | ||||
| ``` | ||||
| 
 | ||||
| ### To run only unit tests use | ||||
| 
 | ||||
| ```bash | ||||
| yarn test:unit | ||||
| ``` | ||||
| 
 | ||||
| or in watch mode | ||||
| 
 | ||||
| ```bash | ||||
| yarn test:unit --watch | ||||
| ``` | ||||
| 
 | ||||
| ### To run code formatter (prettier) run | ||||
| 
 | ||||
| ```bash | ||||
| yarn pretty | ||||
| ``` | ||||
| 
 | ||||
| ### To run all linters use | ||||
| 
 | ||||
| This performs linting on: | ||||
| 
 | ||||
| * eslint (code-lint script) | ||||
| * schema (schema-lint script) | ||||
| * types (type-lint script) | ||||
| 
 | ||||
| ```bash | ||||
| yarn lint | ||||
| ``` | ||||
| 
 | ||||
| ### To run only the typechecker use | ||||
| 
 | ||||
| ```bash | ||||
| yarn type-lint | ||||
| ``` | ||||
| 
 | ||||
| or incremental (in watch mode) | ||||
| 
 | ||||
| ```bash | ||||
| yarn type-lint --watch | ||||
| ``` | ||||
|  |  | |||
|  | @ -16,8 +16,10 @@ environment: | |||
|       job_part: unit | ||||
|     - nodejs_version: 8 | ||||
|       job_part: integration | ||||
|       jest: --maxWorkers=2 | ||||
|     - nodejs_version: 6 | ||||
|       job_part: integration | ||||
|       jest: --maxWorkers=2 | ||||
| 
 | ||||
| install: | ||||
|   - ps: Install-Product node $env:nodejs_version x64 | ||||
|  | @ -33,7 +35,8 @@ matrix: | |||
| 
 | ||||
| test_script: | ||||
|   - node --version | ||||
|   - npm --version | ||||
|   - yarn --version | ||||
|   - cmd: npm run appveyor:%job_part% | ||||
|   - cmd: npm install -g codecov && codecov -F %job_part% | ||||
|   - cmd: set JEST=%jest% | ||||
|   - cmd: yarn appveyor:%job_part% | ||||
|   - cmd: yarn unlink webpack | ||||
|   - cmd: yarn global add codecov && codecov -F %job_part% --disable=gcov | ||||
|  |  | |||
							
								
								
									
										161
									
								
								bin/webpack.js
								
								
								
								
							
							
						
						
									
										161
									
								
								bin/webpack.js
								
								
								
								
							|  | @ -1,8 +1,16 @@ | |||
| #!/usr/bin/env node
 | ||||
| function runCommand(command, options) { | ||||
| 
 | ||||
| process.exitCode = 0; | ||||
| 
 | ||||
| /** | ||||
|  * @param {string} command process to run | ||||
|  * @param {string[]} args commandline arguments | ||||
|  * @returns {Promise<void>} promise | ||||
|  */ | ||||
| const runCommand = (command, args) => { | ||||
| 	const cp = require("child_process"); | ||||
| 	return new Promise((resolve, reject) => { | ||||
| 		const executedCommand = cp.spawn(command, options, { | ||||
| 		const executedCommand = cp.spawn(command, args, { | ||||
| 			stdio: "inherit", | ||||
| 			shell: true | ||||
| 		}); | ||||
|  | @ -13,69 +21,146 @@ function runCommand(command, options) { | |||
| 
 | ||||
| 		executedCommand.on("exit", code => { | ||||
| 			if (code === 0) { | ||||
| 				resolve(true); | ||||
| 				resolve(); | ||||
| 			} else { | ||||
| 				reject(); | ||||
| 			} | ||||
| 		}); | ||||
| 	}); | ||||
| } | ||||
| }; | ||||
| 
 | ||||
| let webpackCliInstalled = false; | ||||
| /** | ||||
|  * @param {string} packageName name of the package | ||||
|  * @returns {boolean} is the package installed? | ||||
|  */ | ||||
| const isInstalled = packageName => { | ||||
| 	try { | ||||
| 	require.resolve("webpack-cli"); | ||||
| 	webpackCliInstalled = true; | ||||
| } catch (err) { | ||||
| 	webpackCliInstalled = false; | ||||
| } | ||||
| 		require.resolve(packageName); | ||||
| 
 | ||||
| if (!webpackCliInstalled) { | ||||
| 		return true; | ||||
| 	} catch (err) { | ||||
| 		return false; | ||||
| 	} | ||||
| }; | ||||
| 
 | ||||
| /** | ||||
|  * @typedef {Object} CliOption | ||||
|  * @property {string} name display name | ||||
|  * @property {string} package npm package name | ||||
|  * @property {string} alias shortcut for choice | ||||
|  * @property {boolean} installed currently installed? | ||||
|  * @property {string} url homepage | ||||
|  * @property {string} description description | ||||
|  */ | ||||
| 
 | ||||
| /** @type {CliOption[]} */ | ||||
| const CLIs = [ | ||||
| 	{ | ||||
| 		name: "webpack-cli", | ||||
| 		package: "webpack-cli", | ||||
| 		alias: "cli", | ||||
| 		installed: isInstalled("webpack-cli"), | ||||
| 		url: "https://github.com/webpack/webpack-cli", | ||||
| 		description: "The original webpack full-featured CLI." | ||||
| 	}, | ||||
| 	{ | ||||
| 		name: "webpack-command", | ||||
| 		package: "webpack-command", | ||||
| 		alias: "command", | ||||
| 		installed: isInstalled("webpack-command"), | ||||
| 		url: "https://github.com/webpack-contrib/webpack-command", | ||||
| 		description: "A lightweight, opinionated webpack CLI." | ||||
| 	} | ||||
| ]; | ||||
| 
 | ||||
| const installedClis = CLIs.filter(cli => cli.installed); | ||||
| 
 | ||||
| if (installedClis.length === 0) { | ||||
| 	const path = require("path"); | ||||
| 	const fs = require("fs"); | ||||
| 	const readLine = require("readline"); | ||||
| 
 | ||||
| 	let notify = | ||||
| 		"One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:"; | ||||
| 
 | ||||
| 	for (const item of CLIs) { | ||||
| 		notify += `\n - ${item.name} (${item.url})\n   ${item.description}`; | ||||
| 	} | ||||
| 
 | ||||
| 	console.error(notify); | ||||
| 
 | ||||
| 	const isYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock")); | ||||
| 
 | ||||
| 	const packageManager = isYarn ? "yarn" : "npm"; | ||||
| 	const options = ["install", "-D", "webpack-cli"]; | ||||
| 	const installOptions = [isYarn ? "add" : "install", "-D"]; | ||||
| 
 | ||||
| 	if (isYarn) { | ||||
| 		options[0] = "add"; | ||||
| 	} | ||||
| 	console.error( | ||||
| 		`We will use "${packageManager}" to install the CLI via "${packageManager} ${installOptions.join( | ||||
| 			" " | ||||
| 		)}".` | ||||
| 	); | ||||
| 
 | ||||
| 	const commandToBeRun = `${packageManager} ${options.join(" ")}`; | ||||
| 	let question = `Which one do you like to install (${CLIs.map( | ||||
| 		item => item.name | ||||
| 	).join("/")}):\n`;
 | ||||
| 
 | ||||
| 	const question = `Would you like to install webpack-cli? (That will run ${commandToBeRun}) (yes/NO)`; | ||||
| 
 | ||||
| 	console.error("The CLI moved into a separate package: webpack-cli"); | ||||
| 	const questionInterface = readLine.createInterface({ | ||||
| 		input: process.stdin, | ||||
| 		output: process.stdout | ||||
| 		output: process.stderr | ||||
| 	}); | ||||
| 	questionInterface.question(question, answer => { | ||||
| 		questionInterface.close(); | ||||
| 		switch (answer.toLowerCase()) { | ||||
| 			case "y": | ||||
| 			case "yes": | ||||
| 			case "1": { | ||||
| 				runCommand(packageManager, options) | ||||
| 					.then(result => { | ||||
| 						return require("webpack-cli"); //eslint-disable-line
 | ||||
| 
 | ||||
| 		const normalizedAnswer = answer.toLowerCase(); | ||||
| 		const selectedPackage = CLIs.find(item => { | ||||
| 			return item.name === normalizedAnswer || item.alias === normalizedAnswer; | ||||
| 		}); | ||||
| 
 | ||||
| 		if (!normalizedAnswer) { | ||||
| 			console.error( | ||||
| 				"One CLI needs to be installed alongside webpack to use the CLI." | ||||
| 			); | ||||
| 			process.exitCode = 1; | ||||
| 
 | ||||
| 			return; | ||||
| 		} else if (!selectedPackage) { | ||||
| 			console.error( | ||||
| 				"No matching choice.\n" + | ||||
| 					"One CLI needs to be installed alongside webpack to use the CLI.\n" + | ||||
| 					"Try to installing your CLI of choice manually." | ||||
| 			); | ||||
| 			process.exitCode = 1; | ||||
| 
 | ||||
| 			return; | ||||
| 		} | ||||
| 
 | ||||
| 		const packageName = selectedPackage.package; | ||||
| 
 | ||||
| 		console.log( | ||||
| 			`Installing '${ | ||||
| 				selectedPackage.name | ||||
| 			}' (running '${packageManager} ${installOptions.join( | ||||
| 				" " | ||||
| 			)} ${packageName}')...` | ||||
| 		); | ||||
| 
 | ||||
| 		runCommand(packageManager, installOptions.concat(packageName)) | ||||
| 			.then(() => { | ||||
| 				require(packageName); //eslint-disable-line
 | ||||
| 			}) | ||||
| 			.catch(error => { | ||||
| 				console.error(error); | ||||
| 				process.exitCode = 1; | ||||
| 			}); | ||||
| 				break; | ||||
| 			} | ||||
| 			default: { | ||||
| 				console.error( | ||||
| 					"It needs to be installed alongside webpack to use the CLI" | ||||
| 				); | ||||
| 				process.exitCode = 1; | ||||
| 				break; | ||||
| 			} | ||||
| 		} | ||||
| 	}); | ||||
| } else if (installedClis.length === 1) { | ||||
| 	require(installedClis[0].package); // eslint-disable-line
 | ||||
| } else { | ||||
| 	require("webpack-cli"); // eslint-disable-line
 | ||||
| 	console.warn( | ||||
| 		`You have installed ${installedClis | ||||
| 			.map(item => item.name) | ||||
| 			.join( | ||||
| 				" and " | ||||
| 			)} together. To work with the "webpack" command you need only one CLI package, please remove one of them or use them directly via their binary.` | ||||
| 	); | ||||
| } | ||||
|  |  | |||
							
								
								
									
										15
									
								
								codecov.yml
								
								
								
								
							
							
						
						
									
										15
									
								
								codecov.yml
								
								
								
								
							|  | @ -7,6 +7,9 @@ coverage: | |||
|   status: | ||||
|     project: | ||||
|       default: off | ||||
|       basic: | ||||
|         flags: basic | ||||
|         target: auto | ||||
|       integration: | ||||
|         flags: integration | ||||
|         target: auto | ||||
|  | @ -15,6 +18,10 @@ coverage: | |||
|         target: 0% | ||||
|     patch: | ||||
|       default: off | ||||
|       integration: | ||||
|         flags: integration | ||||
|         target: 90% | ||||
|         base: pr | ||||
|       integration: | ||||
|         flags: integration | ||||
|         target: 90% | ||||
|  | @ -25,6 +32,9 @@ coverage: | |||
|         base: pr | ||||
|     changes: | ||||
|       default: off | ||||
|       basic: | ||||
|         flags: basic | ||||
|         target: 0% | ||||
|       integration: | ||||
|         flags: integration | ||||
|         target: 0% | ||||
|  | @ -32,3 +42,8 @@ coverage: | |||
|         flags: unit | ||||
|         target: 0% | ||||
| comment: off | ||||
| flags: | ||||
|   basic: | ||||
|     joined: false | ||||
|   unit: | ||||
|     joined: false | ||||
|  |  | |||
|  | @ -1,5 +1,4 @@ | |||
| declare module "*.json"; | ||||
| declare module "webpack-cli"; | ||||
| 
 | ||||
| // Deprecated NodeJS API usages in Webpack
 | ||||
| declare namespace NodeJS { | ||||
|  | @ -9,26 +8,96 @@ declare namespace NodeJS { | |||
| } | ||||
| 
 | ||||
| // There are no typings for chrome-trace-event
 | ||||
| declare module 'chrome-trace-event' { | ||||
| declare module "chrome-trace-event" { | ||||
| 	interface Event { | ||||
| 		name: string | ||||
| 		id?: number | ||||
| 		cat: string[] | ||||
| 		args?: Object | ||||
| 		name: string; | ||||
| 		id?: number; | ||||
| 		cat: string[]; | ||||
| 		args?: Object; | ||||
| 	} | ||||
| 
 | ||||
| 	export class Tracer { | ||||
| 		constructor(options: { | ||||
| 			noStream: boolean | ||||
| 		}) | ||||
| 		pipe(stream: NodeJS.WritableStream) : void | ||||
| 		instantEvent(event: Event) : void | ||||
| 		counter: number | ||||
| 		constructor(options: { noStream: boolean }); | ||||
| 		pipe(stream: NodeJS.WritableStream): void; | ||||
| 		instantEvent(event: Event): void; | ||||
| 		counter: number; | ||||
| 		trace: { | ||||
| 			begin(event: Event) : void | ||||
| 			end(event: Event) : void | ||||
| 			begin(event: Event): void; | ||||
| 			end(event: Event): void; | ||||
| 		}; | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // There are no typings for @webassemblyjs/ast
 | ||||
| declare module "@webassemblyjs/ast" { | ||||
| 	export function traverse( | ||||
| 		ast: any, | ||||
| 		visitor: { | ||||
| 			ModuleImport?: (p: NodePath<ModuleImport>) => void; | ||||
| 			ModuleExport?: (p: NodePath<ModuleExport>) => void; | ||||
| 			Start?: (p: NodePath<Start>) => void; | ||||
| 		} | ||||
| 	); | ||||
| 	export class NodePath<T> { | ||||
| 		node: T; | ||||
| 	} | ||||
| 	export class Node {} | ||||
| 	export class Identifier extends Node { | ||||
| 		value: string; | ||||
| 	} | ||||
| 	export class Start extends Node { | ||||
| 		index: Identifier; | ||||
| 	} | ||||
| 	export class ModuleImport extends Node { | ||||
| 		module: string; | ||||
| 		descr: { | ||||
| 			type: string; | ||||
| 			valtype: string; | ||||
| 			id: string; | ||||
| 		}; | ||||
| 		name: string; | ||||
| 	} | ||||
| 	export class ModuleExport extends Node { | ||||
| 		name: string; | ||||
| 	} | ||||
| 	export class IndexLiteral extends Node {} | ||||
| 	export class NumberLiteral extends Node {} | ||||
| 	export class Global extends Node {} | ||||
| 	export class FuncParam extends Node {} | ||||
| 	export class Instruction extends Node {} | ||||
| 	export class CallInstruction extends Instruction {} | ||||
| 	export class ObjectInstruction extends Instruction {} | ||||
| 	export class Func extends Node { | ||||
| 		signature: Signature; | ||||
| 	} | ||||
| 	export class Signature { | ||||
| 		params: any; | ||||
| 		result: any; | ||||
| 	} | ||||
| 	export class TypeInstructionFunc extends Node {} | ||||
| 	export class IndexInFuncSection extends Node {} | ||||
| 	export function indexLiteral(index: number): IndexLiteral; | ||||
| 	export function numberLiteral(num: number): NumberLiteral; | ||||
| 	export function global(globalType: string, nodes: Node[]): Global; | ||||
| 	export function identifier(indentifier: string): Identifier; | ||||
| 	export function funcParam(valType: string, id: Identifier): FuncParam; | ||||
| 	export function instruction(inst: string, args: Node[]): Instruction; | ||||
| 	export function callInstruction(funcIndex: IndexLiteral): CallInstruction; | ||||
| 	export function objectInstruction( | ||||
| 		kind: string, | ||||
| 		type: string, | ||||
| 		init: Node[] | ||||
| 	): ObjectInstruction; | ||||
| 	export function func(initFuncId, funcParams, funcResults, funcBody): Func; | ||||
| 	export function typeInstructionFunc(params, result): TypeInstructionFunc; | ||||
| 	export function indexInFuncSection(index: IndexLiteral): IndexInFuncSection; | ||||
| 	export function moduleExport( | ||||
| 		identifier: string, | ||||
| 		type: string, | ||||
| 		index: IndexLiteral | ||||
| 	): ModuleExport; | ||||
| 
 | ||||
| 	export function getSectionMetadata(ast: any, section: string); | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  | @ -53,3 +122,5 @@ declare const WebAssembly; | |||
| declare const importScripts; | ||||
| declare const $crossOriginLoading$; | ||||
| declare const chunkId; | ||||
| 
 | ||||
| type TODO = any; | ||||
|  |  | |||
|  | @ -60,13 +60,13 @@ module.exports = { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|           Asset       Size  Chunks             Chunk Names | ||||
|      0.chunk.js   5.98 KiB       0  [emitted]   | ||||
|      1.chunk.js  405 bytes       1  [emitted]   | ||||
| pageC.bundle.js   7.05 KiB       2  [emitted]  pageC | ||||
| pageB.bundle.js   7.05 KiB       3  [emitted]  pageB | ||||
| pageA.bundle.js   7.05 KiB       4  [emitted]  pageA | ||||
| pageC.bundle.js   7.32 KiB       2  [emitted]  pageC | ||||
| pageB.bundle.js   7.32 KiB       3  [emitted]  pageB | ||||
| pageA.bundle.js   7.32 KiB       4  [emitted]  pageA | ||||
| Entrypoint pageA = pageA.bundle.js | ||||
| Entrypoint pageB = pageB.bundle.js | ||||
| Entrypoint pageC = pageC.bundle.js | ||||
|  | @ -108,13 +108,13 @@ chunk    {4} pageA.bundle.js (pageA) 71 bytes >{0}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|           Asset       Size  Chunks             Chunk Names | ||||
|      0.chunk.js  173 bytes    0, 1  [emitted]   | ||||
|      1.chunk.js  118 bytes       1  [emitted]   | ||||
| pageC.bundle.js   1.67 KiB       2  [emitted]  pageC | ||||
| pageB.bundle.js   1.66 KiB       3  [emitted]  pageB | ||||
| pageA.bundle.js   1.66 KiB       4  [emitted]  pageA | ||||
| pageC.bundle.js    1.7 KiB       2  [emitted]  pageC | ||||
| pageB.bundle.js   1.69 KiB       3  [emitted]  pageB | ||||
| pageA.bundle.js   1.69 KiB       4  [emitted]  pageA | ||||
| Entrypoint pageA = pageA.bundle.js | ||||
| Entrypoint pageB = pageB.bundle.js | ||||
| Entrypoint pageC = pageC.bundle.js | ||||
|  |  | |||
|  | @ -45,7 +45,7 @@ module.exports = { | |||
| 
 | ||||
| <!-- inlined minimized file "runtime~main.[chunkhash].js" --> | ||||
| <script> | ||||
| !function(e){function r(r){for(var n,a,i=r[0],c=r[1],s=r[2],p=0,f=[];p<i.length;p++)a=i[p],o[a]&&f.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);f.length;)f.shift()();return u.push.apply(u,s||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var c=t[i];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={2:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u=document.getElementsByTagName("head")[0],i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=a.p+""+({}[e]||e)+".[chunkhash].js";var c=setTimeout(function(){s({type:"timeout",target:i})},12e4);function s(r){i.onerror=i.onload=null,clearTimeout(c);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src,a=new Error("Loading chunk "+e+" failed.\n("+n+": "+u+")");a.type=n,a.request=u,t[1](a)}o[e]=void 0}}i.onerror=i.onload=s,u.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},a.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="dist/",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var s=0;s<i.length;s++)r(i[s]);var l=c;t()}([]); | ||||
| !function(e){function r(r){for(var n,i,a=r[0],c=r[1],s=r[2],p=0,f=[];p<a.length;p++)i=a[p],o[i]&&f.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);f.length;)f.shift()();return u.push.apply(u,s||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={2:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u=document.getElementsByTagName("head")[0],a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+""+({}[e]||e)+".[chunkhash].js"}(e);var c=setTimeout(function(){s({type:"timeout",target:a})},12e4);function s(r){a.onerror=a.onload=null,clearTimeout(c);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src,i=new Error("Loading chunk "+e+" failed.\n("+n+": "+u+")");i.type=n,i.request=u,t[1](i)}o[e]=void 0}}a.onerror=a.onload=s,u.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="dist/",i.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var s=0;s<a.length;s++)r(a[s]);var l=c;t()}([]); | ||||
| </script> | ||||
| 
 | ||||
| <script src="dist/main.[chunkhash].js"></script> | ||||
|  | @ -112,12 +112,19 @@ module.exports = { | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		3: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ 	var deferredModules = []; | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + ({}[chunkId]||chunkId) + ".[chunkhash].js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -173,7 +180,7 @@ module.exports = { | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + ({}[chunkId]||chunkId) + ".[chunkhash].js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -287,12 +294,12 @@ __webpack_require__.e(/*! import() */ 2).then(function() { var module = __webpac | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|                     Asset       Size  Chunks             Chunk Names | ||||
|         main.[chunkhash].js  877 bytes       0  [emitted]  main | ||||
|            1.[chunkhash].js  270 bytes       1  [emitted]   | ||||
|            2.[chunkhash].js  264 bytes       2  [emitted]   | ||||
| runtime~main.[chunkhash].js   7.48 KiB       3  [emitted]  runtime~main | ||||
| runtime~main.[chunkhash].js   7.75 KiB       3  [emitted]  runtime~main | ||||
| Entrypoint main = runtime~main.[chunkhash].js main.[chunkhash].js | ||||
| chunk    {0} main.[chunkhash].js (main) 55 bytes ={3}= >{1}< >{2}< [initial] [rendered] | ||||
|     > ./example main | ||||
|  | @ -314,11 +321,11 @@ chunk    {3} runtime~main.[chunkhash].js (runtime~main) 0 bytes ={0}= >{1}< >{2} | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|                     Asset       Size  Chunks             Chunk Names | ||||
|            0.[chunkhash].js   77 bytes       0  [emitted]   | ||||
|            1.[chunkhash].js   78 bytes       1  [emitted]   | ||||
| runtime~main.[chunkhash].js   1.76 KiB       2  [emitted]  runtime~main | ||||
| runtime~main.[chunkhash].js   1.79 KiB       2  [emitted]  runtime~main | ||||
|         main.[chunkhash].js  349 bytes       3  [emitted]  main | ||||
| Entrypoint main = runtime~main.[chunkhash].js main.[chunkhash].js | ||||
| chunk    {0} 0.[chunkhash].js 29 bytes <{2}> <{3}> [rendered] | ||||
|  |  | |||
|  | @ -52,12 +52,19 @@ getTemplate("b", function(b) { | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		1: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -113,7 +120,7 @@ getTemplate("b", function(b) { | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -252,7 +259,7 @@ function webpackContext(req) { | |||
| function webpackContextResolve(req) { | ||||
| 	var id = map[req]; | ||||
| 	if(!(id + 1)) { // check for number or string | ||||
| 		var e = new Error('Cannot find module "' + req + '".'); | ||||
| 		var e = new Error("Cannot find module '" + req + "'"); | ||||
| 		e.code = 'MODULE_NOT_FOUND'; | ||||
| 		throw e; | ||||
| 	} | ||||
|  | @ -311,10 +318,10 @@ module.exports = function() { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset      Size  Chunks             Chunk Names | ||||
| 0.output.js  1.86 KiB       0  [emitted]   | ||||
|   output.js  7.19 KiB       1  [emitted]  main | ||||
|   output.js  7.46 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 463 bytes <{1}> [rendered] | ||||
|     > [0] ./example.js 2:1-4:3 | ||||
|  | @ -339,10 +346,10 @@ chunk    {1} output.js (main) 261 bytes >{0}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  627 bytes       0  [emitted]   | ||||
|   output.js   1.75 KiB       1  [emitted]  main | ||||
|   output.js   1.78 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 463 bytes <{1}> [rendered] | ||||
|     > [0] ./example.js 2:1-4:3 | ||||
|  |  | |||
|  | @ -52,12 +52,19 @@ getTemplate("b", function(b) { | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		1: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -113,7 +120,7 @@ getTemplate("b", function(b) { | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -252,7 +259,7 @@ function webpackContext(req) { | |||
| function webpackContextResolve(req) { | ||||
| 	var id = map[req]; | ||||
| 	if(!(id + 1)) { // check for number or string | ||||
| 		var e = new Error('Cannot find module "' + req + '".'); | ||||
| 		var e = new Error("Cannot find module '" + req + "'"); | ||||
| 		e.code = 'MODULE_NOT_FOUND'; | ||||
| 		throw e; | ||||
| 	} | ||||
|  | @ -311,10 +318,10 @@ module.exports = function() { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset      Size  Chunks             Chunk Names | ||||
| 0.output.js  1.86 KiB       0  [emitted]   | ||||
|   output.js  7.13 KiB       1  [emitted]  main | ||||
|   output.js   7.4 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 463 bytes <{1}> [rendered] | ||||
|     > [0] ./example.js 2:1-4:3 | ||||
|  | @ -339,10 +346,10 @@ chunk    {1} output.js (main) 276 bytes >{0}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  627 bytes       0  [emitted]   | ||||
|   output.js   1.73 KiB       1  [emitted]  main | ||||
|   output.js   1.75 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 463 bytes <{1}> [rendered] | ||||
|     > [0] ./example.js 2:1-4:3 | ||||
|  |  | |||
|  | @ -55,12 +55,19 @@ module.exports = "It works"; | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		1: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -116,7 +123,7 @@ module.exports = "It works"; | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -266,10 +273,10 @@ module.exports = "It works"; | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  257 bytes       0  [emitted]   | ||||
|   output.js   7.56 KiB       1  [emitted]  main | ||||
|   output.js   7.82 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 28 bytes <{1}> [rendered] | ||||
|     > [0] (webpack)/node_modules/bundle-loader!./file.js 7:0-14:2 | ||||
|  | @ -287,10 +294,10 @@ chunk    {1} output.js (main) 378 bytes >{0}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset      Size  Chunks             Chunk Names | ||||
| 0.output.js  98 bytes       0  [emitted]   | ||||
|   output.js  1.79 KiB       1  [emitted]  main | ||||
|   output.js  1.81 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 28 bytes <{1}> [rendered] | ||||
|     > [0] (webpack)/node_modules/bundle-loader!./file.js 7:0-14:2 | ||||
|  |  | |||
|  | @ -63,12 +63,19 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		3: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -124,7 +131,7 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -241,7 +248,7 @@ function webpackAsyncContext(req) { | |||
| 	var ids = map[req]; | ||||
| 	if(!ids) { | ||||
| 		return Promise.resolve().then(function() { | ||||
| 			var e = new Error('Cannot find module "' + req + '".'); | ||||
| 			var e = new Error("Cannot find module '" + req + "'"); | ||||
| 			e.code = 'MODULE_NOT_FOUND'; | ||||
| 			throw e; | ||||
| 		}); | ||||
|  | @ -305,12 +312,12 @@ Promise.all([loadC("1"), loadC("2")]).then(function(arr) { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  275 bytes       0  [emitted]   | ||||
| 1.output.js  284 bytes       1  [emitted]   | ||||
| 2.output.js  270 bytes       2  [emitted]   | ||||
|   output.js   8.84 KiB       3  [emitted]  main | ||||
|   output.js   9.11 KiB       3  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 13 bytes <{3}> [rendered] | ||||
|     > ./2 [2] ./node_modules/c lazy ^\.\/.*$ namespace object ./2 | ||||
|  | @ -337,12 +344,12 @@ chunk    {3} output.js (main) 427 bytes >{0}< >{1}< >{2}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset      Size  Chunks             Chunk Names | ||||
| 0.output.js  76 bytes       0  [emitted]   | ||||
| 1.output.js  77 bytes       1  [emitted]   | ||||
| 2.output.js  78 bytes       2  [emitted]   | ||||
|   output.js  2.33 KiB       3  [emitted]  main | ||||
|   output.js  2.35 KiB       3  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 13 bytes <{3}> [rendered] | ||||
|     > ./2 [2] ./node_modules/c lazy ^\.\/.*$ namespace object ./2 | ||||
|  |  | |||
|  | @ -81,12 +81,19 @@ export default foo; | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		3: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -142,7 +149,7 @@ export default foo; | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -268,7 +275,7 @@ function webpackAsyncContext(req) { | |||
| 	var ids = map[req]; | ||||
| 	if(!ids) { | ||||
| 		return Promise.resolve().then(function() { | ||||
| 			var e = new Error('Cannot find module "' + req + '".'); | ||||
| 			var e = new Error("Cannot find module '" + req + "'"); | ||||
| 			e.code = 'MODULE_NOT_FOUND'; | ||||
| 			throw e; | ||||
| 		}); | ||||
|  | @ -321,12 +328,12 @@ getTemplate("baz.noimport"); | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  433 bytes       0  [emitted]   | ||||
| 1.output.js  442 bytes       1  [emitted]   | ||||
| 2.output.js  436 bytes       2  [emitted]   | ||||
|   output.js   8.21 KiB       3  [emitted]  main | ||||
|   output.js   8.47 KiB       3  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 38 bytes <{3}> [rendered] | ||||
|     > ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo | ||||
|  | @ -361,12 +368,12 @@ chunk    {3} output.js (main) 597 bytes >{0}< >{1}< >{2}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  113 bytes       0  [emitted]   | ||||
| 1.output.js  114 bytes       1  [emitted]   | ||||
| 2.output.js  115 bytes       2  [emitted]   | ||||
|   output.js   2.13 KiB       3  [emitted]  main | ||||
|   output.js   2.16 KiB       3  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 38 bytes <{3}> [rendered] | ||||
|     > ./foo [3] ./templates lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo | ||||
|  |  | |||
|  | @ -70,12 +70,19 @@ export default foo; | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		3: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -131,7 +138,7 @@ export default foo; | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -257,7 +264,7 @@ function webpackAsyncContext(req) { | |||
| 	var ids = map[req]; | ||||
| 	if(!ids) { | ||||
| 		return Promise.resolve().then(function() { | ||||
| 			var e = new Error('Cannot find module "' + req + '".'); | ||||
| 			var e = new Error("Cannot find module '" + req + "'"); | ||||
| 			e.code = 'MODULE_NOT_FOUND'; | ||||
| 			throw e; | ||||
| 		}); | ||||
|  | @ -308,12 +315,12 @@ getTemplate("baz"); | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  436 bytes       0  [emitted]   | ||||
| 1.output.js  445 bytes       1  [emitted]   | ||||
| 2.output.js  439 bytes       2  [emitted]   | ||||
|   output.js   8.03 KiB       3  [emitted]  main | ||||
|   output.js    8.3 KiB       3  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 41 bytes <{3}> [rendered] | ||||
|     > ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo | ||||
|  | @ -348,12 +355,12 @@ chunk    {3} output.js (main) 456 bytes >{0}< >{1}< >{2}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  113 bytes       0  [emitted]   | ||||
| 1.output.js  114 bytes       1  [emitted]   | ||||
| 2.output.js  115 bytes       2  [emitted]   | ||||
|   output.js   2.09 KiB       3  [emitted]  main | ||||
|   output.js   2.12 KiB       3  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 41 bytes <{3}> [rendered] | ||||
|     > ./foo [3] ./templates lazy ^\.\/.*$ namespace object ./foo | ||||
|  |  | |||
|  | @ -70,12 +70,19 @@ export default foo; | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		3: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -131,7 +138,7 @@ export default foo; | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -249,7 +256,7 @@ function webpackAsyncContext(req) { | |||
| 	var ids = map[req]; | ||||
| 	if(!ids) { | ||||
| 		return Promise.resolve().then(function() { | ||||
| 			var e = new Error('Cannot find module "' + req + '".'); | ||||
| 			var e = new Error("Cannot find module '" + req + "'"); | ||||
| 			e.code = 'MODULE_NOT_FOUND'; | ||||
| 			throw e; | ||||
| 		}); | ||||
|  | @ -300,12 +307,12 @@ __webpack_require__(3)("./ba" + createContextVar).then(function(bar) { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  445 bytes       0  [emitted]  chunk-bar-baz2 | ||||
| 1.output.js  439 bytes       1  [emitted]  chunk-bar-baz0 | ||||
| 2.output.js  436 bytes       2  [emitted]  chunk-foo | ||||
|   output.js   8.23 KiB       3  [emitted]  main | ||||
|   output.js    8.5 KiB       3  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js (chunk-bar-baz2) 41 bytes <{3}> [rendered] | ||||
|     > ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz | ||||
|  | @ -340,12 +347,12 @@ chunk    {3} output.js (main) 580 bytes >{0}< >{1}< >{2}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  114 bytes       0  [emitted]  chunk-bar-baz2 | ||||
| 1.output.js  115 bytes       1  [emitted]  chunk-bar-baz0 | ||||
| 2.output.js  113 bytes       2  [emitted]  chunk-foo | ||||
|   output.js   2.12 KiB       3  [emitted]  main | ||||
|   output.js   2.14 KiB       3  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js (chunk-bar-baz2) 41 bytes <{3}> [rendered] | ||||
|     > ./baz [3] ./templates lazy ^\.\/ba.*$ namespace object ./baz | ||||
|  |  | |||
|  | @ -74,12 +74,19 @@ require.ensure(["c"], function(require) { | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		1: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -135,7 +142,7 @@ require.ensure(["c"], function(require) { | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -301,10 +308,10 @@ Minimized | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  490 bytes       0  [emitted]   | ||||
|   output.js   7.47 KiB       1  [emitted]  main | ||||
|   output.js   7.73 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 22 bytes <{1}> [rendered] | ||||
|     > [2] ./example.js 3:0-6:2 | ||||
|  | @ -320,10 +327,10 @@ chunk    {1} output.js (main) 166 bytes >{0}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset      Size  Chunks             Chunk Names | ||||
| 0.output.js  95 bytes       0  [emitted]   | ||||
|   output.js  1.68 KiB       1  [emitted]  main | ||||
|   output.js  1.71 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 22 bytes <{1}> [rendered] | ||||
|     > [2] ./example.js 3:0-6:2 | ||||
|  |  | |||
|  | @ -153,7 +153,7 @@ module.exports = 42; | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| output.js  3.35 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  | @ -172,7 +172,7 @@ chunk    {0} output.js (main) 206 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset       Size  Chunks             Chunk Names | ||||
| output.js  708 bytes       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  |  | |||
|  | @ -195,6 +195,8 @@ module.exports = "utility3"; | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		0: 0 | ||||
| /******/ 	}; | ||||
|  | @ -368,6 +370,8 @@ module.exports = "utility1"; | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		1: 0 | ||||
| /******/ 	}; | ||||
|  | @ -527,6 +531,8 @@ module.exports = "pageB"; | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		2: 0 | ||||
| /******/ 	}; | ||||
|  | @ -634,11 +640,11 @@ module.exports = "pageC"; | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|                        Asset       Size  Chunks             Chunk Names | ||||
|                     pageA.js   5.59 KiB       0  [emitted]  pageA | ||||
|                     pageB.js   5.39 KiB       1  [emitted]  pageB | ||||
|                     pageC.js   5.34 KiB       2  [emitted]  pageC | ||||
|                     pageA.js   5.72 KiB       0  [emitted]  pageA | ||||
|                     pageB.js   5.52 KiB       1  [emitted]  pageB | ||||
|                     pageC.js   5.47 KiB       2  [emitted]  pageC | ||||
|                    vendor.js  536 bytes       3  [emitted]  vendor | ||||
| commons~pageA~pageB~pageC.js  269 bytes       4  [emitted]  commons~pageA~pageB~pageC | ||||
|       commons~pageB~pageC.js  269 bytes       5  [emitted]  commons~pageB~pageC | ||||
|  | @ -683,7 +689,7 @@ chunk    {5} commons~pageB~pageC.js (commons~pageB~pageC) 28 bytes ={1}= ={2}= = | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|                        Asset       Size  Chunks             Chunk Names | ||||
| commons~pageA~pageB~pageC.js   96 bytes       0  [emitted]  commons~pageA~pageB~pageC | ||||
|       commons~pageB~pageC.js   97 bytes       1  [emitted]  commons~pageB~pageC | ||||
|  |  | |||
|  | @ -142,12 +142,19 @@ module.exports = { | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		4: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -203,7 +210,7 @@ module.exports = { | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -430,13 +437,13 @@ module.exports = function() { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  340 bytes       0  [emitted]   | ||||
| 1.output.js  549 bytes       1  [emitted]   | ||||
| 2.output.js  414 bytes       2  [emitted]   | ||||
| 3.output.js  414 bytes       3  [emitted]   | ||||
|   output.js   7.53 KiB       4  [emitted]  main | ||||
|   output.js   7.79 KiB       4  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 72 bytes <{1}> <{4}> ={2}= ={3}= [rendered] split chunk (cache group: default) | ||||
|     > [0] ./example.js 3:1-6:3 | ||||
|  | @ -468,13 +475,13 @@ chunk    {4} output.js (main) 261 bytes >{0}< >{1}< >{2}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  133 bytes       0  [emitted]   | ||||
| 1.output.js  198 bytes       1  [emitted]   | ||||
| 2.output.js  138 bytes       2  [emitted]   | ||||
| 3.output.js  138 bytes       3  [emitted]   | ||||
|   output.js   1.76 KiB       4  [emitted]  main | ||||
|   output.js   1.78 KiB       4  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 72 bytes <{1}> <{4}> ={2}= ={3}= [rendered] split chunk (cache group: default) | ||||
|     > [0] ./example.js 3:1-6:3 | ||||
|  |  | |||
|  | @ -167,7 +167,7 @@ exports.add = function() { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| output.js  3.44 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  | @ -185,7 +185,7 @@ chunk    {0} output.js (main) 329 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset       Size  Chunks             Chunk Names | ||||
| output.js  740 bytes       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  |  | |||
|  | @ -41,7 +41,7 @@ export function square(n) { | |||
| # dist/vendor.js | ||||
| 
 | ||||
| ``` javascript | ||||
| var vendor_lib_bc3751dcff9f91451e0e = | ||||
| var vendor_lib_f3fbcfb4ec389ba5bbf0 = | ||||
| ``` | ||||
| <details><summary><code>/******/ (function(modules) { /* webpackBootstrap */ })</code></summary> | ||||
| 
 | ||||
|  | @ -157,7 +157,7 @@ function square(n) { | |||
| # dist/vendor-manifest.json | ||||
| 
 | ||||
| ``` javascript | ||||
| {"name":"vendor_lib_bc3751dcff9f91451e0e","content":{"../node_modules/example-vendor.js":{"id":1,"buildMeta":{"exportsType":"namespace","providedExports":["square"]}}}} | ||||
| {"name":"vendor_lib_f3fbcfb4ec389ba5bbf0","content":{"../node_modules/example-vendor.js":{"id":1,"buildMeta":{"exportsType":"namespace","providedExports":["square"]}}}} | ||||
| ``` | ||||
| 
 | ||||
| # Info | ||||
|  | @ -166,7 +166,7 @@ function square(n) { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| vendor.js  3.32 KiB       0  [emitted]  main | ||||
| Entrypoint main = vendor.js | ||||
|  | @ -182,7 +182,7 @@ chunk    {0} vendor.js (main) 60 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset       Size  Chunks             Chunk Names | ||||
| vendor.js  704 bytes       0  [emitted]  main | ||||
| Entrypoint main = vendor.js | ||||
|  |  | |||
|  | @ -147,22 +147,22 @@ console.log(new example_vendor__WEBPACK_IMPORTED_MODULE_0__["square"](7)); | |||
| /***/ }), | ||||
| /* 1 */ | ||||
| /*!******************************************************************************************************!*\ | ||||
|   !*** delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e ***! | ||||
|   !*** delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 ***! | ||||
|   \******************************************************************************************************/ | ||||
| /*! exports provided: square */ | ||||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| module.exports = (__webpack_require__(/*! dll-reference vendor_lib_bc3751dcff9f91451e0e */ 2))(1); | ||||
| module.exports = (__webpack_require__(/*! dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 */ 2))(1); | ||||
| 
 | ||||
| /***/ }), | ||||
| /* 2 */ | ||||
| /*!**************************************************!*\ | ||||
|   !*** external "vendor_lib_bc3751dcff9f91451e0e" ***! | ||||
|   !*** external "vendor_lib_f3fbcfb4ec389ba5bbf0" ***! | ||||
|   \**************************************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports) { | ||||
| 
 | ||||
| module.exports = vendor_lib_bc3751dcff9f91451e0e; | ||||
| module.exports = vendor_lib_f3fbcfb4ec389ba5bbf0; | ||||
| 
 | ||||
| /***/ }) | ||||
| /******/ ]); | ||||
|  | @ -174,7 +174,7 @@ module.exports = vendor_lib_bc3751dcff9f91451e0e; | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|  Asset     Size  Chunks             Chunk Names | ||||
| app.js  3.9 KiB       0  [emitted]  main | ||||
| Entrypoint main = app.js | ||||
|  | @ -183,32 +183,32 @@ chunk    {0} app.js (main) 182 bytes [entry] [rendered] | |||
|  [0] ./example-app.js 98 bytes {0} [built] | ||||
|      [no exports] | ||||
|      single entry ./example-app  main | ||||
|     [1] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e 42 bytes {0} [built] | ||||
|  [1] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 42 bytes {0} [built] | ||||
|      [exports: square] | ||||
|      harmony side effect evaluation example-vendor [0] ./example-app.js 1:0-40 | ||||
|      harmony import specifier example-vendor [0] ./example-app.js 3:12-18 | ||||
|      harmony import specifier example-vendor [0] ./example-app.js 4:16-22 | ||||
|     [2] external "vendor_lib_bc3751dcff9f91451e0e" 42 bytes {0} [built] | ||||
|         delegated source dll-reference vendor_lib_bc3751dcff9f91451e0e [1] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e | ||||
|  [2] external "vendor_lib_f3fbcfb4ec389ba5bbf0" 42 bytes {0} [built] | ||||
|      delegated source dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 [1] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 | ||||
| ``` | ||||
| 
 | ||||
| ## Production mode | ||||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|  Asset       Size  Chunks             Chunk Names | ||||
| app.js  736 bytes       0  [emitted]  main | ||||
| Entrypoint main = app.js | ||||
| chunk    {0} app.js (main) 182 bytes [entry] [rendered] | ||||
|     > ./example-app main | ||||
|     [0] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e 42 bytes {0} [built] | ||||
|  [0] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 42 bytes {0} [built] | ||||
|      [exports: square] | ||||
|      harmony side effect evaluation example-vendor [2] ./example-app.js 1:0-40 | ||||
|      harmony import specifier example-vendor [2] ./example-app.js 3:12-18 | ||||
|      harmony import specifier example-vendor [2] ./example-app.js 4:16-22 | ||||
|     [1] external "vendor_lib_bc3751dcff9f91451e0e" 42 bytes {0} [built] | ||||
|         delegated source dll-reference vendor_lib_bc3751dcff9f91451e0e [0] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bc3751dcff9f91451e0e | ||||
|  [1] external "vendor_lib_f3fbcfb4ec389ba5bbf0" 42 bytes {0} [built] | ||||
|      delegated source dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 [0] delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_f3fbcfb4ec389ba5bbf0 | ||||
|  [2] ./example-app.js 98 bytes {0} [built] | ||||
|      [no exports] | ||||
|      single entry ./example-app  main | ||||
|  |  | |||
|  | @ -140,82 +140,82 @@ console.log(__webpack_require__(/*! module */ 8)); | |||
| /***/ }), | ||||
| /* 1 */ | ||||
| /*!**************************************************************************!*\ | ||||
|   !*** delegated ./alpha.js from dll-reference alpha_53e9c88e69872d1acfd3 ***! | ||||
|   !*** delegated ./alpha.js from dll-reference alpha_9acca21e0d34e518784e ***! | ||||
|   \**************************************************************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| module.exports = (__webpack_require__(/*! dll-reference alpha_53e9c88e69872d1acfd3 */ 2))(1); | ||||
| module.exports = (__webpack_require__(/*! dll-reference alpha_9acca21e0d34e518784e */ 2))(1); | ||||
| 
 | ||||
| /***/ }), | ||||
| /* 2 */ | ||||
| /*!*********************************************!*\ | ||||
|   !*** external "alpha_53e9c88e69872d1acfd3" ***! | ||||
|   !*** external "alpha_9acca21e0d34e518784e" ***! | ||||
|   \*********************************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports) { | ||||
| 
 | ||||
| module.exports = alpha_53e9c88e69872d1acfd3; | ||||
| module.exports = alpha_9acca21e0d34e518784e; | ||||
| 
 | ||||
| /***/ }), | ||||
| /* 3 */ | ||||
| /*!**********************************************************************!*\ | ||||
|   !*** delegated ./a.js from dll-reference alpha_53e9c88e69872d1acfd3 ***! | ||||
|   !*** delegated ./a.js from dll-reference alpha_9acca21e0d34e518784e ***! | ||||
|   \**********************************************************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| module.exports = (__webpack_require__(/*! dll-reference alpha_53e9c88e69872d1acfd3 */ 2))(2); | ||||
| module.exports = (__webpack_require__(/*! dll-reference alpha_9acca21e0d34e518784e */ 2))(2); | ||||
| 
 | ||||
| /***/ }), | ||||
| /* 4 */ | ||||
| /*!************************************************************************!*\ | ||||
|   !*** delegated ./beta.js from dll-reference beta_53e9c88e69872d1acfd3 ***! | ||||
|   !*** delegated ./beta.js from dll-reference beta_9acca21e0d34e518784e ***! | ||||
|   \************************************************************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| module.exports = (__webpack_require__(/*! dll-reference beta_53e9c88e69872d1acfd3 */ 5))(5); | ||||
| module.exports = (__webpack_require__(/*! dll-reference beta_9acca21e0d34e518784e */ 5))(5); | ||||
| 
 | ||||
| /***/ }), | ||||
| /* 5 */ | ||||
| /*!********************************************!*\ | ||||
|   !*** external "beta_53e9c88e69872d1acfd3" ***! | ||||
|   !*** external "beta_9acca21e0d34e518784e" ***! | ||||
|   \********************************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports) { | ||||
| 
 | ||||
| module.exports = beta_53e9c88e69872d1acfd3; | ||||
| module.exports = beta_9acca21e0d34e518784e; | ||||
| 
 | ||||
| /***/ }), | ||||
| /* 6 */ | ||||
| /*!*********************************************************************!*\ | ||||
|   !*** delegated ./b.js from dll-reference beta_53e9c88e69872d1acfd3 ***! | ||||
|   !*** delegated ./b.js from dll-reference beta_9acca21e0d34e518784e ***! | ||||
|   \*********************************************************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| module.exports = (__webpack_require__(/*! dll-reference beta_53e9c88e69872d1acfd3 */ 5))(6); | ||||
| module.exports = (__webpack_require__(/*! dll-reference beta_9acca21e0d34e518784e */ 5))(6); | ||||
| 
 | ||||
| /***/ }), | ||||
| /* 7 */ | ||||
| /*!**********************************************************************!*\ | ||||
|   !*** delegated ./c.jsx from dll-reference beta_53e9c88e69872d1acfd3 ***! | ||||
|   !*** delegated ./c.jsx from dll-reference beta_9acca21e0d34e518784e ***! | ||||
|   \**********************************************************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| module.exports = (__webpack_require__(/*! dll-reference beta_53e9c88e69872d1acfd3 */ 5))(7); | ||||
| module.exports = (__webpack_require__(/*! dll-reference beta_9acca21e0d34e518784e */ 5))(7); | ||||
| 
 | ||||
| /***/ }), | ||||
| /* 8 */ | ||||
| /*!*****************************************************************************************!*\ | ||||
|   !*** delegated ../node_modules/module.js from dll-reference alpha_53e9c88e69872d1acfd3 ***! | ||||
|   !*** delegated ../node_modules/module.js from dll-reference alpha_9acca21e0d34e518784e ***! | ||||
|   \*****************************************************************************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| module.exports = (__webpack_require__(/*! dll-reference alpha_53e9c88e69872d1acfd3 */ 2))(3); | ||||
| module.exports = (__webpack_require__(/*! dll-reference alpha_9acca21e0d34e518784e */ 2))(3); | ||||
| 
 | ||||
| /***/ }) | ||||
| /******/ ]); | ||||
|  | @ -227,7 +227,7 @@ module.exports = (__webpack_require__(/*! dll-reference alpha_53e9c88e69872d1acf | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| output.js  6.19 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  | @ -235,25 +235,25 @@ chunk    {0} output.js (main) 549 bytes [entry] [rendered] | |||
|     > .\example.js main | ||||
|  [0] ./example.js 213 bytes {0} [built] | ||||
|      single entry .\example.js  main | ||||
|     [1] delegated ./alpha.js from dll-reference alpha_53e9c88e69872d1acfd3 42 bytes {0} [built] | ||||
|  [1] delegated ./alpha.js from dll-reference alpha_9acca21e0d34e518784e 42 bytes {0} [built] | ||||
|      cjs require ../dll/alpha [0] ./example.js 1:12-35 | ||||
|     [2] external "alpha_53e9c88e69872d1acfd3" 42 bytes {0} [built] | ||||
|         delegated source dll-reference alpha_53e9c88e69872d1acfd3 [1] delegated ./alpha.js from dll-reference alpha_53e9c88e69872d1acfd3 | ||||
|         delegated source dll-reference alpha_53e9c88e69872d1acfd3 [3] delegated ./a.js from dll-reference alpha_53e9c88e69872d1acfd3 | ||||
|         delegated source dll-reference alpha_53e9c88e69872d1acfd3 [8] delegated ../node_modules/module.js from dll-reference alpha_53e9c88e69872d1acfd3 | ||||
|     [3] delegated ./a.js from dll-reference alpha_53e9c88e69872d1acfd3 42 bytes {0} [built] | ||||
|  [2] external "alpha_9acca21e0d34e518784e" 42 bytes {0} [built] | ||||
|      delegated source dll-reference alpha_9acca21e0d34e518784e [1] delegated ./alpha.js from dll-reference alpha_9acca21e0d34e518784e | ||||
|      delegated source dll-reference alpha_9acca21e0d34e518784e [3] delegated ./a.js from dll-reference alpha_9acca21e0d34e518784e | ||||
|      delegated source dll-reference alpha_9acca21e0d34e518784e [8] delegated ../node_modules/module.js from dll-reference alpha_9acca21e0d34e518784e | ||||
|  [3] delegated ./a.js from dll-reference alpha_9acca21e0d34e518784e 42 bytes {0} [built] | ||||
|      cjs require ../dll/a [0] ./example.js 2:12-31 | ||||
|     [4] delegated ./beta.js from dll-reference beta_53e9c88e69872d1acfd3 42 bytes {0} [built] | ||||
|  [4] delegated ./beta.js from dll-reference beta_9acca21e0d34e518784e 42 bytes {0} [built] | ||||
|      cjs require beta/beta [0] ./example.js 4:12-32 | ||||
|     [5] external "beta_53e9c88e69872d1acfd3" 42 bytes {0} [built] | ||||
|         delegated source dll-reference beta_53e9c88e69872d1acfd3 [4] delegated ./beta.js from dll-reference beta_53e9c88e69872d1acfd3 | ||||
|         delegated source dll-reference beta_53e9c88e69872d1acfd3 [6] delegated ./b.js from dll-reference beta_53e9c88e69872d1acfd3 | ||||
|         delegated source dll-reference beta_53e9c88e69872d1acfd3 [7] delegated ./c.jsx from dll-reference beta_53e9c88e69872d1acfd3 | ||||
|     [6] delegated ./b.js from dll-reference beta_53e9c88e69872d1acfd3 42 bytes {0} [built] | ||||
|  [5] external "beta_9acca21e0d34e518784e" 42 bytes {0} [built] | ||||
|      delegated source dll-reference beta_9acca21e0d34e518784e [4] delegated ./beta.js from dll-reference beta_9acca21e0d34e518784e | ||||
|      delegated source dll-reference beta_9acca21e0d34e518784e [6] delegated ./b.js from dll-reference beta_9acca21e0d34e518784e | ||||
|      delegated source dll-reference beta_9acca21e0d34e518784e [7] delegated ./c.jsx from dll-reference beta_9acca21e0d34e518784e | ||||
|  [6] delegated ./b.js from dll-reference beta_9acca21e0d34e518784e 42 bytes {0} [built] | ||||
|      cjs require beta/b [0] ./example.js 5:12-29 | ||||
|     [7] delegated ./c.jsx from dll-reference beta_53e9c88e69872d1acfd3 42 bytes {0} [built] | ||||
|  [7] delegated ./c.jsx from dll-reference beta_9acca21e0d34e518784e 42 bytes {0} [built] | ||||
|      cjs require beta/c [0] ./example.js 6:12-29 | ||||
|     [8] delegated ../node_modules/module.js from dll-reference alpha_53e9c88e69872d1acfd3 42 bytes {0} [built] | ||||
|  [8] delegated ../node_modules/module.js from dll-reference alpha_9acca21e0d34e518784e 42 bytes {0} [built] | ||||
|      cjs require module [0] ./example.js 8:12-29 | ||||
| ``` | ||||
| 
 | ||||
|  | @ -261,31 +261,31 @@ chunk    {0} output.js (main) 549 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset       Size  Chunks             Chunk Names | ||||
| output.js  972 bytes       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} output.js (main) 549 bytes [entry] [rendered] | ||||
|     > .\example.js main | ||||
|     [0] external "beta_53e9c88e69872d1acfd3" 42 bytes {0} [built] | ||||
|         delegated source dll-reference beta_53e9c88e69872d1acfd3 [3] delegated ./c.jsx from dll-reference beta_53e9c88e69872d1acfd3 | ||||
|         delegated source dll-reference beta_53e9c88e69872d1acfd3 [4] delegated ./b.js from dll-reference beta_53e9c88e69872d1acfd3 | ||||
|         delegated source dll-reference beta_53e9c88e69872d1acfd3 [5] delegated ./beta.js from dll-reference beta_53e9c88e69872d1acfd3 | ||||
|     [1] external "alpha_53e9c88e69872d1acfd3" 42 bytes {0} [built] | ||||
|         delegated source dll-reference alpha_53e9c88e69872d1acfd3 [2] delegated ../node_modules/module.js from dll-reference alpha_53e9c88e69872d1acfd3 | ||||
|         delegated source dll-reference alpha_53e9c88e69872d1acfd3 [6] delegated ./a.js from dll-reference alpha_53e9c88e69872d1acfd3 | ||||
|         delegated source dll-reference alpha_53e9c88e69872d1acfd3 [7] delegated ./alpha.js from dll-reference alpha_53e9c88e69872d1acfd3 | ||||
|     [2] delegated ../node_modules/module.js from dll-reference alpha_53e9c88e69872d1acfd3 42 bytes {0} [built] | ||||
|  [0] external "beta_9acca21e0d34e518784e" 42 bytes {0} [built] | ||||
|      delegated source dll-reference beta_9acca21e0d34e518784e [3] delegated ./c.jsx from dll-reference beta_9acca21e0d34e518784e | ||||
|      delegated source dll-reference beta_9acca21e0d34e518784e [4] delegated ./b.js from dll-reference beta_9acca21e0d34e518784e | ||||
|      delegated source dll-reference beta_9acca21e0d34e518784e [5] delegated ./beta.js from dll-reference beta_9acca21e0d34e518784e | ||||
|  [1] external "alpha_9acca21e0d34e518784e" 42 bytes {0} [built] | ||||
|      delegated source dll-reference alpha_9acca21e0d34e518784e [2] delegated ../node_modules/module.js from dll-reference alpha_9acca21e0d34e518784e | ||||
|      delegated source dll-reference alpha_9acca21e0d34e518784e [6] delegated ./a.js from dll-reference alpha_9acca21e0d34e518784e | ||||
|      delegated source dll-reference alpha_9acca21e0d34e518784e [7] delegated ./alpha.js from dll-reference alpha_9acca21e0d34e518784e | ||||
|  [2] delegated ../node_modules/module.js from dll-reference alpha_9acca21e0d34e518784e 42 bytes {0} [built] | ||||
|      cjs require module [8] ./example.js 8:12-29 | ||||
|     [3] delegated ./c.jsx from dll-reference beta_53e9c88e69872d1acfd3 42 bytes {0} [built] | ||||
|  [3] delegated ./c.jsx from dll-reference beta_9acca21e0d34e518784e 42 bytes {0} [built] | ||||
|      cjs require beta/c [8] ./example.js 6:12-29 | ||||
|     [4] delegated ./b.js from dll-reference beta_53e9c88e69872d1acfd3 42 bytes {0} [built] | ||||
|  [4] delegated ./b.js from dll-reference beta_9acca21e0d34e518784e 42 bytes {0} [built] | ||||
|      cjs require beta/b [8] ./example.js 5:12-29 | ||||
|     [5] delegated ./beta.js from dll-reference beta_53e9c88e69872d1acfd3 42 bytes {0} [built] | ||||
|  [5] delegated ./beta.js from dll-reference beta_9acca21e0d34e518784e 42 bytes {0} [built] | ||||
|      cjs require beta/beta [8] ./example.js 4:12-32 | ||||
|     [6] delegated ./a.js from dll-reference alpha_53e9c88e69872d1acfd3 42 bytes {0} [built] | ||||
|  [6] delegated ./a.js from dll-reference alpha_9acca21e0d34e518784e 42 bytes {0} [built] | ||||
|      cjs require ../dll/a [8] ./example.js 2:12-31 | ||||
|     [7] delegated ./alpha.js from dll-reference alpha_53e9c88e69872d1acfd3 42 bytes {0} [built] | ||||
|  [7] delegated ./alpha.js from dll-reference alpha_9acca21e0d34e518784e 42 bytes {0} [built] | ||||
|      cjs require ../dll/alpha [8] ./example.js 1:12-35 | ||||
|  [8] ./example.js 213 bytes {0} [built] | ||||
|      single entry .\example.js  main | ||||
|  |  | |||
|  | @ -36,7 +36,7 @@ module.exports = { | |||
| # dist/MyDll.alpha.js | ||||
| 
 | ||||
| ``` javascript | ||||
| var alpha_53e9c88e69872d1acfd3 = | ||||
| var alpha_9acca21e0d34e518784e = | ||||
| ``` | ||||
| <details><summary><code>/******/ (function(modules) { /* webpackBootstrap */ })</code></summary> | ||||
| 
 | ||||
|  | @ -168,7 +168,7 @@ module.exports = "module"; | |||
| # dist/alpha-manifest.json | ||||
| 
 | ||||
| ``` javascript | ||||
| {"name":"alpha_53e9c88e69872d1acfd3","content":{"./alpha.js":{"id":1,"buildMeta":{"providedExports":true}},"./a.js":{"id":2,"buildMeta":{"providedExports":true}},"../node_modules/module.js":{"id":3,"buildMeta":{"providedExports":true}}}} | ||||
| {"name":"alpha_9acca21e0d34e518784e","content":{"./alpha.js":{"id":1,"buildMeta":{"providedExports":true}},"./a.js":{"id":2,"buildMeta":{"providedExports":true}},"../node_modules/module.js":{"id":3,"buildMeta":{"providedExports":true}}}} | ||||
| ``` | ||||
| 
 | ||||
| # Info | ||||
|  | @ -177,7 +177,7 @@ module.exports = "module"; | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|          Asset      Size  Chunks             Chunk Names | ||||
| MyDll.alpha.js  3.46 KiB       0  [emitted]  alpha | ||||
|  MyDll.beta.js  3.43 KiB       1  [emitted]  beta | ||||
|  | @ -215,7 +215,7 @@ chunk    {1} MyDll.beta.js (beta) 80 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|          Asset       Size  Chunks             Chunk Names | ||||
|  MyDll.beta.js  691 bytes       0  [emitted]  beta | ||||
| MyDll.alpha.js  700 bytes       1  [emitted]  alpha | ||||
|  |  | |||
|  | @ -46,7 +46,7 @@ module.exports = [ | |||
| # dist/vendor.js | ||||
| 
 | ||||
| ``` javascript | ||||
| var vendor_ee007e7c7b39dbafa2cd = | ||||
| var vendor_13ad3c1449410cfed1ed = | ||||
| ``` | ||||
| <details><summary><code>/******/ (function(modules) { /* webpackBootstrap */ })</code></summary> | ||||
| 
 | ||||
|  | @ -252,22 +252,22 @@ module.exports = "pageA"; | |||
| /***/ }), | ||||
| /* 1 */ | ||||
| /*!****************************************************************************!*\ | ||||
|   !*** delegated ./vendor.js from dll-reference vendor_ee007e7c7b39dbafa2cd ***! | ||||
|   !*** delegated ./vendor.js from dll-reference vendor_13ad3c1449410cfed1ed ***! | ||||
|   \****************************************************************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| module.exports = (__webpack_require__(/*! dll-reference vendor_ee007e7c7b39dbafa2cd */ 2))(1); | ||||
| module.exports = (__webpack_require__(/*! dll-reference vendor_13ad3c1449410cfed1ed */ 2))(1); | ||||
| 
 | ||||
| /***/ }), | ||||
| /* 2 */ | ||||
| /*!**********************************************!*\ | ||||
|   !*** external "vendor_ee007e7c7b39dbafa2cd" ***! | ||||
|   !*** external "vendor_13ad3c1449410cfed1ed" ***! | ||||
|   \**********************************************/ | ||||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports) { | ||||
| 
 | ||||
| module.exports = vendor_ee007e7c7b39dbafa2cd; | ||||
| module.exports = vendor_13ad3c1449410cfed1ed; | ||||
| 
 | ||||
| /***/ }) | ||||
| /******/ ]); | ||||
|  | @ -279,7 +279,7 @@ module.exports = vendor_ee007e7c7b39dbafa2cd; | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
| Child vendor: | ||||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|         Asset      Size  Chunks             Chunk Names | ||||
|  | @ -309,19 +309,19 @@ Child app: | |||
|         > ./pageA pageA | ||||
|      [0] ./pageA.js 60 bytes {0} [built] | ||||
|          single entry ./pageA  pageA | ||||
|         [1] delegated ./vendor.js from dll-reference vendor_ee007e7c7b39dbafa2cd 42 bytes {0} [built] | ||||
|      [1] delegated ./vendor.js from dll-reference vendor_13ad3c1449410cfed1ed 42 bytes {0} [built] | ||||
|          cjs require ./vendor [0] ./pageA.js 1:12-31 | ||||
|         [2] external "vendor_ee007e7c7b39dbafa2cd" 42 bytes {0} {1} [built] | ||||
|             delegated source dll-reference vendor_ee007e7c7b39dbafa2cd [1] delegated ./vendor.js from dll-reference vendor_ee007e7c7b39dbafa2cd | ||||
|             delegated source dll-reference vendor_ee007e7c7b39dbafa2cd [4] delegated ./vendor2.js from dll-reference vendor_ee007e7c7b39dbafa2cd | ||||
|      [2] external "vendor_13ad3c1449410cfed1ed" 42 bytes {0} {1} [built] | ||||
|          delegated source dll-reference vendor_13ad3c1449410cfed1ed [1] delegated ./vendor.js from dll-reference vendor_13ad3c1449410cfed1ed | ||||
|          delegated source dll-reference vendor_13ad3c1449410cfed1ed [4] delegated ./vendor2.js from dll-reference vendor_13ad3c1449410cfed1ed | ||||
|     chunk    {1} pageB.js (pageB) 145 bytes [entry] [rendered] | ||||
|         > ./pageB pageB | ||||
|         [2] external "vendor_ee007e7c7b39dbafa2cd" 42 bytes {0} {1} [built] | ||||
|             delegated source dll-reference vendor_ee007e7c7b39dbafa2cd [1] delegated ./vendor.js from dll-reference vendor_ee007e7c7b39dbafa2cd | ||||
|             delegated source dll-reference vendor_ee007e7c7b39dbafa2cd [4] delegated ./vendor2.js from dll-reference vendor_ee007e7c7b39dbafa2cd | ||||
|      [2] external "vendor_13ad3c1449410cfed1ed" 42 bytes {0} {1} [built] | ||||
|          delegated source dll-reference vendor_13ad3c1449410cfed1ed [1] delegated ./vendor.js from dll-reference vendor_13ad3c1449410cfed1ed | ||||
|          delegated source dll-reference vendor_13ad3c1449410cfed1ed [4] delegated ./vendor2.js from dll-reference vendor_13ad3c1449410cfed1ed | ||||
|      [3] ./pageB.js 61 bytes {1} [built] | ||||
|          single entry ./pageB  pageB | ||||
|         [4] delegated ./vendor2.js from dll-reference vendor_ee007e7c7b39dbafa2cd 42 bytes {1} [built] | ||||
|      [4] delegated ./vendor2.js from dll-reference vendor_13ad3c1449410cfed1ed 42 bytes {1} [built] | ||||
|          cjs require ./vendor2 [3] ./pageB.js 1:12-32 | ||||
|     chunk    {2} pageC.js (pageC) 25 bytes [entry] [rendered] | ||||
|         > ./pageC pageC | ||||
|  | @ -333,7 +333,7 @@ Child app: | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
| Child vendor: | ||||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|         Asset       Size  Chunks             Chunk Names | ||||
|  | @ -365,19 +365,19 @@ Child app: | |||
|          single entry ./pageC  pageC | ||||
|     chunk    {1} pageB.js (pageB) 145 bytes [entry] [rendered] | ||||
|         > ./pageB pageB | ||||
|         [0] external "vendor_2e11d1dbfa7fdf7cff54" 42 bytes {1} {2} [built] | ||||
|             delegated source dll-reference vendor_2e11d1dbfa7fdf7cff54 [2] delegated ./vendor2.js from dll-reference vendor_2e11d1dbfa7fdf7cff54 | ||||
|             delegated source dll-reference vendor_2e11d1dbfa7fdf7cff54 [4] delegated ./vendor.js from dll-reference vendor_2e11d1dbfa7fdf7cff54 | ||||
|         [2] delegated ./vendor2.js from dll-reference vendor_2e11d1dbfa7fdf7cff54 42 bytes {1} [built] | ||||
|      [0] external "vendor_33c22a944ddd30a49a4f" 42 bytes {1} {2} [built] | ||||
|          delegated source dll-reference vendor_33c22a944ddd30a49a4f [2] delegated ./vendor2.js from dll-reference vendor_33c22a944ddd30a49a4f | ||||
|          delegated source dll-reference vendor_33c22a944ddd30a49a4f [4] delegated ./vendor.js from dll-reference vendor_33c22a944ddd30a49a4f | ||||
|      [2] delegated ./vendor2.js from dll-reference vendor_33c22a944ddd30a49a4f 42 bytes {1} [built] | ||||
|          cjs require ./vendor2 [3] ./pageB.js 1:12-32 | ||||
|      [3] ./pageB.js 61 bytes {1} [built] | ||||
|          single entry ./pageB  pageB | ||||
|     chunk    {2} pageA.js (pageA) 144 bytes [entry] [rendered] | ||||
|         > ./pageA pageA | ||||
|         [0] external "vendor_2e11d1dbfa7fdf7cff54" 42 bytes {1} {2} [built] | ||||
|             delegated source dll-reference vendor_2e11d1dbfa7fdf7cff54 [2] delegated ./vendor2.js from dll-reference vendor_2e11d1dbfa7fdf7cff54 | ||||
|             delegated source dll-reference vendor_2e11d1dbfa7fdf7cff54 [4] delegated ./vendor.js from dll-reference vendor_2e11d1dbfa7fdf7cff54 | ||||
|         [4] delegated ./vendor.js from dll-reference vendor_2e11d1dbfa7fdf7cff54 42 bytes {2} [built] | ||||
|      [0] external "vendor_33c22a944ddd30a49a4f" 42 bytes {1} {2} [built] | ||||
|          delegated source dll-reference vendor_33c22a944ddd30a49a4f [2] delegated ./vendor2.js from dll-reference vendor_33c22a944ddd30a49a4f | ||||
|          delegated source dll-reference vendor_33c22a944ddd30a49a4f [4] delegated ./vendor.js from dll-reference vendor_33c22a944ddd30a49a4f | ||||
|      [4] delegated ./vendor.js from dll-reference vendor_33c22a944ddd30a49a4f 42 bytes {2} [built] | ||||
|          cjs require ./vendor [5] ./pageA.js 1:12-31 | ||||
|      [5] ./pageA.js 60 bytes {2} [built] | ||||
|          single entry ./pageA  pageA | ||||
|  |  | |||
|  | @ -183,7 +183,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__; | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| output.js  4.17 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  | @ -201,7 +201,7 @@ chunk    {0} output.js (main) 197 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| output.js  1.02 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  |  | |||
|  | @ -73,12 +73,19 @@ module.exports = { | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		7: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -134,7 +141,7 @@ module.exports = { | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -257,7 +264,7 @@ Promise.all(/*! require.ensure */[__webpack_require__.e(0), __webpack_require__. | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  247 bytes       0  [emitted]   | ||||
| 1.output.js  238 bytes       1  [emitted]   | ||||
|  | @ -266,7 +273,7 @@ Version: webpack 4.5.0 | |||
| 4.output.js  241 bytes       4  [emitted]   | ||||
| 5.output.js  241 bytes       5  [emitted]   | ||||
| 6.output.js  241 bytes       6  [emitted]   | ||||
|   output.js   8.07 KiB       7  [emitted]  main | ||||
|   output.js   8.34 KiB       7  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 21 bytes <{7}> ={1}= ={2}= ={3}= ={4}= >{1}< >{5}< >{6}< [rendered] split chunk (cache group: default) | ||||
|     > ./a ./b ./c [2] ./example.js 1:0-52 | ||||
|  | @ -317,7 +324,7 @@ chunk    {7} output.js (main) 362 bytes >{0}< >{1}< >{2}< >{3}< >{4}< [entry] [r | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset      Size  Chunks             Chunk Names | ||||
| 0.output.js  90 bytes       0  [emitted]   | ||||
| 1.output.js  89 bytes       1  [emitted]   | ||||
|  | @ -326,7 +333,7 @@ Version: webpack 4.5.0 | |||
| 4.output.js  91 bytes       4  [emitted]   | ||||
| 5.output.js  91 bytes       5  [emitted]   | ||||
| 6.output.js  91 bytes       6  [emitted]   | ||||
|   output.js  2.02 KiB       7  [emitted]  main | ||||
|   output.js  2.04 KiB       7  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 21 bytes <{7}> ={1}= ={2}= ={3}= ={4}= >{1}< >{5}< >{6}< [rendered] split chunk (cache group: default) | ||||
|     > ./a ./b ./c [2] ./example.js 1:0-52 | ||||
|  |  | |||
|  | @ -83,12 +83,19 @@ require.ensure(["./a"], function(require) { | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		3: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -144,7 +151,7 @@ require.ensure(["./a"], function(require) { | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -324,12 +331,12 @@ module.exports = "c"; | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  405 bytes       0  [emitted]   | ||||
| 1.output.js  241 bytes       1  [emitted]   | ||||
| 2.output.js  241 bytes       2  [emitted]   | ||||
|   output.js   7.31 KiB       3  [emitted]  main | ||||
|   output.js   7.58 KiB       3  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 42 bytes <{3}> ={1}= ={2}= [rendered] split chunk (cache group: default) | ||||
|     > ./a ./b ./c [2] ./example.js 2:0-30 | ||||
|  | @ -358,12 +365,12 @@ chunk    {3} output.js (main) 164 bytes >{0}< >{1}< >{2}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  118 bytes       0  [emitted]   | ||||
| 1.output.js   91 bytes       1  [emitted]   | ||||
| 2.output.js   91 bytes       2  [emitted]   | ||||
|   output.js   1.73 KiB       3  [emitted]  main | ||||
|   output.js   1.75 KiB       3  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 42 bytes <{3}> ={1}= ={2}= [rendered] split chunk (cache group: default) | ||||
|     > ./a ./b ./c [2] ./example.js 2:0-30 | ||||
|  |  | |||
|  | @ -260,16 +260,16 @@ var named = "named"; | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| output.js  6.13 KiB       0  [emitted]  main | ||||
| output.js  6.12 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} output.js (main) 1.17 KiB [entry] [rendered] | ||||
| chunk    {0} output.js (main) 1.16 KiB [entry] [rendered] | ||||
|     > .\example.js main | ||||
|  [0] ./example.js 389 bytes {0} [built] | ||||
|      [no exports] | ||||
|      single entry .\example.js  main | ||||
|     [1] ./fs.js 264 bytes {0} [built] | ||||
|  [1] ./fs.js 257 bytes {0} [built] | ||||
|      harmony side effect evaluation ./fs [0] ./example.js 4:0-22 | ||||
|      harmony side effect evaluation ./fs [0] ./example.js 5:0-32 | ||||
|      harmony side effect evaluation ./fs [0] ./example.js 6:0-28 | ||||
|  | @ -292,13 +292,13 @@ chunk    {0} output.js (main) 1.17 KiB [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset       Size  Chunks             Chunk Names | ||||
| output.js  993 bytes       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} output.js (main) 1.17 KiB [entry] [rendered] | ||||
| chunk    {0} output.js (main) 1.16 KiB [entry] [rendered] | ||||
|     > .\example.js main | ||||
|     [0] ./fs.js 264 bytes {0} [built] | ||||
|  [0] ./fs.js 257 bytes {0} [built] | ||||
|      [only some exports used: default, readFile] | ||||
|      harmony side effect evaluation ./fs [1] ./reexport-commonjs.js 2:0-21 | ||||
|      harmony export imported specifier ./fs [1] ./reexport-commonjs.js 2:0-21 | ||||
|  |  | |||
|  | @ -137,7 +137,7 @@ function increment() { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|            Asset      Size  Chunks             Chunk Names | ||||
| MyLibrary.umd.js  3.56 KiB       0  [emitted]  main | ||||
| Entrypoint main = MyLibrary.umd.js | ||||
|  | @ -152,7 +152,7 @@ chunk    {0} MyLibrary.umd.js (main) 97 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|            Asset       Size  Chunks             Chunk Names | ||||
| MyLibrary.umd.js  926 bytes       0  [emitted]  main | ||||
| Entrypoint main = MyLibrary.umd.js | ||||
|  |  | |||
|  | @ -240,7 +240,7 @@ function c() { console.log("c"); } | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| output.js  5.93 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  | @ -272,7 +272,7 @@ chunk    {0} output.js (main) 726 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset       Size  Chunks             Chunk Names | ||||
| output.js  971 bytes       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  |  | |||
|  | @ -59,12 +59,19 @@ export function increment(val) { | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		1: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -120,7 +127,7 @@ export function increment(val) { | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -274,10 +281,10 @@ __webpack_require__.e(/*! import() */ 0).then(__webpack_require__.bind(null, /*! | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  479 bytes       0  [emitted]   | ||||
|   output.js   8.27 KiB       1  [emitted]  main | ||||
|   output.js   8.54 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 25 bytes <{1}> [rendered] | ||||
|     > ./async-loaded [2] ./example.js 6:0-24 | ||||
|  | @ -303,10 +310,10 @@ chunk    {1} output.js (main) 419 bytes >{0}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  144 bytes       0  [emitted]   | ||||
|   output.js   1.73 KiB       1  [emitted]  main | ||||
|   output.js   1.75 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 25 bytes <{1}> [rendered] | ||||
|     > ./async-loaded [] 6:0-24 | ||||
|  | @ -323,12 +330,12 @@ chunk    {1} output.js (main) 419 bytes >{0}< [entry] [rendered] | |||
|      |     single entry .\example.js  main | ||||
|      | ./increment.js 94 bytes [built] | ||||
|      |     [exports: increment] | ||||
|         |    [only some exports used: increment] | ||||
|      |     [all exports used] | ||||
|      |     harmony side effect evaluation ./increment  ./example.js 1:0-47 | ||||
|      |     harmony import specifier ./increment  ./example.js 3:0-3 | ||||
|      | ./math.js 142 bytes [built] | ||||
|      |     [exports: add] | ||||
|         |    [only some exports used: add] | ||||
|      |     [all exports used] | ||||
|      |     harmony side effect evaluation ./math  ./increment.js 1:0-29 | ||||
|      |     harmony import specifier ./math  ./increment.js 3:11-14 | ||||
| ``` | ||||
|  | @ -153,7 +153,7 @@ function webpackAsyncContext(req) { | |||
| 	var ids = map[req]; | ||||
| 	if(!ids) { | ||||
| 		return Promise.resolve().then(function() { | ||||
| 			var e = new Error('Cannot find module "' + req + '".'); | ||||
| 			var e = new Error("Cannot find module '" + req + "'"); | ||||
| 			e.code = 'MODULE_NOT_FOUND'; | ||||
| 			throw e; | ||||
| 		}); | ||||
|  | @ -231,12 +231,19 @@ module.exports = webpackAsyncContext; | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		4: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ 	var deferredModules = []; | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + ({"0":"bPage"}[chunkId]||chunkId) + ".chunk.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -292,7 +299,7 @@ module.exports = webpackAsyncContext; | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + ({"0":"bPage"}[chunkId]||chunkId) + ".chunk.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -437,13 +444,13 @@ module.exports = function() { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|                Asset       Size  Chunks             Chunk Names | ||||
|       bPage.chunk.js  299 bytes       0  [emitted]  bPage | ||||
|       aPage.chunk.js  293 bytes       1  [emitted]  aPage | ||||
| pageA~pageB.chunk.js   2.19 KiB       2  [emitted]  pageA~pageB | ||||
|      pageB.bundle.js   8.19 KiB       3  [emitted]  pageB | ||||
|      pageA.bundle.js   8.19 KiB       4  [emitted]  pageA | ||||
|      pageB.bundle.js   8.46 KiB       3  [emitted]  pageB | ||||
|      pageA.bundle.js   8.46 KiB       4  [emitted]  pageA | ||||
| Entrypoint pageA = pageA~pageB.chunk.js aPage.chunk.js pageA.bundle.js | ||||
| Entrypoint pageB = pageA~pageB.chunk.js bPage.chunk.js pageB.bundle.js | ||||
| chunk    {0} bPage.chunk.js (bPage) 61 bytes <{1}> <{2}> <{4}> ={2}= ={3}= >{1}< [initial] [rendered] reused as split chunk (cache group: default) | ||||
|  | @ -490,13 +497,13 @@ chunk    {4} pageA.bundle.js (pageA) 129 bytes ={1}= ={2}= >{0}< [entry] [render | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|                Asset       Size  Chunks             Chunk Names | ||||
|       bPage.chunk.js  122 bytes       0  [emitted]  bPage | ||||
|       aPage.chunk.js  123 bytes       1  [emitted]  aPage | ||||
| pageA~pageB.chunk.js  629 bytes       2  [emitted]  pageA~pageB | ||||
|      pageB.bundle.js   1.85 KiB       3  [emitted]  pageB | ||||
|      pageA.bundle.js   1.85 KiB       4  [emitted]  pageA | ||||
|      pageB.bundle.js   1.87 KiB       3  [emitted]  pageB | ||||
|      pageA.bundle.js   1.87 KiB       4  [emitted]  pageA | ||||
| Entrypoint pageA = pageA~pageB.chunk.js aPage.chunk.js pageA.bundle.js | ||||
| Entrypoint pageB = pageA~pageB.chunk.js bPage.chunk.js pageB.bundle.js | ||||
| chunk    {0} bPage.chunk.js (bPage) 61 bytes <{1}> <{2}> <{4}> ={2}= ={3}= >{1}< [initial] [rendered] reused as split chunk (cache group: default) | ||||
|  |  | |||
|  | @ -234,7 +234,7 @@ console.log("Missing Text"); | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
| Child en: | ||||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|            Asset     Size  Chunks             Chunk Names | ||||
|  | @ -262,7 +262,7 @@ Child de: | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
| Child en: | ||||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|            Asset       Size  Chunks             Chunk Names | ||||
|  |  | |||
|  | @ -147,7 +147,7 @@ exports.foo = "bar"; | |||
| /*! no static exports found */ | ||||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| exports = module.exports = __webpack_require__(/*! ../../node_modules/css-loader/lib/css-base.js */ 3)(undefined); | ||||
| exports = module.exports = __webpack_require__(/*! ../../node_modules/css-loader/lib/css-base.js */ 3)(false); | ||||
| // imports | ||||
| 
 | ||||
| 
 | ||||
|  | @ -263,17 +263,17 @@ Prints in node.js (`enhanced-require example.js`) and in browser: | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset     Size  Chunks             Chunk Names | ||||
| output.js  6.2 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} output.js (main) 2.66 KiB [entry] [rendered] | ||||
| chunk    {0} output.js (main) 2.65 KiB [entry] [rendered] | ||||
|     > .\example.js main | ||||
|  [0] ./example.js 210 bytes {0} [built] | ||||
|      single entry .\example.js  main | ||||
|  [1] ./loader.js!./file.js 41 bytes {0} [built] | ||||
|      cjs require ./loader!./file [0] ./example.js 2:12-38 | ||||
|     [2] (webpack)/node_modules/css-loader!./test.css 209 bytes {0} [built] | ||||
|  [2] (webpack)/node_modules/css-loader!./test.css 205 bytes {0} [built] | ||||
|      cjs require !css-loader!./test.css [0] ./example.js 6:12-45 | ||||
|      cjs require ./test.css [0] ./example.js 5:12-33 | ||||
|      + 1 hidden module | ||||
|  | @ -283,13 +283,13 @@ chunk    {0} output.js (main) 2.66 KiB [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| output.js  1.52 KiB       0  [emitted]  main | ||||
| output.js  1.51 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} output.js (main) 2.66 KiB [entry] [rendered] | ||||
| chunk    {0} output.js (main) 2.65 KiB [entry] [rendered] | ||||
|     > .\example.js main | ||||
|     [0] (webpack)/node_modules/css-loader!./test.css 209 bytes {0} [built] | ||||
|  [0] (webpack)/node_modules/css-loader!./test.css 205 bytes {0} [built] | ||||
|      cjs require !css-loader!./test.css [3] ./example.js 6:12-45 | ||||
|      cjs require ./test.css [3] ./example.js 5:12-33 | ||||
|  [2] ./loader.js!./file.js 41 bytes {0} [built] | ||||
|  |  | |||
|  | @ -0,0 +1,141 @@ | |||
| # Info | ||||
| 
 | ||||
| This example illustrates webpack's algorthim for automatic deduplication using `optimization.splitChunks`. | ||||
| 
 | ||||
| This example application contains 7 pages, each of them importing 1-3 modules from the `node_modules` folder (vendor libs) and 0-3 modules from the `stuff` folder (application modules). In reallity an application is probably more complex, but the same mechanisms apply. | ||||
| 
 | ||||
| The following configuration is used: | ||||
| 
 | ||||
| * `optimization.splitChunks.chunks: "all"` - This opt-in into automatic splitting of initial chunks which is off by default | ||||
| * `optimization.splitChunks.maxInitial/AsyncRequests: 20` - This opt-in into a HTTP2 optimized splitting mode by increasing the allowed amount of requests. Browser only supports 6 requests in parallel for HTTP1.1. | ||||
| 
 | ||||
| # Interpreting the result | ||||
| 
 | ||||
| * `pageA.js` the normal output files for the entrypoint `pageA` | ||||
| * `vendors~pageD~pageE~pageF~pageG.js` vendor libs shared by these pages extracted into a separate output file when larger then the threshold in size | ||||
| * `vendors~pageA.js` vendors only used by a single page but larger than the threshold in size | ||||
| * `pageA~pageD~pageF.js` application modules shared by these pages and larger than the threshold in size | ||||
| 
 | ||||
| The threshold is here 40 bytes, but by default (in a real application) 30kb. | ||||
| 
 | ||||
| Some modules are intentially duplicated, i. e. `./stuff/s4.js` is shared by `pageA` and `pageC`, but it's the only shared module so no separate output file is created because it would be smaller than the threshold. A separate request (which comes with an overhead and worsen gzipping) is not worth the extra bytes. | ||||
| 
 | ||||
| Note: decreasing `maxInitial/AsyncRequest` will increase duplication further to reduce the number of requests. Duplication doesn't affect initial page load, it only affects download size of navigations to other pages of the application. | ||||
| 
 | ||||
| ## webpack.config.js | ||||
| 
 | ||||
| ``` | ||||
| module.exports = { | ||||
| 	// mode: "development || "production", | ||||
| 	entry: { | ||||
| 		pageA: "./pages/a", | ||||
| 		pageB: "./pages/b", | ||||
| 		pageC: "./pages/c", | ||||
| 		pageD: "./pages/d", | ||||
| 		pageE: "./pages/e", | ||||
| 		pageF: "./pages/f", | ||||
| 		pageG: "./pages/g" | ||||
| 	}, | ||||
| 	optimization: { | ||||
| 		splitChunks: { | ||||
| 			chunks: "all", | ||||
| 			maxInitialRequests: 20, // for HTTP2 | ||||
| 			maxAsyncRequests: 20, // for HTTP2 | ||||
| 			minSize: 40 // for example only: choosen to match 2 modules | ||||
| 			// omit minSize in real use case to use the default of 30kb | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
| ``` | ||||
| 
 | ||||
| ## Production mode | ||||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.8.3 | ||||
|                              Asset       Size  Chunks             Chunk Names | ||||
|                           pageG.js   1.15 KiB       7  [emitted]  pageG | ||||
| vendors~pageD~pageE~pageF~pageG.js  119 bytes       0  [emitted]  vendors~pageD~pageE~pageF~pageG | ||||
|       vendors~pageD~pageE~pageF.js  178 bytes       2  [emitted]  vendors~pageD~pageE~pageF | ||||
|       vendors~pageA~pageB~pageC.js  180 bytes       3  [emitted]  vendors~pageA~pageB~pageC | ||||
|                   vendors~pageC.js  121 bytes       4  [emitted]  vendors~pageC | ||||
|                   vendors~pageB.js  121 bytes       5  [emitted]  vendors~pageB | ||||
|                   vendors~pageA.js  121 bytes       6  [emitted]  vendors~pageA | ||||
|               pageA~pageD~pageF.js  156 bytes       1  [emitted]  pageA~pageD~pageF | ||||
|                           pageF.js   1.18 KiB       8  [emitted]  pageF | ||||
|                           pageE.js   1.17 KiB       9  [emitted]  pageE | ||||
|                           pageD.js   1.18 KiB      10  [emitted]  pageD | ||||
|                           pageC.js   1.27 KiB      11  [emitted]  pageC | ||||
|                           pageB.js   1.27 KiB      12  [emitted]  pageB | ||||
|                           pageA.js   1.18 KiB      13  [emitted]  pageA | ||||
| Entrypoint pageA = vendors~pageA~pageB~pageC.js vendors~pageA.js pageA~pageD~pageF.js pageA.js | ||||
| Entrypoint pageB = vendors~pageA~pageB~pageC.js vendors~pageB.js pageB.js | ||||
| Entrypoint pageC = vendors~pageA~pageB~pageC.js vendors~pageC.js pageC.js | ||||
| Entrypoint pageD = vendors~pageD~pageE~pageF~pageG.js vendors~pageD~pageE~pageF.js pageA~pageD~pageF.js pageD.js | ||||
| Entrypoint pageE = vendors~pageD~pageE~pageF~pageG.js vendors~pageD~pageE~pageF.js pageE.js | ||||
| Entrypoint pageF = vendors~pageD~pageE~pageF~pageG.js vendors~pageD~pageE~pageF.js pageA~pageD~pageF.js pageF.js | ||||
| Entrypoint pageG = vendors~pageD~pageE~pageF~pageG.js pageG.js | ||||
| chunk    {0} vendors~pageD~pageE~pageF~pageG.js (vendors~pageD~pageE~pageF~pageG) 43 bytes ={1}= ={10}= ={2}= ={7}= ={8}= ={9}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~pageD~pageE~pageF~pageG) | ||||
|     > ./pages/d pageD | ||||
|     > ./pages/e pageE | ||||
|     > ./pages/f pageF | ||||
|     > ./pages/g pageG | ||||
|     1 module | ||||
| chunk    {1} pageA~pageD~pageF.js (pageA~pageD~pageF) 62 bytes ={0}= ={10}= ={13}= ={2}= ={3}= ={6}= ={8}= [initial] [rendered] split chunk (cache group: default) (name: pageA~pageD~pageF) | ||||
|     > ./pages/a pageA | ||||
|     > ./pages/d pageD | ||||
|     > ./pages/f pageF | ||||
|  [6] ./stuff/s3.js 31 bytes {1} [built] | ||||
|  [7] ./stuff/s2.js 31 bytes {1} [built] | ||||
| chunk    {2} vendors~pageD~pageE~pageF.js (vendors~pageD~pageE~pageF) 86 bytes ={0}= ={1}= ={10}= ={8}= ={9}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~pageD~pageE~pageF) | ||||
|     > ./pages/d pageD | ||||
|     > ./pages/e pageE | ||||
|     > ./pages/f pageF | ||||
|     2 modules | ||||
| chunk    {3} vendors~pageA~pageB~pageC.js (vendors~pageA~pageB~pageC) 86 bytes ={1}= ={11}= ={12}= ={13}= ={4}= ={5}= ={6}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~pageA~pageB~pageC) | ||||
|     > ./pages/a pageA | ||||
|     > ./pages/b pageB | ||||
|     > ./pages/c pageC | ||||
|     2 modules | ||||
| chunk    {4} vendors~pageC.js (vendors~pageC) 43 bytes ={11}= ={3}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~pageC) | ||||
|     > ./pages/c pageC | ||||
|     1 module | ||||
| chunk    {5} vendors~pageB.js (vendors~pageB) 43 bytes ={12}= ={3}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~pageB) | ||||
|     > ./pages/b pageB | ||||
|     1 module | ||||
| chunk    {6} vendors~pageA.js (vendors~pageA) 43 bytes ={1}= ={13}= ={3}= [initial] [rendered] split chunk (cache group: vendors) (name: vendors~pageA) | ||||
|     > ./pages/a pageA | ||||
|     1 module | ||||
| chunk    {7} pageG.js (pageG) 70 bytes ={0}= [entry] [rendered] | ||||
|     > ./pages/g pageG | ||||
|   [0] ./stuff/s1.js 31 bytes {7} {8} {10} {12} [built] | ||||
|  [10] ./pages/g.js 39 bytes {7} [built] | ||||
| chunk    {8} pageF.js (pageF) 144 bytes ={0}= ={1}= ={2}= [entry] [rendered] | ||||
|     > ./pages/f pageF | ||||
|   [0] ./stuff/s1.js 31 bytes {7} {8} {10} {12} [built] | ||||
|  [11] ./pages/f.js 113 bytes {8} [built] | ||||
| chunk    {9} pageE.js (pageE) 98 bytes ={0}= ={2}= [entry] [rendered] | ||||
|     > ./pages/e pageE | ||||
|   [4] ./stuff/s7.js 31 bytes {9} {12} [built] | ||||
|  [12] ./pages/e.js 67 bytes {9} [built] | ||||
| chunk   {10} pageD.js (pageD) 144 bytes ={0}= ={1}= ={2}= [entry] [rendered] | ||||
|     > ./pages/d pageD | ||||
|   [0] ./stuff/s1.js 31 bytes {7} {8} {10} {12} [built] | ||||
|  [13] ./pages/d.js 113 bytes {10} [built] | ||||
| chunk   {11} pageC.js (pageC) 206 bytes ={3}= ={4}= [entry] [rendered] | ||||
|     > ./pages/c pageC | ||||
|   [5] ./stuff/s4.js 31 bytes {11} {13} [built] | ||||
|  [14] ./stuff/s6.js 31 bytes {11} [built] | ||||
|  [15] ./stuff/s5.js 31 bytes {11} [built] | ||||
|  [17] ./pages/c.js 113 bytes {11} [built] | ||||
| chunk   {12} pageB.js (pageB) 206 bytes ={3}= ={5}= [entry] [rendered] | ||||
|     > ./pages/b pageB | ||||
|   [0] ./stuff/s1.js 31 bytes {7} {8} {10} {12} [built] | ||||
|   [4] ./stuff/s7.js 31 bytes {9} {12} [built] | ||||
|  [18] ./stuff/s8.js 31 bytes {12} [built] | ||||
|  [20] ./pages/b.js 113 bytes {12} [built] | ||||
| chunk   {13} pageA.js (pageA) 144 bytes ={1}= ={3}= ={6}= [entry] [rendered] | ||||
|     > ./pages/a pageA | ||||
|   [5] ./stuff/s4.js 31 bytes {11} {13} [built] | ||||
|  [22] ./pages/a.js 113 bytes {13} [built] | ||||
| ``` | ||||
|  | @ -0,0 +1,3 @@ | |||
| global.NO_TARGET_ARGS = true; | ||||
| global.NO_REASONS = true; | ||||
| require("../build-common"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("a module installed from npm"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("a module installed from npm"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("a module installed from npm"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("a module installed from npm"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("a module installed from npm"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("a module installed from npm"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("a module installed from npm"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("a module installed from npm"); | ||||
|  | @ -0,0 +1,7 @@ | |||
| import "m1"; | ||||
| import "m2"; | ||||
| import "m3"; | ||||
| 
 | ||||
| import "../stuff/s2"; | ||||
| import "../stuff/s3"; | ||||
| import "../stuff/s4"; | ||||
|  | @ -0,0 +1,7 @@ | |||
| import "m1"; | ||||
| import "m2"; | ||||
| import "m4"; | ||||
| 
 | ||||
| import "../stuff/s1"; | ||||
| import "../stuff/s7"; | ||||
| import "../stuff/s8"; | ||||
|  | @ -0,0 +1,7 @@ | |||
| import "m1"; | ||||
| import "m2"; | ||||
| import "m5"; | ||||
| 
 | ||||
| import "../stuff/s4"; | ||||
| import "../stuff/s5"; | ||||
| import "../stuff/s6"; | ||||
|  | @ -0,0 +1,7 @@ | |||
| import "m6"; | ||||
| import "m7"; | ||||
| import "m8"; | ||||
| 
 | ||||
| import "../stuff/s1"; | ||||
| import "../stuff/s2"; | ||||
| import "../stuff/s3"; | ||||
|  | @ -0,0 +1,5 @@ | |||
| import "m6"; | ||||
| import "m7"; | ||||
| import "m8"; | ||||
| 
 | ||||
| import "../stuff/s7"; | ||||
|  | @ -0,0 +1,7 @@ | |||
| import "m6"; | ||||
| import "m7"; | ||||
| import "m8"; | ||||
| 
 | ||||
| import "../stuff/s1"; | ||||
| import "../stuff/s2"; | ||||
| import "../stuff/s3"; | ||||
|  | @ -0,0 +1,3 @@ | |||
| import "m6"; | ||||
| 
 | ||||
| import "../stuff/s1"; | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("some own module"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("some own module"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("some own module"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("some own module"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("some own module"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("some own module"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("some own module"); | ||||
|  | @ -0,0 +1 @@ | |||
| console.log("some own module"); | ||||
|  | @ -0,0 +1,35 @@ | |||
| # Info | ||||
| 
 | ||||
| This example illustrates webpack's algorthim for automatic deduplication using `optimization.splitChunks`. | ||||
| 
 | ||||
| This example application contains 7 pages, each of them importing 1-3 modules from the `node_modules` folder (vendor libs) and 0-3 modules from the `stuff` folder (application modules). In reallity an application is probably more complex, but the same mechanisms apply. | ||||
| 
 | ||||
| The following configuration is used: | ||||
| 
 | ||||
| * `optimization.splitChunks.chunks: "all"` - This opt-in into automatic splitting of initial chunks which is off by default | ||||
| * `optimization.splitChunks.maxInitial/AsyncRequests: 20` - This opt-in into a HTTP2 optimized splitting mode by increasing the allowed amount of requests. Browser only supports 6 requests in parallel for HTTP1.1. | ||||
| 
 | ||||
| # Interpreting the result | ||||
| 
 | ||||
| * `pageA.js` the normal output files for the entrypoint `pageA` | ||||
| * `vendors~pageD~pageE~pageF~pageG.js` vendor libs shared by these pages extracted into a separate output file when larger then the threshold in size | ||||
| * `vendors~pageA.js` vendors only used by a single page but larger than the threshold in size | ||||
| * `pageA~pageD~pageF.js` application modules shared by these pages and larger than the threshold in size | ||||
| 
 | ||||
| The threshold is here 40 bytes, but by default (in a real application) 30kb. | ||||
| 
 | ||||
| Some modules are intentially duplicated, i. e. `./stuff/s4.js` is shared by `pageA` and `pageC`, but it's the only shared module so no separate output file is created because it would be smaller than the threshold. A separate request (which comes with an overhead and worsen gzipping) is not worth the extra bytes. | ||||
| 
 | ||||
| Note: decreasing `maxInitial/AsyncRequest` will increase duplication further to reduce the number of requests. Duplication doesn't affect initial page load, it only affects download size of navigations to other pages of the application. | ||||
| 
 | ||||
| ## webpack.config.js | ||||
| 
 | ||||
| ``` | ||||
| {{webpack.config.js}} | ||||
| ``` | ||||
| 
 | ||||
| ## Production mode | ||||
| 
 | ||||
| ``` | ||||
| {{production:stdout}} | ||||
| ``` | ||||
|  | @ -0,0 +1,21 @@ | |||
| module.exports = { | ||||
| 	// mode: "development || "production",
 | ||||
| 	entry: { | ||||
| 		pageA: "./pages/a", | ||||
| 		pageB: "./pages/b", | ||||
| 		pageC: "./pages/c", | ||||
| 		pageD: "./pages/d", | ||||
| 		pageE: "./pages/e", | ||||
| 		pageF: "./pages/f", | ||||
| 		pageG: "./pages/g" | ||||
| 	}, | ||||
| 	optimization: { | ||||
| 		splitChunks: { | ||||
| 			chunks: "all", | ||||
| 			maxInitialRequests: 20, // for HTTP2
 | ||||
| 			maxAsyncRequests: 20, // for HTTP2
 | ||||
| 			minSize: 40 // for example only: choosen to match 2 modules
 | ||||
| 			// omit minSize in real use case to use the default of 30kb
 | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
|  | @ -92,12 +92,19 @@ require( | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		1: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -153,7 +160,7 @@ require( | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -350,7 +357,7 @@ function webpackContext(req) { | |||
| function webpackContextResolve(req) { | ||||
| 	var id = map[req]; | ||||
| 	if(!(id + 1)) { // check for number or string | ||||
| 		var e = new Error('Cannot find module "' + req + '".'); | ||||
| 		var e = new Error("Cannot find module '" + req + "'"); | ||||
| 		e.code = 'MODULE_NOT_FOUND'; | ||||
| 		throw e; | ||||
| 	} | ||||
|  | @ -409,10 +416,10 @@ module.exports = function() { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset      Size  Chunks             Chunk Names | ||||
| 0.output.js  1.87 KiB       0  [emitted]   | ||||
|   output.js  9.75 KiB       1  [emitted]  main | ||||
|   output.js    10 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 439 bytes <{1}> [rendered] | ||||
|     > [3] ./example.js 7:0-14:1 | ||||
|  | @ -455,10 +462,10 @@ chunk    {1} output.js (main) 1.03 KiB >{0}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  606 bytes       0  [emitted]   | ||||
|   output.js   2.04 KiB       1  [emitted]  main | ||||
|   output.js   2.06 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 439 bytes <{1}> [rendered] | ||||
|     > [3] ./example.js 7:0-14:1 | ||||
|  |  | |||
|  | @ -249,7 +249,7 @@ console.log("Running " + "mobile" + " build"); | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
| Child mobile: | ||||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|         Asset      Size  Chunks             Chunk Names | ||||
|  | @ -276,7 +276,7 @@ Child desktop: | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
| Child mobile: | ||||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|         Asset       Size  Chunks             Chunk Names | ||||
|  |  | |||
|  | @ -245,7 +245,7 @@ module.exports = "beta"; | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|              Asset      Size  Chunks             Chunk Names | ||||
| MyLibrary.alpha.js  3.16 KiB       0  [emitted]  alpha | ||||
|  MyLibrary.beta.js  3.16 KiB       1  [emitted]  beta | ||||
|  | @ -265,7 +265,7 @@ chunk    {1} MyLibrary.beta.js (beta) 24 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|              Asset       Size  Chunks             Chunk Names | ||||
|  MyLibrary.beta.js  828 bytes       0  [emitted]  beta | ||||
| MyLibrary.alpha.js  832 bytes       1  [emitted]  alpha | ||||
|  |  | |||
|  | @ -160,12 +160,19 @@ module.exports = "Common"; | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		3: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ 	var deferredModules = []; | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + ({}[chunkId]||chunkId) + ".js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -221,7 +228,7 @@ module.exports = "Common"; | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + ({}[chunkId]||chunkId) + ".js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -383,12 +390,19 @@ __webpack_require__.e(/*! AMD require */ 0).then(function() { var __WEBPACK_AMD_ | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		2: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ 	var deferredModules = []; | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + ({}[chunkId]||chunkId) + ".js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -444,7 +458,7 @@ __webpack_require__.e(/*! AMD require */ 0).then(function() { var __WEBPACK_AMD_ | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + ({}[chunkId]||chunkId) + ".js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -572,12 +586,12 @@ module.exports = function(msg) { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|      Asset       Size  Chunks             Chunk Names | ||||
|       0.js  363 bytes       0  [emitted]   | ||||
| commons.js  267 bytes       1  [emitted]  commons | ||||
|   pageB.js   8.01 KiB       2  [emitted]  pageB | ||||
|   pageA.js   8.06 KiB       3  [emitted]  pageA | ||||
|   pageB.js   8.28 KiB       2  [emitted]  pageB | ||||
|   pageA.js   8.32 KiB       3  [emitted]  pageA | ||||
| Entrypoint pageA = commons.js pageA.js | ||||
| Entrypoint pageB = commons.js pageB.js | ||||
| chunk    {0} 0.js 91 bytes <{1}> <{2}> <{3}> [rendered] | ||||
|  | @ -608,12 +622,12 @@ chunk    {3} pageA.js (pageA) 108 bytes ={1}= >{0}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|      Asset       Size  Chunks             Chunk Names | ||||
|       0.js  120 bytes       0  [emitted]   | ||||
| commons.js   95 bytes       1  [emitted]  commons | ||||
|   pageB.js   1.86 KiB       2  [emitted]  pageB | ||||
|   pageA.js   1.89 KiB       3  [emitted]  pageA | ||||
|   pageB.js   1.88 KiB       2  [emitted]  pageB | ||||
|   pageA.js   1.91 KiB       3  [emitted]  pageA | ||||
| Entrypoint pageA = commons.js pageA.js | ||||
| Entrypoint pageB = commons.js pageB.js | ||||
| chunk    {0} 0.js 91 bytes <{1}> <{2}> <{3}> [rendered] | ||||
|  |  | |||
|  | @ -62,12 +62,19 @@ require.ensure(["b"], function(require) { | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		2: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -123,7 +130,7 @@ require.ensure(["b"], function(require) { | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -326,11 +333,11 @@ __webpack_require__.e(/*! require.ensure */ 0).then((function(require) { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  463 bytes       0  [emitted]   | ||||
| 1.output.js  677 bytes       1  [emitted]  my own chunk | ||||
|   output.js   7.86 KiB       2  [emitted]  main | ||||
|   output.js   8.13 KiB       2  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 22 bytes <{2}> [rendered] | ||||
|     > [3] ./example.js 17:0-20:2 | ||||
|  | @ -351,11 +358,11 @@ chunk    {2} output.js (main) 452 bytes >{0}< >{1}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js   92 bytes       0  [emitted]   | ||||
| 1.output.js  112 bytes    1, 0  [emitted]  my own chunk | ||||
|   output.js   1.81 KiB       2  [emitted]  main | ||||
|   output.js   1.84 KiB       2  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 22 bytes <{2}> [rendered] | ||||
|     > [3] ./example.js 17:0-20:2 | ||||
|  |  | |||
|  | @ -143,7 +143,7 @@ function webpackContext(req) { | |||
| function webpackContextResolve(req) { | ||||
| 	var id = map[req]; | ||||
| 	if(!(id + 1)) { // check for number or string | ||||
| 		var e = new Error('Cannot find module "' + req + '".'); | ||||
| 		var e = new Error("Cannot find module '" + req + "'"); | ||||
| 		e.code = 'MODULE_NOT_FOUND'; | ||||
| 		throw e; | ||||
| 	} | ||||
|  | @ -202,7 +202,7 @@ module.exports = function() { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| output.js  4.48 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  | @ -227,7 +227,7 @@ chunk    {0} output.js (main) 613 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| output.js  1.16 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  |  | |||
|  | @ -146,13 +146,13 @@ module.exports = Math.random(); | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| output.js  3.26 KiB       0  [emitted]  main | ||||
| output.js  3.25 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} output.js (main) 325 bytes [entry] [rendered] | ||||
| chunk    {0} output.js (main) 313 bytes [entry] [rendered] | ||||
|     > .\example.js main | ||||
|     [0] ./example.js 294 bytes {0} [built] | ||||
|  [0] ./example.js 282 bytes {0} [built] | ||||
|      single entry .\example.js  main | ||||
|  [1] ./a.js 31 bytes {0} [built] | ||||
|      require.resolve ./a.js [0] ./example.js 4:10-35 | ||||
|  | @ -164,16 +164,16 @@ chunk    {0} output.js (main) 325 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset       Size  Chunks             Chunk Names | ||||
| output.js  667 bytes       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} output.js (main) 325 bytes [entry] [rendered] | ||||
| chunk    {0} output.js (main) 313 bytes [entry] [rendered] | ||||
|     > .\example.js main | ||||
|  [0] ./a.js 31 bytes {0} [built] | ||||
|      require.resolve ./a.js [1] ./example.js 4:10-35 | ||||
|      cjs require ./a [1] ./example.js 1:8-22 | ||||
|      cjs require ./a [1] ./example.js 10:9-23 | ||||
|     [1] ./example.js 294 bytes {0} [built] | ||||
|  [1] ./example.js 282 bytes {0} [built] | ||||
|      single entry .\example.js  main | ||||
| ``` | ||||
|  |  | |||
|  | @ -152,12 +152,19 @@ module.exports = { | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		1: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -213,7 +220,7 @@ module.exports = { | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -440,10 +447,10 @@ Minimized | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset      Size  Chunks             Chunk Names | ||||
| 0.output.js  1.87 KiB       0  [emitted]   | ||||
|   output.js   8.2 KiB       1  [emitted]  main | ||||
|   output.js  8.47 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 286 bytes <{1}> [rendered] | ||||
|     > ./lazy [] 4:0-16 | ||||
|  | @ -459,7 +466,7 @@ chunk    {1} output.js (main) 390 bytes >{0}< [entry] [rendered] | |||
|     > .\example.js main | ||||
|  [0] ./node_modules/shared.js + 1 modules 105 bytes {1} [built] | ||||
|      [exports: x, y] | ||||
|         [only some exports used: x, y] | ||||
|      [all exports used] | ||||
|      harmony side effect evaluation shared [1] ./example.js + 2 modules 3:0-23 | ||||
|      harmony export imported specifier shared [1] ./example.js + 2 modules 3:0-23 | ||||
|      harmony side effect evaluation shared [3] ./lazy.js + 2 modules 6:0-30 | ||||
|  | @ -479,10 +486,10 @@ chunk    {1} output.js (main) 390 bytes >{0}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|       Asset       Size  Chunks             Chunk Names | ||||
| 0.output.js  362 bytes       0  [emitted]   | ||||
|   output.js    1.8 KiB       1  [emitted]  main | ||||
|   output.js   1.82 KiB       1  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js 286 bytes <{1}> [rendered] | ||||
|     > ./lazy [] 4:0-16 | ||||
|  | @ -498,7 +505,7 @@ chunk    {1} output.js (main) 390 bytes >{0}< [entry] [rendered] | |||
|     > .\example.js main | ||||
|  [0] ./node_modules/shared.js + 1 modules 105 bytes {1} [built] | ||||
|      [exports: x, y] | ||||
|         [only some exports used: x, y] | ||||
|      [all exports used] | ||||
|      harmony side effect evaluation shared [1] ./example.js + 2 modules 3:0-23 | ||||
|      harmony export imported specifier shared [1] ./example.js + 2 modules 3:0-23 | ||||
|      harmony side effect evaluation shared [3] ./lazy.js + 2 modules 6:0-30 | ||||
|  |  | |||
|  | @ -298,7 +298,7 @@ const c = "c"; | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset      Size  Chunks             Chunk Names | ||||
| output.js  7.89 KiB       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  | @ -314,7 +314,7 @@ chunk    {0} output.js (main) 422 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|     Asset       Size  Chunks             Chunk Names | ||||
| output.js  600 bytes       0  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
|  |  | |||
|  | @ -239,12 +239,12 @@ eval("var math, race,\n  slice = [].slice;\n\nmath = {\n  root: Math.sqrt,\n  sq | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
| Child | ||||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|                                         Asset      Size  Chunks             Chunk Names | ||||
|             ./bundle-cheap-eval-source-map.js   1.5 KiB       0  [emitted]  bundle | ||||
|     ./runtime~bundle-cheap-eval-source-map.js  4.93 KiB       1  [emitted]  runtime~bundle | ||||
|     ./runtime~bundle-cheap-eval-source-map.js  5.06 KiB       1  [emitted]  runtime~bundle | ||||
|     Entrypoint bundle = ./runtime~bundle-cheap-eval-source-map.js ./bundle-cheap-eval-source-map.js | ||||
|     chunk    {0} ./bundle-cheap-eval-source-map.js (bundle) 308 bytes ={1}= [initial] [rendered] | ||||
|         > coffee-loader!./example.coffee bundle | ||||
|  | @ -256,7 +256,7 @@ Child | |||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|                                                Asset      Size  Chunks             Chunk Names | ||||
|             ./bundle-cheap-module-eval-source-map.js  1.36 KiB       0  [emitted]  bundle | ||||
|     ./runtime~bundle-cheap-module-eval-source-map.js  4.93 KiB       1  [emitted]  runtime~bundle | ||||
|     ./runtime~bundle-cheap-module-eval-source-map.js  5.06 KiB       1  [emitted]  runtime~bundle | ||||
|     Entrypoint bundle = ./runtime~bundle-cheap-module-eval-source-map.js ./bundle-cheap-module-eval-source-map.js | ||||
|     chunk    {0} ./bundle-cheap-module-eval-source-map.js (bundle) 308 bytes ={1}= [initial] [rendered] | ||||
|         > coffee-loader!./example.coffee bundle | ||||
|  | @ -268,9 +268,9 @@ Child | |||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|                                               Asset       Size  Chunks             Chunk Names | ||||
|                 ./bundle-cheap-module-source-map.js  733 bytes       0  [emitted]  bundle | ||||
|         ./runtime~bundle-cheap-module-source-map.js      5 KiB       1  [emitted]  runtime~bundle | ||||
|         ./runtime~bundle-cheap-module-source-map.js   5.13 KiB       1  [emitted]  runtime~bundle | ||||
|             ./bundle-cheap-module-source-map.js.map  459 bytes       0  [emitted]  bundle | ||||
|     ./runtime~bundle-cheap-module-source-map.js.map   4.91 KiB       1  [emitted]  runtime~bundle | ||||
|     ./runtime~bundle-cheap-module-source-map.js.map   5.04 KiB       1  [emitted]  runtime~bundle | ||||
|     Entrypoint bundle = ./runtime~bundle-cheap-module-source-map.js ./runtime~bundle-cheap-module-source-map.js.map ./bundle-cheap-module-source-map.js ./bundle-cheap-module-source-map.js.map | ||||
|     chunk    {0} ./bundle-cheap-module-source-map.js, ./bundle-cheap-module-source-map.js.map (bundle) 308 bytes ={1}= [initial] [rendered] | ||||
|         > coffee-loader!./example.coffee bundle | ||||
|  | @ -282,9 +282,9 @@ Child | |||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|                                        Asset       Size  Chunks             Chunk Names | ||||
|                 ./bundle-cheap-source-map.js  726 bytes       0  [emitted]  bundle | ||||
|         ./runtime~bundle-cheap-source-map.js   4.99 KiB       1  [emitted]  runtime~bundle | ||||
|         ./runtime~bundle-cheap-source-map.js   5.12 KiB       1  [emitted]  runtime~bundle | ||||
|             ./bundle-cheap-source-map.js.map  561 bytes       0  [emitted]  bundle | ||||
|     ./runtime~bundle-cheap-source-map.js.map   4.91 KiB       1  [emitted]  runtime~bundle | ||||
|     ./runtime~bundle-cheap-source-map.js.map   5.03 KiB       1  [emitted]  runtime~bundle | ||||
|     Entrypoint bundle = ./runtime~bundle-cheap-source-map.js ./runtime~bundle-cheap-source-map.js.map ./bundle-cheap-source-map.js ./bundle-cheap-source-map.js.map | ||||
|     chunk    {0} ./bundle-cheap-source-map.js, ./bundle-cheap-source-map.js.map (bundle) 308 bytes ={1}= [initial] [rendered] | ||||
|         > coffee-loader!./example.coffee bundle | ||||
|  | @ -296,7 +296,7 @@ Child | |||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|                        Asset       Size  Chunks             Chunk Names | ||||
|             ./bundle-eval.js  781 bytes       0  [emitted]  bundle | ||||
|     ./runtime~bundle-eval.js   4.93 KiB       1  [emitted]  runtime~bundle | ||||
|     ./runtime~bundle-eval.js   5.06 KiB       1  [emitted]  runtime~bundle | ||||
|     Entrypoint bundle = ./runtime~bundle-eval.js ./bundle-eval.js | ||||
|     chunk    {0} ./bundle-eval.js (bundle) 308 bytes ={1}= [initial] [rendered] | ||||
|         > coffee-loader!./example.coffee bundle | ||||
|  | @ -308,7 +308,7 @@ Child | |||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|                                   Asset      Size  Chunks             Chunk Names | ||||
|             ./bundle-eval-source-map.js  1.49 KiB       0  [emitted]  bundle | ||||
|     ./runtime~bundle-eval-source-map.js  4.93 KiB       1  [emitted]  runtime~bundle | ||||
|     ./runtime~bundle-eval-source-map.js  5.06 KiB       1  [emitted]  runtime~bundle | ||||
|     Entrypoint bundle = ./runtime~bundle-eval-source-map.js ./bundle-eval-source-map.js | ||||
|     chunk    {0} ./bundle-eval-source-map.js (bundle) 308 bytes ={1}= [initial] [rendered] | ||||
|         > coffee-loader!./example.coffee bundle | ||||
|  | @ -320,9 +320,9 @@ Child | |||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|                                         Asset       Size  Chunks             Chunk Names | ||||
|                 ./bundle-hidden-source-map.js  674 bytes       0  [emitted]  bundle | ||||
|         ./runtime~bundle-hidden-source-map.js   4.93 KiB       1  [emitted]  runtime~bundle | ||||
|         ./runtime~bundle-hidden-source-map.js   5.06 KiB       1  [emitted]  runtime~bundle | ||||
|             ./bundle-hidden-source-map.js.map  556 bytes       0  [emitted]  bundle | ||||
|     ./runtime~bundle-hidden-source-map.js.map   4.95 KiB       1  [emitted]  runtime~bundle | ||||
|     ./runtime~bundle-hidden-source-map.js.map   5.08 KiB       1  [emitted]  runtime~bundle | ||||
|     Entrypoint bundle = ./runtime~bundle-hidden-source-map.js ./runtime~bundle-hidden-source-map.js.map ./bundle-hidden-source-map.js ./bundle-hidden-source-map.js.map | ||||
|     chunk    {0} ./bundle-hidden-source-map.js, ./bundle-hidden-source-map.js.map (bundle) 308 bytes ={1}= [initial] [rendered] | ||||
|         > coffee-loader!./example.coffee bundle | ||||
|  | @ -334,7 +334,7 @@ Child | |||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|                                     Asset      Size  Chunks             Chunk Names | ||||
|             ./bundle-inline-source-map.js  1.45 KiB       0  [emitted]  bundle | ||||
|     ./runtime~bundle-inline-source-map.js  11.6 KiB       1  [emitted]  runtime~bundle | ||||
|     ./runtime~bundle-inline-source-map.js  11.9 KiB       1  [emitted]  runtime~bundle | ||||
|     Entrypoint bundle = ./runtime~bundle-inline-source-map.js ./bundle-inline-source-map.js | ||||
|     chunk    {0} ./bundle-inline-source-map.js (bundle) 308 bytes ={1}= [initial] [rendered] | ||||
|         > coffee-loader!./example.coffee bundle | ||||
|  | @ -346,9 +346,9 @@ Child | |||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|                                            Asset       Size  Chunks             Chunk Names | ||||
|                 ./bundle-nosources-source-map.js  730 bytes       0  [emitted]  bundle | ||||
|         ./runtime~bundle-nosources-source-map.js   4.99 KiB       1  [emitted]  runtime~bundle | ||||
|         ./runtime~bundle-nosources-source-map.js   5.12 KiB       1  [emitted]  runtime~bundle | ||||
|             ./bundle-nosources-source-map.js.map  314 bytes       0  [emitted]  bundle | ||||
|     ./runtime~bundle-nosources-source-map.js.map  838 bytes       1  [emitted]  runtime~bundle | ||||
|     ./runtime~bundle-nosources-source-map.js.map  848 bytes       1  [emitted]  runtime~bundle | ||||
|     Entrypoint bundle = ./runtime~bundle-nosources-source-map.js ./runtime~bundle-nosources-source-map.js.map ./bundle-nosources-source-map.js ./bundle-nosources-source-map.js.map | ||||
|     chunk    {0} ./bundle-nosources-source-map.js, ./bundle-nosources-source-map.js.map (bundle) 308 bytes ={1}= [initial] [rendered] | ||||
|         > coffee-loader!./example.coffee bundle | ||||
|  | @ -360,9 +360,9 @@ Child | |||
|     Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
|                                  Asset       Size  Chunks             Chunk Names | ||||
|                 ./bundle-source-map.js  720 bytes       0  [emitted]  bundle | ||||
|         ./runtime~bundle-source-map.js   4.98 KiB       1  [emitted]  runtime~bundle | ||||
|         ./runtime~bundle-source-map.js   5.11 KiB       1  [emitted]  runtime~bundle | ||||
|             ./bundle-source-map.js.map  549 bytes       0  [emitted]  bundle | ||||
|     ./runtime~bundle-source-map.js.map   4.95 KiB       1  [emitted]  runtime~bundle | ||||
|     ./runtime~bundle-source-map.js.map   5.07 KiB       1  [emitted]  runtime~bundle | ||||
|     Entrypoint bundle = ./runtime~bundle-source-map.js ./runtime~bundle-source-map.js.map ./bundle-source-map.js ./bundle-source-map.js.map | ||||
|     chunk    {0} ./bundle-source-map.js, ./bundle-source-map.js.map (bundle) 308 bytes ={1}= [initial] [rendered] | ||||
|         > coffee-loader!./example.coffee bundle | ||||
|  |  | |||
|  | @ -373,7 +373,7 @@ __webpack_require__(/*! ./vendor2 */ 3); | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|      Asset      Size  Chunks             Chunk Names | ||||
| vendor1.js  2.99 KiB       0  [emitted]  vendor1 | ||||
| vendor2.js  3.25 KiB       1  [emitted]  vendor2 | ||||
|  | @ -429,7 +429,7 @@ chunk    {4} pageC.js (pageC) 25 bytes [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|      Asset       Size  Chunks             Chunk Names | ||||
|   pageC.js  569 bytes       0  [emitted]  pageC | ||||
|   pageB.js  569 bytes       1  [emitted]  pageB | ||||
|  |  | |||
|  | @ -91,15 +91,45 @@ export function fibonacciJavascript(i) { | |||
| /******/ 	var installedModules = {}; | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading chunks | ||||
| /******/ 	// undefined = chunk not loaded, null = chunk preloaded/prefetched | ||||
| /******/ 	// Promise = chunk loading, 0 = chunk loaded | ||||
| /******/ 	var installedChunks = { | ||||
| /******/ 		2: 0 | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ | ||||
| /******/ 	// script path function | ||||
| /******/ 	function jsonpScriptSrc(chunkId) { | ||||
| /******/ 		return __webpack_require__.p + "" + chunkId + ".output.js" | ||||
| /******/ 	} | ||||
| /******/ | ||||
| /******/ 	// object to store loaded and loading wasm modules | ||||
| /******/ 	var installedWasmModules = {}; | ||||
| /******/ | ||||
| /******/ 	var wasmImportObjects = { | ||||
| /******/ 		1: function() { | ||||
| /******/ 			return { | ||||
| /******/ | ||||
| /******/ 			}; | ||||
| /******/ 		}, | ||||
| /******/ 		3: function() { | ||||
| /******/ 			return { | ||||
| /******/ | ||||
| /******/ 			}; | ||||
| /******/ 		}, | ||||
| /******/ 		4: function() { | ||||
| /******/ 			return { | ||||
| /******/ | ||||
| /******/ 			}; | ||||
| /******/ 		}, | ||||
| /******/ 		1: function() { | ||||
| /******/ 			return { | ||||
| /******/ | ||||
| /******/ 			}; | ||||
| /******/ 		}, | ||||
| /******/ 	}; | ||||
| /******/ | ||||
| /******/ 	// The require function | ||||
| /******/ 	function __webpack_require__(moduleId) { | ||||
| /******/ | ||||
|  | @ -155,7 +185,7 @@ export function fibonacciJavascript(i) { | |||
| /******/ 				if (__webpack_require__.nc) { | ||||
| /******/ 					script.setAttribute("nonce", __webpack_require__.nc); | ||||
| /******/ 				} | ||||
| /******/ 				script.src = __webpack_require__.p + "" + chunkId + ".output.js"; | ||||
| /******/ 				script.src = jsonpScriptSrc(chunkId); | ||||
| /******/ 				var timeout = setTimeout(function(){ | ||||
| /******/ 					onScriptComplete({ type: 'timeout', target: script }); | ||||
| /******/ 				}, 120000); | ||||
|  | @ -189,15 +219,28 @@ export function fibonacciJavascript(i) { | |||
| /******/ 			var installedWasmModuleData = installedWasmModules[wasmModuleId]; | ||||
| /******/ | ||||
| /******/ 			// a Promise means "currently loading" or "already loaded". | ||||
| /******/ 			promises.push(installedWasmModuleData || | ||||
| /******/ 				(installedWasmModules[wasmModuleId] = fetch(__webpack_require__.p + "" + {"1":"10451bbb346a73db7ba4","3":"beb1e34c200b5c9a59c2","4":"c5fc17f4396c56397ea0"}[wasmModuleId] + ".wasm").then(function(response) { | ||||
| /******/ 					if(WebAssembly.compileStreaming) { | ||||
| /******/ 						return WebAssembly.compileStreaming(response); | ||||
| /******/ 			if(installedWasmModuleData) | ||||
| /******/ 				promises.push(installedWasmModuleData); | ||||
| /******/ 			else { | ||||
| /******/ 				var importObject = wasmImportObjects[wasmModuleId](); | ||||
| /******/ 				var req = fetch(__webpack_require__.p + "" + {"1":"30aba380c690e17b4bf0","3":"061d333ce184178519f1","4":"8ac55ff8d1119fe3b24f"}[wasmModuleId] + ".wasm"); | ||||
| /******/ 				var promise; | ||||
| /******/ 				if(importObject instanceof Promise && typeof WebAssembly.compileStreaming === 'function') { | ||||
| /******/ 					promise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) { | ||||
| /******/ 						return WebAssembly.instantiate(items[0], items[1]); | ||||
| /******/ 					}); | ||||
| /******/ 				} else if(typeof WebAssembly.instantiateStreaming === 'function') { | ||||
| /******/ 					promise = WebAssembly.instantiateStreaming(req, importObject); | ||||
| /******/ 				} else { | ||||
| /******/ 						return response.arrayBuffer().then(function(bytes) { return WebAssembly.compile(bytes); }); | ||||
| /******/ 					var bytesPromise = req.then(function(x) { return x.arrayBuffer(); }); | ||||
| /******/ 					promise = bytesPromise.then(function(bytes) { | ||||
| /******/ 						return WebAssembly.instantiate(bytes, importObject); | ||||
| /******/ 					}); | ||||
| /******/ 				} | ||||
| /******/ 				promises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) { | ||||
| /******/ 					return __webpack_require__.w[wasmModuleId] = res.instance || res; | ||||
| /******/ 				})); | ||||
| /******/ 			} | ||||
| /******/ 				}).then(function(module) { __webpack_require__.w[wasmModuleId] = module; })) | ||||
| /******/ 			); | ||||
| /******/ 		}); | ||||
| /******/ 		return Promise.all(promises); | ||||
| /******/ 	}; | ||||
|  | @ -242,7 +285,7 @@ export function fibonacciJavascript(i) { | |||
| /******/ 	// on error function for async loading | ||||
| /******/ 	__webpack_require__.oe = function(err) { console.error(err); throw err; }; | ||||
| /******/ | ||||
| /******/ 	// object with all compiled WebAssembly.Modules | ||||
| /******/ 	// object with all WebAssembly.instance | ||||
| /******/ 	__webpack_require__.w = {}; | ||||
| /******/ | ||||
| /******/ 	var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; | ||||
|  | @ -315,13 +358,14 @@ function timed(name, fn) { | |||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
| // Instantiate WebAssembly module | ||||
| var instance = new WebAssembly.Instance(__webpack_require__.w[module.i], { | ||||
| }); | ||||
| 
 | ||||
| var instance = __webpack_require__.w[module.i]; | ||||
| // export exports from WebAssembly module | ||||
| module.exports = instance.exports; | ||||
| // exec imports from WebAssembly module (for esm order) | ||||
| 
 | ||||
| // exec wasm module | ||||
| instance.exports.__webpack_init__() | ||||
| 
 | ||||
| /***/ }), | ||||
| /* 2 */ | ||||
|  | @ -370,13 +414,14 @@ function fibonacciJavascript(i) { | |||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
| // Instantiate WebAssembly module | ||||
| var instance = new WebAssembly.Instance(__webpack_require__.w[module.i], { | ||||
| }); | ||||
| 
 | ||||
| var instance = __webpack_require__.w[module.i]; | ||||
| // export exports from WebAssembly module | ||||
| module.exports = instance.exports; | ||||
| // exec imports from WebAssembly module (for esm order) | ||||
| 
 | ||||
| // exec wasm module | ||||
| instance.exports.__webpack_init__() | ||||
| 
 | ||||
| /***/ }), | ||||
| /* 4 */ | ||||
|  | @ -387,13 +432,14 @@ module.exports = instance.exports; | |||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
| // Instantiate WebAssembly module | ||||
| var instance = new WebAssembly.Instance(__webpack_require__.w[module.i], { | ||||
| }); | ||||
| 
 | ||||
| var instance = __webpack_require__.w[module.i]; | ||||
| // export exports from WebAssembly module | ||||
| module.exports = instance.exports; | ||||
| // exec imports from WebAssembly module (for esm order) | ||||
| 
 | ||||
| // exec wasm module | ||||
| instance.exports.__webpack_init__() | ||||
| 
 | ||||
| /***/ }) | ||||
| ]]); | ||||
|  | @ -412,13 +458,14 @@ module.exports = instance.exports; | |||
| /***/ (function(module, exports, __webpack_require__) { | ||||
| 
 | ||||
| "use strict"; | ||||
| 
 | ||||
| // Instantiate WebAssembly module | ||||
| var instance = new WebAssembly.Instance(__webpack_require__.w[module.i], { | ||||
| }); | ||||
| 
 | ||||
| var instance = __webpack_require__.w[module.i]; | ||||
| // export exports from WebAssembly module | ||||
| module.exports = instance.exports; | ||||
| // exec imports from WebAssembly module (for esm order) | ||||
| 
 | ||||
| // exec wasm module | ||||
| instance.exports.__webpack_init__() | ||||
| 
 | ||||
| /***/ }) | ||||
| ]]); | ||||
|  | @ -430,16 +477,16 @@ module.exports = instance.exports; | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|                     Asset          Size  Chunks             Chunk Names | ||||
|               0.output.js   2.86 KiB       0  [emitted]   | ||||
| 10451bbb346a73db7ba4.wasm   41 bytes    0, 1  [emitted]   | ||||
| beb1e34c200b5c9a59c2.wasm   67 bytes       0  [emitted]   | ||||
| c5fc17f4396c56397ea0.wasm   62 bytes       0  [emitted]   | ||||
|               1.output.js  462 bytes       1  [emitted]   | ||||
|                 output.js   8.88 KiB       2  [emitted]  main | ||||
|               0.output.js       3.1 KiB       0  [emitted]   | ||||
| 30aba380c690e17b4bf0.wasm  unknown size    0, 1  [emitted]   | ||||
| 061d333ce184178519f1.wasm  unknown size       0  [emitted]   | ||||
| 8ac55ff8d1119fe3b24f.wasm  unknown size       0  [emitted]   | ||||
|               1.output.js     542 bytes       1  [emitted]   | ||||
|                 output.js      10.2 KiB       2  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js, 10451bbb346a73db7ba4.wasm, beb1e34c200b5c9a59c2.wasm, c5fc17f4396c56397ea0.wasm 570 bytes <{2}> [rendered] | ||||
| chunk    {0} 0.output.js, 30aba380c690e17b4bf0.wasm, 061d333ce184178519f1.wasm, 8ac55ff8d1119fe3b24f.wasm 570 bytes <{2}> [rendered] | ||||
|     > ./math [0] ./example.js 3:1-17 | ||||
|  [1] ./add.wasm 41 bytes {0} {1} [built] | ||||
|      [exports: add] | ||||
|  | @ -457,7 +504,7 @@ chunk    {0} 0.output.js, 10451bbb346a73db7ba4.wasm, beb1e34c200b5c9a59c2.wasm, | |||
|      [exports: factorial] | ||||
|      harmony side effect evaluation ./factorial.wasm [2] ./math.js 2:0-45 | ||||
|      harmony export imported specifier ./factorial.wasm [2] ./math.js 5:0-37 | ||||
| chunk    {1} 1.output.js, 10451bbb346a73db7ba4.wasm 41 bytes <{2}> [rendered] | ||||
| chunk    {1} 1.output.js, 30aba380c690e17b4bf0.wasm 41 bytes <{2}> [rendered] | ||||
|     > ./add.wasm [0] ./example.js 1:0-20 | ||||
|  [1] ./add.wasm 41 bytes {0} {1} [built] | ||||
|      [exports: add] | ||||
|  | @ -474,16 +521,16 @@ chunk    {2} output.js (main) 762 bytes >{0}< >{1}< [entry] [rendered] | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|                     Asset          Size   Chunks             Chunk Names | ||||
|               0.output.js     722 bytes     0, 1  [emitted]   | ||||
| eb1f6af9b64293fb7fc2.wasm   41 bytes  0, 1, 1  [emitted]   | ||||
| b7c936b08f2cdab3e74d.wasm   67 bytes     0, 1  [emitted]   | ||||
| d24ec18257dff3c36d2f.wasm   62 bytes     0, 1  [emitted]   | ||||
| 9e0b33732e07ce9eacd3.wasm  unknown size  0, 1, 1  [emitted]   | ||||
| 52a9b4a4020ad3ef6f0b.wasm  unknown size     0, 1  [emitted]   | ||||
| 68db91566fc0884f2a9b.wasm  unknown size     0, 1  [emitted]   | ||||
|               1.output.js     155 bytes        1  [emitted]   | ||||
|                 output.js   2.52 KiB        2  [emitted]  main | ||||
|                 output.js      2.92 KiB        2  [emitted]  main | ||||
| Entrypoint main = output.js | ||||
| chunk    {0} 0.output.js, eb1f6af9b64293fb7fc2.wasm, b7c936b08f2cdab3e74d.wasm, d24ec18257dff3c36d2f.wasm 570 bytes <{2}> [rendered] | ||||
| chunk    {0} 0.output.js, 9e0b33732e07ce9eacd3.wasm, 52a9b4a4020ad3ef6f0b.wasm, 68db91566fc0884f2a9b.wasm 570 bytes <{2}> [rendered] | ||||
|     > ./math [0] ./example.js 3:1-17 | ||||
|  [1] ./add.wasm 41 bytes {0} {1} [built] | ||||
|      [exports: add] | ||||
|  | @ -495,15 +542,15 @@ chunk    {0} 0.output.js, eb1f6af9b64293fb7fc2.wasm, b7c936b08f2cdab3e74d.wasm, | |||
|      import() ./math [0] ./example.js 3:1-17 | ||||
|  [3] ./fibonacci.wasm 67 bytes {0} [built] | ||||
|      [exports: fibonacci] | ||||
|         [only some exports used: fibonacci] | ||||
|      [all exports used] | ||||
|      harmony side effect evaluation ./fibonacci.wasm [2] ./math.js 3:0-45 | ||||
|      harmony export imported specifier ./fibonacci.wasm [2] ./math.js 5:0-37 | ||||
|  [4] ./factorial.wasm 62 bytes {0} [built] | ||||
|      [exports: factorial] | ||||
|         [only some exports used: factorial] | ||||
|      [all exports used] | ||||
|      harmony side effect evaluation ./factorial.wasm [2] ./math.js 2:0-45 | ||||
|      harmony export imported specifier ./factorial.wasm [2] ./math.js 5:0-37 | ||||
| chunk    {1} 1.output.js, eb1f6af9b64293fb7fc2.wasm 41 bytes <{2}> [rendered] | ||||
| chunk    {1} 1.output.js, 9e0b33732e07ce9eacd3.wasm 41 bytes <{2}> [rendered] | ||||
|     > ./add.wasm [0] ./example.js 1:0-20 | ||||
|  [1] ./add.wasm 41 bytes {0} {1} [built] | ||||
|      [exports: add] | ||||
|  |  | |||
|  | @ -284,7 +284,7 @@ function webpackContext(req) { | |||
| function webpackContextResolve(req) { | ||||
| 	var id = map[req]; | ||||
| 	if(!(id + 1)) { // check for number or string | ||||
| 		var e = new Error('Cannot find module "' + req + '".'); | ||||
| 		var e = new Error("Cannot find module '" + req + "'"); | ||||
| 		e.code = 'MODULE_NOT_FOUND'; | ||||
| 		throw e; | ||||
| 	} | ||||
|  | @ -343,7 +343,7 @@ module.exports = function() { | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|            Asset      Size  Chunks             Chunk Names | ||||
| 0.hash.worker.js  1.82 KiB          [emitted]   | ||||
|   hash.worker.js  4.02 KiB          [emitted]   | ||||
|  | @ -383,7 +383,7 @@ Child worker: | |||
| 
 | ||||
| ``` | ||||
| Hash: 0a1b2c3d4e5f6a7b8c9d | ||||
| Version: webpack 4.5.0 | ||||
| Version: webpack 4.8.0 | ||||
|            Asset       Size  Chunks             Chunk Names | ||||
| 0.hash.worker.js  594 bytes          [emitted]   | ||||
|   hash.worker.js  919 bytes          [emitted]   | ||||
|  |  | |||
|  | @ -22,21 +22,33 @@ const wrapComment = str => { | |||
| 
 | ||||
| class BannerPlugin { | ||||
| 	constructor(options) { | ||||
| 		if (arguments.length > 1) | ||||
| 		if (arguments.length > 1) { | ||||
| 			throw new Error( | ||||
| 				"BannerPlugin only takes one argument (pass an options object)" | ||||
| 			); | ||||
| 		} | ||||
| 
 | ||||
| 		validateOptions(schema, options, "Banner Plugin"); | ||||
| 
 | ||||
| 		if (typeof options === "string") | ||||
| 		if (typeof options === "string" || typeof options === "function") { | ||||
| 			options = { | ||||
| 				banner: options | ||||
| 			}; | ||||
| 		} | ||||
| 
 | ||||
| 		this.options = options || {}; | ||||
| 
 | ||||
| 		if (typeof options.banner === "function") { | ||||
| 			const getBanner = this.options.banner; | ||||
| 			this.banner = this.options.raw | ||||
| 			? options.banner | ||||
| 			: wrapComment(options.banner); | ||||
| 				? getBanner | ||||
| 				: data => wrapComment(getBanner(data)); | ||||
| 		} else { | ||||
| 			const banner = this.options.raw | ||||
| 				? this.options.banner | ||||
| 				: wrapComment(this.options.banner); | ||||
| 			this.banner = () => banner; | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	apply(compiler) { | ||||
|  | @ -78,13 +90,15 @@ class BannerPlugin { | |||
| 							basename = filename.substr(lastSlashIndex + 1); | ||||
| 						} | ||||
| 
 | ||||
| 						const comment = compilation.getPath(banner, { | ||||
| 						const data = { | ||||
| 							hash, | ||||
| 							chunk, | ||||
| 							filename, | ||||
| 							basename, | ||||
| 							query | ||||
| 						}); | ||||
| 						}; | ||||
| 
 | ||||
| 						const comment = compilation.getPath(banner(data), data); | ||||
| 
 | ||||
| 						compilation.assets[file] = new ConcatSource( | ||||
| 							comment, | ||||
|  |  | |||
							
								
								
									
										193
									
								
								lib/Chunk.js
								
								
								
								
							
							
						
						
									
										193
									
								
								lib/Chunk.js
								
								
								
								
							|  | @ -13,18 +13,52 @@ const ERR_CHUNK_ENTRY = "Chunk.entry was removed. Use hasRuntime()"; | |||
| const ERR_CHUNK_INITIAL = | ||||
| 	"Chunk.initial was removed. Use canBeInitial/isOnlyInitial()"; | ||||
| 
 | ||||
| /** @typedef {import("./Module.js")} Module */ | ||||
| /** @typedef {import("./ChunkGroup")} ChunkGroup */ | ||||
| /** @typedef {import("./ModuleReason.js")} ModuleReason */ | ||||
| /** @typedef {import("webpack-sources").Source} Source */ | ||||
| 
 | ||||
| /** | ||||
|  *  @typedef {Object} Identifiable an object who contains an identifier function property | ||||
|  *  @property {() => string} identifier the resource or unique identifier of something | ||||
|  */ | ||||
| 
 | ||||
| /** | ||||
|  *  @typedef {Object} WithId an object who has an id property | ||||
|  *  @property {string} id the id of the object | ||||
|  */ | ||||
| 
 | ||||
| /** @typedef {(a: Module, b: Module) => -1|0|1} ModuleSortPredicate */ | ||||
| /** @typedef {(m: Module) => boolean} ModuleFilterPredicate */ | ||||
| /** @typedef {(c: Chunk) => boolean} ChunkFilterPredicate */ | ||||
| 
 | ||||
| /** | ||||
|  * @param {WithId} a object that contains an ID property | ||||
|  * @param {WithId} b object that contains an ID property | ||||
|  * @returns {-1|0|1} sort value | ||||
|  */ | ||||
| const sortById = (a, b) => { | ||||
| 	if (a.id < b.id) return -1; | ||||
| 	if (b.id < a.id) return 1; | ||||
| 	return 0; | ||||
| }; | ||||
| 
 | ||||
| /** | ||||
|  * | ||||
|  * @param {Identifiable} a first object with ident fn | ||||
|  * @param {Identifiable} b second object with ident fn | ||||
|  * @returns {-1|0|1} The order number of the sort | ||||
|  */ | ||||
| const sortByIdentifier = (a, b) => { | ||||
| 	if (a.identifier() > b.identifier()) return 1; | ||||
| 	if (a.identifier() < b.identifier()) return -1; | ||||
| 	return 0; | ||||
| }; | ||||
| 
 | ||||
| /** | ||||
|  * @returns {string} a concatenation of module identifiers sorted | ||||
|  * @param {SortableSet} set to pull module identifiers from | ||||
|  */ | ||||
| const getModulesIdent = set => { | ||||
| 	set.sort(); | ||||
| 	let str = ""; | ||||
|  | @ -34,50 +68,106 @@ const getModulesIdent = set => { | |||
| 	return str; | ||||
| }; | ||||
| 
 | ||||
| /** | ||||
|  * @template {T} | ||||
|  * @param {Set<T>} set the set to convert to array | ||||
|  * @returns {Array<T>} the array returned from Array.from(set) | ||||
|  */ | ||||
| const getArray = set => Array.from(set); | ||||
| 
 | ||||
| /** | ||||
|  * @param {Set<Module>} set the Set to get the count/size of | ||||
|  * @returns {number} the size of the modules | ||||
|  */ | ||||
| const getModulesSize = set => { | ||||
| 	let count = 0; | ||||
| 	let size = 0; | ||||
| 	for (const module of set) { | ||||
| 		count += module.size(); | ||||
| 		size += module.size(); | ||||
| 	} | ||||
| 	return count; | ||||
| 	return size; | ||||
| }; | ||||
| 
 | ||||
| /** | ||||
|  * A Chunk is a unit of encapsulation for Modules. | ||||
|  * Chunks are "rendered" into bundles that get emitted when the build completes. | ||||
|  */ | ||||
| class Chunk { | ||||
| 	/** | ||||
| 	 * @param {string=} name of chunk being created, is optional (for subclasses) | ||||
| 	 */ | ||||
| 	constructor(name) { | ||||
| 		/** @type {number | null} */ | ||||
| 		this.id = null; | ||||
| 		/** @type {number[] | null} */ | ||||
| 		this.ids = null; | ||||
| 		/** @type {number} */ | ||||
| 		this.debugId = debugId++; | ||||
| 		/** @type {string} */ | ||||
| 		this.name = name; | ||||
| 		/** @type {boolean} */ | ||||
| 		this.preventIntegration = false; | ||||
| 		/** @type {Module=} */ | ||||
| 		this.entryModule = undefined; | ||||
| 		//TODO make these typed generics for Module[] and ChunkGroup[] and their sort being (T, T): => 1,-1,0
 | ||||
| 		//See https://github.com/webpack/webpack/pull/7046
 | ||||
| 		/** @private */ | ||||
| 		this._modules = new SortableSet(undefined, sortByIdentifier); | ||||
| 		/** @private */ | ||||
| 		this._groups = new SortableSet(undefined, sortById); | ||||
| 		/** @type {Source[]} */ | ||||
| 		this.files = []; | ||||
| 		/** @type {boolean} */ | ||||
| 		this.rendered = false; | ||||
| 		/** @type {string=} */ | ||||
| 		this.hash = undefined; | ||||
| 		/** @type {Object} */ | ||||
| 		this.contentHash = Object.create(null); | ||||
| 		/** @type {string=} */ | ||||
| 		this.renderedHash = undefined; | ||||
| 		/** @type {string=} */ | ||||
| 		this.chunkReason = undefined; | ||||
| 		/** @type {boolean} */ | ||||
| 		this.extraAsync = false; | ||||
| 		this.removedModules = undefined; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @deprecated Chunk.entry has been deprecated. Please use .hasRuntime() instead | ||||
| 	 * @returns {never} Throws an error trying to access this property | ||||
| 	 */ | ||||
| 	get entry() { | ||||
| 		throw new Error(ERR_CHUNK_ENTRY); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @deprecated .entry has been deprecated. Please use .hasRuntime() instead | ||||
| 	 * @param {never} data The data that was attempting to be set | ||||
| 	 * @returns {never} Throws an error trying to access this property | ||||
| 	 */ | ||||
| 	set entry(data) { | ||||
| 		throw new Error(ERR_CHUNK_ENTRY); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @deprecated Chunk.initial was removed. Use canBeInitial/isOnlyInitial() | ||||
| 	 * @returns {never} Throws an error trying to access this property | ||||
| 	 */ | ||||
| 	get initial() { | ||||
| 		throw new Error(ERR_CHUNK_INITIAL); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @deprecated Chunk.initial was removed. Use canBeInitial/isOnlyInitial() | ||||
| 	 * @param {never} data The data attempting to be set | ||||
| 	 * @returns {never} Throws an error trying to access this property | ||||
| 	 */ | ||||
| 	set initial(data) { | ||||
| 		throw new Error(ERR_CHUNK_INITIAL); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @returns {boolean} whether or not the Chunk will have a runtime | ||||
| 	 */ | ||||
| 	hasRuntime() { | ||||
| 		for (const chunkGroup of this._groups) { | ||||
| 			// We only need to check the first one
 | ||||
|  | @ -86,6 +176,9 @@ class Chunk { | |||
| 		return false; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @returns {boolean} whether or not this chunk can be an initial chunk | ||||
| 	 */ | ||||
| 	canBeInitial() { | ||||
| 		for (const chunkGroup of this._groups) { | ||||
| 			if (chunkGroup.isInitial()) return true; | ||||
|  | @ -93,6 +186,9 @@ class Chunk { | |||
| 		return false; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @returns {boolean} whether this chunk can only be an initial chunk | ||||
| 	 */ | ||||
| 	isOnlyInitial() { | ||||
| 		if (this._groups.size <= 0) return false; | ||||
| 		for (const chunkGroup of this._groups) { | ||||
|  | @ -101,10 +197,17 @@ class Chunk { | |||
| 		return true; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @returns {boolean} if this chunk contains the entry module | ||||
| 	 */ | ||||
| 	hasEntryModule() { | ||||
| 		return !!this.entryModule; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {Module} module the module that will be added to this chunk. | ||||
| 	 * @returns {boolean} returns true if the chunk doesn't have the module and it was added | ||||
| 	 */ | ||||
| 	addModule(module) { | ||||
| 		if (!this._modules.has(module)) { | ||||
| 			this._modules.add(module); | ||||
|  | @ -113,6 +216,10 @@ class Chunk { | |||
| 		return false; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {Module} module the module that will be removed from this chunk | ||||
| 	 * @returns {boolean} returns true if chunk exists and is successfully deleted | ||||
| 	 */ | ||||
| 	removeModule(module) { | ||||
| 		if (this._modules.delete(module)) { | ||||
| 			module.removeChunk(this); | ||||
|  | @ -121,42 +228,74 @@ class Chunk { | |||
| 		return false; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {Module[]} modules the new modules to be set | ||||
| 	 * @returns {void} set new modules to this chunk and return nothing | ||||
| 	 */ | ||||
| 	setModules(modules) { | ||||
| 		this._modules = new SortableSet(modules, sortByIdentifier); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @returns {number} the amount of modules in chunk | ||||
| 	 */ | ||||
| 	getNumberOfModules() { | ||||
| 		return this._modules.size; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @returns {SortableSet} return the modules SortableSet for this chunk | ||||
| 	 */ | ||||
| 	get modulesIterable() { | ||||
| 		return this._modules; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {ChunkGroup} chunkGroup the chunkGroup the chunk is being added | ||||
| 	 * @returns {boolean} returns true if chunk is not apart of chunkGroup and is added successfully | ||||
| 	 */ | ||||
| 	addGroup(chunkGroup) { | ||||
| 		if (this._groups.has(chunkGroup)) return false; | ||||
| 		this._groups.add(chunkGroup); | ||||
| 		return true; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {ChunkGroup} chunkGroup the chunkGroup the chunk is being removed from | ||||
| 	 * @returns {boolean} returns true if chunk does exist in chunkGroup and is removed | ||||
| 	 */ | ||||
| 	removeGroup(chunkGroup) { | ||||
| 		if (!this._groups.has(chunkGroup)) return false; | ||||
| 		this._groups.delete(chunkGroup); | ||||
| 		return true; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {ChunkGroup} chunkGroup the chunkGroup to check | ||||
| 	 * @returns {boolean} returns true if chunk has chunkGroup reference and exists in chunkGroup | ||||
| 	 */ | ||||
| 	isInGroup(chunkGroup) { | ||||
| 		return this._groups.has(chunkGroup); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @returns {number} the amount of groups said chunk is in | ||||
| 	 */ | ||||
| 	getNumberOfGroups() { | ||||
| 		return this._groups.size; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @returns {SortableSet} the chunkGroups that said chunk is referenced in | ||||
| 	 */ | ||||
| 	get groupsIterable() { | ||||
| 		return this._groups; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {Chunk} otherChunk the chunk to compare itself with | ||||
| 	 * @returns {-1|0|1} this is a comparitor function like sort and returns -1, 0, or 1 based on sort order | ||||
| 	 */ | ||||
| 	compareTo(otherChunk) { | ||||
| 		this._modules.sort(); | ||||
| 		otherChunk._modules.sort(); | ||||
|  | @ -176,6 +315,10 @@ class Chunk { | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {Module} module Module to check | ||||
| 	 * @returns {boolean} returns true if module does exist in this chunk | ||||
| 	 */ | ||||
| 	containsModule(module) { | ||||
| 		return this._modules.has(module); | ||||
| 	} | ||||
|  | @ -188,7 +331,7 @@ class Chunk { | |||
| 		return this._modules.getFromUnorderedCache(getModulesIdent); | ||||
| 	} | ||||
| 
 | ||||
| 	remove(reason) { | ||||
| 	remove() { | ||||
| 		// cleanup modules
 | ||||
| 		// Array.from is used here to create a clone, because removeChunk modifies this._modules
 | ||||
| 		for (const module of Array.from(this._modules)) { | ||||
|  | @ -199,12 +342,24 @@ class Chunk { | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @param {Module} module module to move | ||||
| 	 * @param {Chunk} otherChunk other chunk to move it to | ||||
| 	 * @returns {void} | ||||
| 	 */ | ||||
| 	moveModule(module, otherChunk) { | ||||
| 		GraphHelpers.disconnectChunkAndModule(this, module); | ||||
| 		GraphHelpers.connectChunkAndModule(otherChunk, module); | ||||
| 		module.rewriteChunkInReasons(this, [otherChunk]); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @param {Chunk} otherChunk the chunk to integrate with | ||||
| 	 * @param {ModuleReason} reason reason why the module is being integrated | ||||
| 	 * @returns {boolean} returns true or false if integration succeeds or fails | ||||
| 	 */ | ||||
| 	integrate(otherChunk, reason) { | ||||
| 		if (!this.canBeIntegrated(otherChunk)) { | ||||
| 			return false; | ||||
|  | @ -235,6 +390,10 @@ class Chunk { | |||
| 		return true; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {Chunk} newChunk the new chunk that will be split out of, and then chunk raphi twil= | ||||
| 	 * @returns {void} | ||||
| 	 */ | ||||
| 	split(newChunk) { | ||||
| 		for (const chunkGroup of this._groups) { | ||||
| 			chunkGroup.insertChunk(newChunk, this); | ||||
|  | @ -265,6 +424,9 @@ class Chunk { | |||
| 			} | ||||
| 			return true; | ||||
| 		}; | ||||
| 
 | ||||
| 		if (this.preventIntegration || otherChunk.preventIntegration) return false; | ||||
| 
 | ||||
| 		if (this.hasRuntime() !== otherChunk.hasRuntime()) { | ||||
| 			if (this.hasRuntime()) { | ||||
| 				return isAvailable(this, otherChunk); | ||||
|  | @ -278,6 +440,12 @@ class Chunk { | |||
| 		return true; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @param {number} size the size | ||||
| 	 * @param {Object} options the options passed in | ||||
| 	 * @returns {number} the multiplier returned | ||||
| 	 */ | ||||
| 	addMultiplierAndOverhead(size, options) { | ||||
| 		const overhead = | ||||
| 			typeof options.chunkOverhead === "number" ? options.chunkOverhead : 10000; | ||||
|  | @ -288,10 +456,17 @@ class Chunk { | |||
| 		return size * multiplicator + overhead; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @returns {number} the size of all modules | ||||
| 	 */ | ||||
| 	modulesSize() { | ||||
| 		return this._modules.getFromUnorderedCache(getModulesSize); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {Object} options the size display options | ||||
| 	 * @returns {number} the chunk size | ||||
| 	 */ | ||||
| 	size(options) { | ||||
| 		return this.addMultiplierAndOverhead(this.modulesSize(), options); | ||||
| 	} | ||||
|  | @ -313,6 +488,10 @@ class Chunk { | |||
| 		return this.addMultiplierAndOverhead(integratedModulesSize, options); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {ModuleSortPredicate=} sortByFn a predicate function used to sort modules | ||||
| 	 * @returns {void} | ||||
| 	 */ | ||||
| 	sortModules(sortByFn) { | ||||
| 		this._modules.sortWith(sortByFn || sortById); | ||||
| 	} | ||||
|  | @ -448,6 +627,12 @@ class Chunk { | |||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @param {ModuleFilterPredicate} filterFn predicate function used to filter modules | ||||
| 	 * @param {ChunkFilterPredicate} filterChunkFn predicate function used to filter chunks | ||||
| 	 * @returns {boolean} return true if module exists in graph | ||||
| 	 */ | ||||
| 	hasModuleInGraph(filterFn, filterChunkFn) { | ||||
| 		const queue = new Set(this.groupsIterable); | ||||
| 		const chunksProcessed = new Set(); | ||||
|  |  | |||
|  | @ -7,16 +7,40 @@ | |||
| const SortableSet = require("./util/SortableSet"); | ||||
| const compareLocations = require("./compareLocations"); | ||||
| 
 | ||||
| /** @typedef {import("./Chunk")} Chunk */ | ||||
| /** @typedef {import("./Module")} Module */ | ||||
| /** @typedef {import("./ModuleReason")} ModuleReason */ | ||||
| 
 | ||||
| /** @typedef {{id: number}} HasId */ | ||||
| /** @typedef {{module: Module, loc: TODO, request: string}} OriginRecord */ | ||||
| /** @typedef {string|{name: string}} ChunkGroupOptions */ | ||||
| 
 | ||||
| let debugId = 5000; | ||||
| 
 | ||||
| /** | ||||
|  * @template {T} | ||||
|  * @param {Set<T>} set set to convert to array. | ||||
|  * @returns {T[]} the array format of existing set | ||||
|  */ | ||||
| const getArray = set => Array.from(set); | ||||
| 
 | ||||
| /** | ||||
|  * A convenience method used to sort chunks based on their id's | ||||
|  * @param {HasId} a first sorting comparitor | ||||
|  * @param {HasId} b second sorting comparitor | ||||
|  * @returns {1|0|-1} a sorting index to determine order | ||||
|  */ | ||||
| const sortById = (a, b) => { | ||||
| 	if (a.id < b.id) return -1; | ||||
| 	if (b.id < a.id) return 1; | ||||
| 	return 0; | ||||
| }; | ||||
| 
 | ||||
| /** | ||||
|  * @param {OriginRecord} a the first comparitor in sort | ||||
|  * @param {OriginRecord} b the second comparitor in sort | ||||
|  * @returns {1|-1|0} returns sorting order as index | ||||
|  */ | ||||
| const sortOrigin = (a, b) => { | ||||
| 	const aIdent = a.module ? a.module.identifier() : ""; | ||||
| 	const bIdent = b.module ? b.module.identifier() : ""; | ||||
|  | @ -26,21 +50,33 @@ const sortOrigin = (a, b) => { | |||
| }; | ||||
| 
 | ||||
| class ChunkGroup { | ||||
| 	/** | ||||
| 	 * Creates an instance of ChunkGroup. | ||||
| 	 * @param {ChunkGroupOptions=} options chunk group options passed to chunkGroup | ||||
| 	 */ | ||||
| 	constructor(options) { | ||||
| 		if (typeof options === "string") { | ||||
| 			options = { name: options }; | ||||
| 		} else if (!options) { | ||||
| 			options = { name: undefined }; | ||||
| 		} | ||||
| 		/** @type {number} */ | ||||
| 		this.groupDebugId = debugId++; | ||||
| 		this.options = options; | ||||
| 		this._children = new SortableSet(undefined, sortById); | ||||
| 		this._parents = new SortableSet(undefined, sortById); | ||||
| 		this._blocks = new SortableSet(); | ||||
| 		/** @type {Chunk[]} */ | ||||
| 		this.chunks = []; | ||||
| 		/** @type {OriginRecord[]} */ | ||||
| 		this.origins = []; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * when a new chunk is added to a chunkGroup, addingOptions will occur. | ||||
| 	 * @param {ChunkGroupOptions} options the chunkGroup options passed to addOptions | ||||
| 	 * @returns {void} | ||||
| 	 */ | ||||
| 	addOptions(options) { | ||||
| 		for (const key of Object.keys(options)) { | ||||
| 			if (this.options[key] === undefined) { | ||||
|  | @ -57,23 +93,44 @@ class ChunkGroup { | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * returns the name of current ChunkGroup | ||||
| 	 * @returns {string|undefined} returns the ChunkGroup name | ||||
| 	 */ | ||||
| 	get name() { | ||||
| 		return this.options.name; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * sets a new name for current ChunkGroup | ||||
| 	 * @param {string} value the new name for ChunkGroup | ||||
| 	 * @returns {void} | ||||
| 	 */ | ||||
| 	set name(value) { | ||||
| 		this.options.name = value; | ||||
| 	} | ||||
| 
 | ||||
| 	/* istanbul ignore next */ | ||||
| 	/** | ||||
| 	 * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's | ||||
| 	 * @returns {string} a unique concatenation of chunk debugId's | ||||
| 	 */ | ||||
| 	get debugId() { | ||||
| 		return Array.from(this.chunks, x => x.debugId).join("+"); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * get a unique id for ChunkGroup, made up of its member Chunk id's | ||||
| 	 * @returns {string} a unique concatenation of chunk ids | ||||
| 	 */ | ||||
| 	get id() { | ||||
| 		return Array.from(this.chunks, x => x.id).join("+"); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * Performs an unshift of a specific chunk | ||||
| 	 * @param {Chunk} chunk chunk being unshifted | ||||
| 	 * @returns {boolean} returns true if attempted chunk shift is accepted | ||||
| 	 */ | ||||
| 	unshiftChunk(chunk) { | ||||
| 		const oldIdx = this.chunks.indexOf(chunk); | ||||
| 		if (oldIdx > 0) { | ||||
|  | @ -86,6 +143,12 @@ class ChunkGroup { | |||
| 		return false; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * inserts a chunk before another existing chunk in group | ||||
| 	 * @param {Chunk} chunk Chunk being inserted | ||||
| 	 * @param {Chunk} before Placeholder/target chunk marking new chunk insertion point | ||||
| 	 * @returns {boolean} return true if insertion was successful | ||||
| 	 */ | ||||
| 	insertChunk(chunk, before) { | ||||
| 		const oldIdx = this.chunks.indexOf(chunk); | ||||
| 		const idx = this.chunks.indexOf(before); | ||||
|  | @ -102,6 +165,11 @@ class ChunkGroup { | |||
| 		return false; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * add a chunk into ChunkGroup. Is pushed on or prepended | ||||
| 	 * @param {Chunk} chunk chunk being pushed into ChunkGroupS | ||||
| 	 * @returns {boolean} returns true if chunk addition was ssuccesful. | ||||
| 	 */ | ||||
| 	pushChunk(chunk) { | ||||
| 		const oldIdx = this.chunks.indexOf(chunk); | ||||
| 		if (oldIdx >= 0) { | ||||
|  | @ -111,6 +179,11 @@ class ChunkGroup { | |||
| 		return true; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {Chunk} oldChunk chunk to be replaced | ||||
| 	 * @param {Chunk} newChunk New chunkt that will be replaced | ||||
| 	 * @returns {boolean} rerturns true for | ||||
| 	 */ | ||||
| 	replaceChunk(oldChunk, newChunk) { | ||||
| 		const oldIdx = this.chunks.indexOf(oldChunk); | ||||
| 		if (oldIdx < 0) return false; | ||||
|  | @ -210,7 +283,7 @@ class ChunkGroup { | |||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @return {Array} - an array containing the blocks | ||||
| 	 * @returns {Array} - an array containing the blocks | ||||
| 	 */ | ||||
| 	getBlocks() { | ||||
| 		return this._blocks.getFromCache(getArray); | ||||
|  | @ -263,6 +336,10 @@ class ChunkGroup { | |||
| 		return Array.from(files); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @param {ModuleReason} reason reason for removing ChunkGroup | ||||
| 	 * @returns {void} | ||||
| 	 */ | ||||
| 	remove(reason) { | ||||
| 		// cleanup parents
 | ||||
| 		for (const parentChunkGroup of this._parents) { | ||||
|  | @ -310,6 +387,13 @@ class ChunkGroup { | |||
| 		this._children.sort(); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * Sorting predicate which allows current ChunkGroup to be compared against another. | ||||
| 	 * Sorting values are based off of number of chunks in ChunkGroup. | ||||
| 	 * | ||||
| 	 * @param {ChunkGroup} otherGroup the chunkGroup to compare this against | ||||
| 	 * @returns {-1|0|1} sort position for comparison | ||||
| 	 */ | ||||
| 	compareTo(otherGroup) { | ||||
| 		if (this.chunks.length > otherGroup.chunks.length) return -1; | ||||
| 		if (this.chunks.length < otherGroup.chunks.length) return 1; | ||||
|  |  | |||
|  | @ -6,6 +6,21 @@ | |||
| 
 | ||||
| const { Tapable, SyncWaterfallHook, SyncHook } = require("tapable"); | ||||
| 
 | ||||
| /** @typedef {import("./ModuleTemplate")} ModuleTemplate */ | ||||
| /** @typedef {import("./Chunk")} Chunk */ | ||||
| /** @typedef {import("./Module")} Module} */ | ||||
| /** @typedef {import("crypto").Hash} Hash */ | ||||
| 
 | ||||
| /** | ||||
|  * @typedef {Object} RenderManifestOptions | ||||
|  * @property {Chunk} chunk the chunk used to render | ||||
|  * @property {Hash} hash | ||||
|  * @property {string} fullHash | ||||
|  * @property {TODO} outputOptions | ||||
|  * @property {{javascript: ModuleTemplate, webassembly: ModuleTemplate}} moduleTemplates | ||||
|  * @property {Map<TODO, TODO>} dependencyTemplates | ||||
|  */ | ||||
| 
 | ||||
| module.exports = class ChunkTemplate extends Tapable { | ||||
| 	constructor(outputOptions) { | ||||
| 		super(); | ||||
|  | @ -30,6 +45,11 @@ module.exports = class ChunkTemplate extends Tapable { | |||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @param {RenderManifestOptions} options render manifest options | ||||
| 	 * @returns {TODO[]} returns render manifest | ||||
| 	 */ | ||||
| 	getRenderManifest(options) { | ||||
| 		const result = []; | ||||
| 
 | ||||
|  |  | |||
|  | @ -230,8 +230,8 @@ class Compilation extends Tapable { | |||
| 			this.requestShortener | ||||
| 		); | ||||
| 		this.moduleTemplates = { | ||||
| 			javascript: new ModuleTemplate(this.runtimeTemplate), | ||||
| 			webassembly: new ModuleTemplate(this.runtimeTemplate) | ||||
| 			javascript: new ModuleTemplate(this.runtimeTemplate, "javascript"), | ||||
| 			webassembly: new ModuleTemplate(this.runtimeTemplate, "webassembly") | ||||
| 		}; | ||||
| 
 | ||||
| 		this.semaphore = new Semaphore(options.parallelism || 100); | ||||
|  | @ -1168,6 +1168,61 @@ class Compilation extends Tapable { | |||
| 		const chunkDependencies = new Map(); // Map<Chunk, Array<{Module, Chunk}>>
 | ||||
| 		const allCreatedChunkGroups = new Set(); | ||||
| 
 | ||||
| 		// PREPARE
 | ||||
| 		const blockInfoMap = new Map(); | ||||
| 
 | ||||
| 		const iteratorDependency = d => { | ||||
| 			// We skip Dependencies without Reference
 | ||||
| 			const ref = d.getReference(); | ||||
| 			if (!ref) { | ||||
| 				return; | ||||
| 			} | ||||
| 			// We skip Dependencies without Module pointer
 | ||||
| 			const refModule = ref.module; | ||||
| 			if (!refModule) { | ||||
| 				return; | ||||
| 			} | ||||
| 			// We skip weak Dependencies
 | ||||
| 			if (ref.weak) { | ||||
| 				return; | ||||
| 			} | ||||
| 
 | ||||
| 			blockInfoModules.add(refModule); | ||||
| 		}; | ||||
| 
 | ||||
| 		const iteratorBlockPrepare = b => { | ||||
| 			blockInfoBlocks.push(b); | ||||
| 			blockQueue.push(b); | ||||
| 		}; | ||||
| 
 | ||||
| 		let block, blockQueue, blockInfoModules, blockInfoBlocks; | ||||
| 		for (const module of this.modules) { | ||||
| 			blockQueue = [module]; | ||||
| 			while (blockQueue.length > 0) { | ||||
| 				block = blockQueue.pop(); | ||||
| 				blockInfoModules = new Set(); | ||||
| 				blockInfoBlocks = []; | ||||
| 
 | ||||
| 				if (block.variables) { | ||||
| 					iterationBlockVariable(block.variables, iteratorDependency); | ||||
| 				} | ||||
| 
 | ||||
| 				if (block.dependencies) { | ||||
| 					iterationOfArrayCallback(block.dependencies, iteratorDependency); | ||||
| 				} | ||||
| 
 | ||||
| 				if (block.blocks) { | ||||
| 					iterationOfArrayCallback(block.blocks, iteratorBlockPrepare); | ||||
| 				} | ||||
| 
 | ||||
| 				const blockInfo = { | ||||
| 					modules: blockInfoModules, | ||||
| 					blocks: blockInfoBlocks | ||||
| 				}; | ||||
| 				blockInfoMap.set(block, blockInfo); | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		// PART ONE
 | ||||
| 
 | ||||
| 		const blockChunkGroups = new Map(); | ||||
|  | @ -1180,7 +1235,7 @@ class Compilation extends Tapable { | |||
| 			chunkGroup | ||||
| 		})); | ||||
| 
 | ||||
| 		let module, block, chunk, chunkGroup; | ||||
| 		let module, chunk, chunkGroup; | ||||
| 
 | ||||
| 		// For each async Block in graph
 | ||||
| 		const iteratorBlock = b => { | ||||
|  | @ -1227,22 +1282,20 @@ class Compilation extends Tapable { | |||
| 			}); | ||||
| 		}; | ||||
| 
 | ||||
| 		// For each Dependency in the graph
 | ||||
| 		const iteratorDependency = d => { | ||||
| 			// We skip Dependencies without Reference
 | ||||
| 			const ref = d.getReference(); | ||||
| 			if (!ref) { | ||||
| 				return; | ||||
| 			} | ||||
| 			// We skip Dependencies without Module pointer
 | ||||
| 			const refModule = ref.module; | ||||
| 			if (!refModule) { | ||||
| 				return; | ||||
| 			} | ||||
| 			// We skip weak Dependencies
 | ||||
| 			if (ref.weak) { | ||||
| 				return; | ||||
| 			} | ||||
| 		// Iterative traversal of the Module graph
 | ||||
| 		// Recursive would be simpler to write but could result in Stack Overflows
 | ||||
| 		while (queue.length) { | ||||
| 			const queueItem = queue.pop(); | ||||
| 			module = queueItem.module; | ||||
| 			block = queueItem.block; | ||||
| 			chunk = queueItem.chunk; | ||||
| 			chunkGroup = queueItem.chunkGroup; | ||||
| 
 | ||||
| 			// get prepared block info
 | ||||
| 			const blockInfo = blockInfoMap.get(block); | ||||
| 
 | ||||
| 			// Traverse all referenced modules
 | ||||
| 			for (const refModule of blockInfo.modules) { | ||||
| 				// We connect Module and Chunk when not already done
 | ||||
| 				if (chunk.addModule(refModule)) { | ||||
| 					refModule.addChunk(chunk); | ||||
|  | @ -1255,29 +1308,10 @@ class Compilation extends Tapable { | |||
| 						chunkGroup | ||||
| 					}); | ||||
| 				} | ||||
| 		}; | ||||
| 
 | ||||
| 		// Iterative traversal of the Module graph
 | ||||
| 		// Recursive would be simpler to write but could result in Stack Overflows
 | ||||
| 		while (queue.length) { | ||||
| 			const queueItem = queue.pop(); | ||||
| 			module = queueItem.module; | ||||
| 			block = queueItem.block; | ||||
| 			chunk = queueItem.chunk; | ||||
| 			chunkGroup = queueItem.chunkGroup; | ||||
| 
 | ||||
| 			// Traverse all variables, Dependencies and Blocks
 | ||||
| 			if (block.variables) { | ||||
| 				iterationBlockVariable(block.variables, iteratorDependency); | ||||
| 			} | ||||
| 
 | ||||
| 			if (block.dependencies) { | ||||
| 				iterationOfArrayCallback(block.dependencies, iteratorDependency); | ||||
| 			} | ||||
| 
 | ||||
| 			if (block.blocks) { | ||||
| 				iterationOfArrayCallback(block.blocks, iteratorBlock); | ||||
| 			} | ||||
| 			// Traverse all Blocks
 | ||||
| 			iterationOfArrayCallback(blockInfo.blocks, iteratorBlock); | ||||
| 		} | ||||
| 
 | ||||
| 		// PART TWO
 | ||||
|  |  | |||
|  | @ -330,7 +330,7 @@ function webpackContext(req) { | |||
| function webpackContextResolve(req) { | ||||
| 	var id = map[req]; | ||||
| 	if(!(id + 1)) { // check for number or string
 | ||||
| 		var e = new Error('Cannot find module "' + req + '".'); | ||||
| 		var e = new Error("Cannot find module '" + req + "'"); | ||||
| 		e.code = 'MODULE_NOT_FOUND'; | ||||
| 		throw e; | ||||
| 	} | ||||
|  | @ -365,7 +365,7 @@ function webpackContext(req) { | |||
| function webpackContextResolve(req) { | ||||
| 	var id = map[req]; | ||||
| 	if(!(id + 1)) { // check for number or string
 | ||||
| 		var e = new Error('Cannot find module "' + req + '".'); | ||||
| 		var e = new Error("Cannot find module '" + req + "'"); | ||||
| 		e.code = 'MODULE_NOT_FOUND'; | ||||
| 		throw e; | ||||
| 	} | ||||
|  | @ -404,7 +404,7 @@ function webpackAsyncContextResolve(req) { | |||
| 	return Promise.resolve().then(function() { | ||||
| 		var id = map[req]; | ||||
| 		if(!(id + 1)) { // check for number or string
 | ||||
| 			var e = new Error('Cannot find module "' + req + '".'); | ||||
| 			var e = new Error("Cannot find module '" + req + "'"); | ||||
| 			e.code = 'MODULE_NOT_FOUND'; | ||||
| 			throw e; | ||||
| 		} | ||||
|  | @ -441,7 +441,7 @@ function webpackAsyncContextResolve(req) { | |||
| 	return Promise.resolve().then(function() { | ||||
| 		var id = map[req]; | ||||
| 		if(!(id + 1)) { // check for number or string
 | ||||
| 			var e = new Error('Cannot find module "' + req + '".'); | ||||
| 			var e = new Error("Cannot find module '" + req + "'"); | ||||
| 			e.code = 'MODULE_NOT_FOUND'; | ||||
| 			throw e; | ||||
| 		} | ||||
|  | @ -481,7 +481,7 @@ function webpackAsyncContextResolve(req) { | |||
| 	return ${promise}.then(function() { | ||||
| 		var id = map[req]; | ||||
| 		if(!(id + 1)) { // check for number or string
 | ||||
| 			var e = new Error('Cannot find module "' + req + '".'); | ||||
| 			var e = new Error("Cannot find module '" + req + "'"); | ||||
| 			e.code = 'MODULE_NOT_FOUND'; | ||||
| 			throw e; | ||||
| 		} | ||||
|  | @ -540,7 +540,7 @@ function webpackAsyncContext(req) { | |||
| 	var ids = map[req]; | ||||
| 	if(!ids) { | ||||
| 		return Promise.resolve().then(function() { | ||||
| 			var e = new Error('Cannot find module "' + req + '".'); | ||||
| 			var e = new Error("Cannot find module '" + req + "'"); | ||||
| 			e.code = 'MODULE_NOT_FOUND'; | ||||
| 			throw e; | ||||
| 		}); | ||||
|  | @ -559,7 +559,7 @@ module.exports = webpackAsyncContext;`; | |||
| 
 | ||||
| 	getSourceForEmptyContext(id) { | ||||
| 		return `function webpackEmptyContext(req) {
 | ||||
| 	var e = new Error('Cannot find module "' + req + '".'); | ||||
| 	var e = new Error("Cannot find module '" + req + "'"); | ||||
| 	e.code = 'MODULE_NOT_FOUND'; | ||||
| 	throw e; | ||||
| } | ||||
|  | @ -574,7 +574,7 @@ webpackEmptyContext.id = ${JSON.stringify(id)};`; | |||
| 	// Here Promise.resolve().then() is used instead of new Promise() to prevent
 | ||||
| 	// uncaught exception popping up in devtools
 | ||||
| 	return Promise.resolve().then(function() { | ||||
| 		var e = new Error('Cannot find module "' + req + '".'); | ||||
| 		var e = new Error("Cannot find module '" + req + "'"); | ||||
| 		e.code = 'MODULE_NOT_FOUND'; | ||||
| 		throw e; | ||||
| 	}); | ||||
|  |  | |||
|  | @ -6,11 +6,16 @@ | |||
| 
 | ||||
| const DependenciesBlockVariable = require("./DependenciesBlockVariable"); | ||||
| 
 | ||||
| /** @typedef {import("./ChunkGroup")} ChunkGroup */ | ||||
| 
 | ||||
| class DependenciesBlock { | ||||
| 	constructor() { | ||||
| 		this.dependencies = []; | ||||
| 		this.blocks = []; | ||||
| 		this.variables = []; | ||||
| 		// TODO remove this line, it's wrong
 | ||||
| 		/** @type {ChunkGroup=} */ | ||||
| 		this.chunkGroup = undefined; | ||||
| 	} | ||||
| 
 | ||||
| 	addBlock(block) { | ||||
|  |  | |||
|  | @ -6,20 +6,46 @@ | |||
| 
 | ||||
| const ChunkGroup = require("./ChunkGroup"); | ||||
| 
 | ||||
| /** @typedef {import("./Chunk.js")} Chunk */ | ||||
| 
 | ||||
| /** | ||||
|  * Entrypoint serves as an encapsulation primitive for chunks that are | ||||
|  * a part of a single ChunkGroup. They represent all bundles that need to be loaded for a | ||||
|  * single instance of a page. Multi-page application architectures will typically yield multiple Entrypoint objects | ||||
|  * inside of the compilation, whereas a Single Page App may only contain one with many lazy-loaded chunks. | ||||
|  */ | ||||
| class Entrypoint extends ChunkGroup { | ||||
| 	/** | ||||
| 	 * Creates an instance of Entrypoint. | ||||
| 	 * @param {string} name the name of the entrypoint | ||||
| 	 */ | ||||
| 	constructor(name) { | ||||
| 		super(name); | ||||
| 		/** @type {Chunk=} */ | ||||
| 		this.runtimeChunk = undefined; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * isInitial will always return true for Entrypoint ChunkGroup. | ||||
| 	 * @returns {true} returns true as all entrypoints are initial ChunkGroups | ||||
| 	 */ | ||||
| 	isInitial() { | ||||
| 		return true; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * Sets the runtimeChunk for an entrypoint. | ||||
| 	 * @param {Chunk} chunk the chunk being set as the runtime chunk. | ||||
| 	 * @returns {void} | ||||
| 	 */ | ||||
| 	setRuntimeChunk(chunk) { | ||||
| 		this.runtimeChunk = chunk; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * Fetches the chunk reference containing the webpack bootstrap code | ||||
| 	 * @returns {Chunk} returns the runtime chunk or first chunk in `this.chunks` | ||||
| 	 */ | ||||
| 	getRuntimeChunk() { | ||||
| 		return this.runtimeChunk || this.chunks[0]; | ||||
| 	} | ||||
|  |  | |||
|  | @ -40,7 +40,7 @@ class EvalSourceMapDevToolModuleTemplatePlugin { | |||
| 					return source; | ||||
| 				} | ||||
| 
 | ||||
| 				/** @type {{ [key: string]: any; }} */ | ||||
| 				/** @type {{ [key: string]: TODO; }} */ | ||||
| 				let sourceMap; | ||||
| 				let content; | ||||
| 				if (source.sourceAndMap) { | ||||
|  |  | |||
|  | @ -0,0 +1,52 @@ | |||
| /* | ||||
| 	MIT License http://www.opensource.org/licenses/mit-license.php
 | ||||
| 	Author Tobias Koppers @sokra | ||||
| */ | ||||
| "use strict"; | ||||
| 
 | ||||
| /** @typedef {import("./Module")} Module */ | ||||
| /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ | ||||
| /** @typedef {import("webpack-sources").Source} Source */ | ||||
| 
 | ||||
| /** | ||||
|  * | ||||
|  */ | ||||
| class Generator { | ||||
| 	static byType(map) { | ||||
| 		return new ByTypeGenerator(map); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @abstract | ||||
| 	 * @param {Module} module module for which the code should be generated | ||||
| 	 * @param {Map<Function, TODO>} dependencyTemplates mapping from dependencies to templates | ||||
| 	 * @param {RuntimeTemplate} runtimeTemplate the runtime template | ||||
| 	 * @param {string} type which kind of code should be generated | ||||
| 	 * @returns {Source} generated code | ||||
| 	 */ | ||||
| 	generate(module, dependencyTemplates, runtimeTemplate, type) { | ||||
| 		throw new Error("Generator.generate: must be overriden"); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| class ByTypeGenerator extends Generator { | ||||
| 	constructor(map) { | ||||
| 		super(); | ||||
| 		this.map = map; | ||||
| 	} | ||||
| 
 | ||||
| 	generate(module, dependencyTemplates, runtimeTemplate, type) { | ||||
| 		const generator = this.map[type]; | ||||
| 		if (!generator) { | ||||
| 			throw new Error(`Generator.byType: no generator specified for ${type}`); | ||||
| 		} | ||||
| 		return generator.generate( | ||||
| 			module, | ||||
| 			dependencyTemplates, | ||||
| 			runtimeTemplate, | ||||
| 			type | ||||
| 		); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| module.exports = Generator; | ||||
|  | @ -1,28 +1,64 @@ | |||
| exports.connectChunkGroupAndChunk = (chunkGroup, chunk) => { | ||||
| /** @typedef {import("./Chunk")} Chunk */ | ||||
| /** @typedef {import("./ChunkGroup")} ChunkGroup */ | ||||
| /** @typedef {import("./Module")} Module */ | ||||
| /** @typedef {import("./DependenciesBlock")} DependenciesBlock */ | ||||
| 
 | ||||
| /** | ||||
|  * @param {ChunkGroup} chunkGroup the ChunkGroup to connect | ||||
|  * @param {Chunk} chunk chunk to tie to ChunkGroup | ||||
|  * @returns {void} | ||||
|  */ | ||||
| const connectChunkGroupAndChunk = (chunkGroup, chunk) => { | ||||
| 	if (chunkGroup.pushChunk(chunk)) { | ||||
| 		chunk.addGroup(chunkGroup); | ||||
| 	} | ||||
| }; | ||||
| 
 | ||||
| exports.connectChunkGroupParentAndChild = (parent, child) => { | ||||
| /** | ||||
|  * @param {ChunkGroup} parent parent ChunkGroup to connect | ||||
|  * @param {ChunkGroup} child child ChunkGroup to connect | ||||
|  * @returns {void} | ||||
|  */ | ||||
| const connectChunkGroupParentAndChild = (parent, child) => { | ||||
| 	if (parent.addChild(child)) { | ||||
| 		child.addParent(parent); | ||||
| 	} | ||||
| }; | ||||
| 
 | ||||
| exports.connectChunkAndModule = (chunk, module) => { | ||||
| /** | ||||
|  * @param {Chunk} chunk Chunk to connect to Module | ||||
|  * @param {Module} module Module to connect to Chunk | ||||
|  * @returns {void} | ||||
|  */ | ||||
| const connectChunkAndModule = (chunk, module) => { | ||||
| 	if (module.addChunk(chunk)) { | ||||
| 		chunk.addModule(module); | ||||
| 	} | ||||
| }; | ||||
| 
 | ||||
| exports.disconnectChunkAndModule = (chunk, module) => { | ||||
| /** | ||||
|  * @param {Chunk} chunk Chunk being disconnected | ||||
|  * @param {Module} module Module being disconnected | ||||
|  * @returns {void} | ||||
|  */ | ||||
| const disconnectChunkAndModule = (chunk, module) => { | ||||
| 	chunk.removeModule(module); | ||||
| 	module.removeChunk(chunk); | ||||
| }; | ||||
| 
 | ||||
| exports.connectDependenciesBlockAndChunkGroup = (depBlock, chunkGroup) => { | ||||
| /** | ||||
|  * @param {DependenciesBlock} depBlock DepBlock being tied to ChunkGroup | ||||
|  * @param {ChunkGroup} chunkGroup ChunkGroup being tied to DepBlock | ||||
|  * @returns {void} | ||||
|  */ | ||||
| const connectDependenciesBlockAndChunkGroup = (depBlock, chunkGroup) => { | ||||
| 	if (chunkGroup.addBlock(depBlock)) { | ||||
| 		depBlock.chunkGroup = chunkGroup; | ||||
| 	} | ||||
| }; | ||||
| 
 | ||||
| exports.connectChunkGroupAndChunk = connectChunkGroupAndChunk; | ||||
| exports.connectChunkGroupParentAndChild = connectChunkGroupParentAndChild; | ||||
| exports.connectChunkAndModule = connectChunkAndModule; | ||||
| exports.disconnectChunkAndModule = disconnectChunkAndModule; | ||||
| exports.connectDependenciesBlockAndChunkGroup = connectDependenciesBlockAndChunkGroup; | ||||
|  |  | |||
|  | @ -362,7 +362,7 @@ module.exports = function() { | |||
| 		for (var id in hotUpdate) { | ||||
| 			if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { | ||||
| 				moduleId = toModuleId(id); | ||||
| 				/** @type {any} */ | ||||
| 				/** @type {TODO} */ | ||||
| 				var result; | ||||
| 				if (hotUpdate[id]) { | ||||
| 					result = getAffectedStuff(moduleId); | ||||
|  |  | |||
|  | @ -12,7 +12,6 @@ const ModuleHotDeclineDependency = require("./dependencies/ModuleHotDeclineDepen | |||
| const ConstDependency = require("./dependencies/ConstDependency"); | ||||
| const NullFactory = require("./NullFactory"); | ||||
| const ParserHelpers = require("./ParserHelpers"); | ||||
| const createHash = require("./util/createHash"); | ||||
| 
 | ||||
| module.exports = class HotModuleReplacementPlugin { | ||||
| 	constructor(options) { | ||||
|  | @ -74,9 +73,7 @@ module.exports = class HotModuleReplacementPlugin { | |||
| 						records.moduleHashs = {}; | ||||
| 						for (const module of compilation.modules) { | ||||
| 							const identifier = module.identifier(); | ||||
| 							const hash = createHash(compilation.outputOptions.hashFunction); | ||||
| 							module.updateHash(hash); | ||||
| 							records.moduleHashs[identifier] = hash.digest("hex"); | ||||
| 							records.moduleHashs[identifier] = module.hash; | ||||
| 						} | ||||
| 						records.chunkHashs = {}; | ||||
| 						for (const chunk of compilation.chunks) { | ||||
|  | @ -136,9 +133,7 @@ module.exports = class HotModuleReplacementPlugin { | |||
| 							return; | ||||
| 						for (const module of compilation.modules) { | ||||
| 							const identifier = module.identifier(); | ||||
| 							let hash = createHash(compilation.outputOptions.hashFunction); | ||||
| 							module.updateHash(hash); | ||||
| 							hash = hash.digest("hex"); | ||||
| 							let hash = module.hash; | ||||
| 							module.hotUpdate = records.moduleHashs[identifier] !== hash; | ||||
| 						} | ||||
| 						const hotUpdateMainContent = { | ||||
|  |  | |||
|  | @ -18,6 +18,22 @@ const { | |||
| } = require("tapable"); | ||||
| const Template = require("./Template"); | ||||
| 
 | ||||
| /** @typedef {import("webpack-sources").ConcatSource} ConcatSource */ | ||||
| /** @typedef {import("./ModuleTemplate")} ModuleTemplate */ | ||||
| /** @typedef {import("./Chunk")} Chunk */ | ||||
| /** @typedef {import("./Module")} Module} */ | ||||
| /** @typedef {import("crypto").Hash} Hash} */ | ||||
| 
 | ||||
| /** | ||||
|  * @typedef {Object} RenderManifestOptions | ||||
|  * @property {Chunk} chunk the chunk used to render | ||||
|  * @property {Hash} hash | ||||
|  * @property {string} fullHash | ||||
|  * @property {TODO} outputOptions | ||||
|  * @property {{javascript: ModuleTemplate, webassembly: ModuleTemplate}} moduleTemplates | ||||
|  * @property {Map<TODO, TODO>} dependencyTemplates | ||||
|  */ | ||||
| 
 | ||||
| // require function shortcuts:
 | ||||
| // __webpack_require__.s = the module id of the entry point
 | ||||
| // __webpack_require__.c = the module cache
 | ||||
|  | @ -35,10 +51,16 @@ const Template = require("./Template"); | |||
| // __webpack_require__.nc = the script nonce
 | ||||
| 
 | ||||
| module.exports = class MainTemplate extends Tapable { | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @param {TODO=} outputOptions output options for the MainTemplate | ||||
| 	 */ | ||||
| 	constructor(outputOptions) { | ||||
| 		super(); | ||||
| 		/** @type {TODO?} */ | ||||
| 		this.outputOptions = outputOptions || {}; | ||||
| 		this.hooks = { | ||||
| 			/** @type {SyncWaterfallHook<TODO[], RenderManifestOptions>} */ | ||||
| 			renderManifest: new SyncWaterfallHook(["result", "options"]), | ||||
| 			modules: new SyncWaterfallHook([ | ||||
| 				"modules", | ||||
|  | @ -104,6 +126,7 @@ module.exports = class MainTemplate extends Tapable { | |||
| 			hotBootstrap: new SyncWaterfallHook(["source", "chunk", "hash"]) | ||||
| 		}; | ||||
| 		this.hooks.startup.tap("MainTemplate", (source, chunk, hash) => { | ||||
| 			/** @type {string[]} */ | ||||
| 			const buf = []; | ||||
| 			if (chunk.entryModule) { | ||||
| 				buf.push("// Load entry module and return exports"); | ||||
|  | @ -296,6 +319,11 @@ module.exports = class MainTemplate extends Tapable { | |||
| 		this.requireFn = "__webpack_require__"; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @param {RenderManifestOptions} options render manifest options | ||||
| 	 * @returns {TODO[]} returns render manifest | ||||
| 	 */ | ||||
| 	getRenderManifest(options) { | ||||
| 		const result = []; | ||||
| 
 | ||||
|  | @ -304,6 +332,14 @@ module.exports = class MainTemplate extends Tapable { | |||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @param {string} hash hash to be used for render call | ||||
| 	 * @param {Chunk} chunk Chunk instance | ||||
| 	 * @param {ModuleTemplate} moduleTemplate ModuleTemplate instance for render | ||||
| 	 * @param {TODO} dependencyTemplates DependencyTemplate[]s | ||||
| 	 * @returns {ConcatSource} the newly generated source from rendering | ||||
| 	 */ | ||||
| 	render(hash, chunk, moduleTemplate, dependencyTemplates) { | ||||
| 		const buf = []; | ||||
| 		buf.push( | ||||
|  | @ -349,6 +385,13 @@ module.exports = class MainTemplate extends Tapable { | |||
| 		return new ConcatSource(source, ";"); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @param {string} hash hash for render fn | ||||
| 	 * @param {Chunk} chunk Chunk instance for require | ||||
| 	 * @param {(number|string)=} varModuleId module id | ||||
| 	 * @returns {TODO} the moduleRequire hook call return signature | ||||
| 	 */ | ||||
| 	renderRequireFunctionForModule(hash, chunk, varModuleId) { | ||||
| 		return this.hooks.moduleRequire.call( | ||||
| 			this.requireFn, | ||||
|  | @ -358,6 +401,14 @@ module.exports = class MainTemplate extends Tapable { | |||
| 		); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @param {string} hash hash for render add fn | ||||
| 	 * @param {Chunk} chunk Chunk instance for require add fn | ||||
| 	 * @param {(string|number)=} varModuleId module id | ||||
| 	 * @param {Module} varModule Module instance | ||||
| 	 * @returns {TODO} renderAddModule call | ||||
| 	 */ | ||||
| 	renderAddModule(hash, chunk, varModuleId, varModule) { | ||||
| 		return this.hooks.addModule.call( | ||||
| 			`modules[${varModuleId}] = ${varModule};`, | ||||
|  | @ -368,6 +419,12 @@ module.exports = class MainTemplate extends Tapable { | |||
| 		); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @param {string} hash string hash | ||||
| 	 * @param {number} length length | ||||
| 	 * @returns {string} call hook return | ||||
| 	 */ | ||||
| 	renderCurrentHashCode(hash, length) { | ||||
| 		length = length || Infinity; | ||||
| 		return this.hooks.currentHash.call( | ||||
|  | @ -376,6 +433,11 @@ module.exports = class MainTemplate extends Tapable { | |||
| 		); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * @param {object} options get public path options | ||||
| 	 * @returns {string} hook call | ||||
| 	 */ | ||||
| 	getPublicPath(options) { | ||||
| 		return this.hooks.assetPath.call( | ||||
| 			this.outputOptions.publicPath || "", | ||||
|  |  | |||
|  | @ -11,9 +11,8 @@ const ModuleReason = require("./ModuleReason"); | |||
| const SortableSet = require("./util/SortableSet"); | ||||
| const Template = require("./Template"); | ||||
| 
 | ||||
| /** @typedef {typeof import("./Chunk")} Chunk */ | ||||
| 
 | ||||
| /** @typedef {typeof import("./RequestShortener")} RequestShortener */ | ||||
| /** @typedef {import("./Chunk")} Chunk */ | ||||
| /** @typedef {import("./RequestShortener")} RequestShortener */ | ||||
| 
 | ||||
| const EMPTY_RESOLVE_OPTIONS = {}; | ||||
| 
 | ||||
|  | @ -101,6 +100,9 @@ class Module extends DependenciesBlock { | |||
| 
 | ||||
| 		/** @type {boolean} */ | ||||
| 		this.useSourceMap = false; | ||||
| 
 | ||||
| 		// info from build
 | ||||
| 		this._source = null; | ||||
| 	} | ||||
| 
 | ||||
| 	get exportsArgument() { | ||||
|  |  | |||
|  | @ -7,9 +7,10 @@ | |||
| const { Tapable, SyncWaterfallHook, SyncHook } = require("tapable"); | ||||
| 
 | ||||
| module.exports = class ModuleTemplate extends Tapable { | ||||
| 	constructor(runtimeTemplate) { | ||||
| 	constructor(runtimeTemplate, type) { | ||||
| 		super(); | ||||
| 		this.runtimeTemplate = runtimeTemplate; | ||||
| 		this.type = type; | ||||
| 		this.hooks = { | ||||
| 			content: new SyncWaterfallHook([ | ||||
| 				"source", | ||||
|  | @ -40,9 +41,11 @@ module.exports = class ModuleTemplate extends Tapable { | |||
| 	} | ||||
| 
 | ||||
| 	render(module, dependencyTemplates, options) { | ||||
| 		try { | ||||
| 			const moduleSource = module.source( | ||||
| 				dependencyTemplates, | ||||
| 			this.runtimeTemplate | ||||
| 				this.runtimeTemplate, | ||||
| 				this.type | ||||
| 			); | ||||
| 			const moduleSourcePostContent = this.hooks.content.call( | ||||
| 				moduleSource, | ||||
|  | @ -68,6 +71,10 @@ module.exports = class ModuleTemplate extends Tapable { | |||
| 				options, | ||||
| 				dependencyTemplates | ||||
| 			); | ||||
| 		} catch (e) { | ||||
| 			e.message = `${module.identifier()}\n${e.message}`; | ||||
| 			throw e; | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	updateHash(hash) { | ||||
|  |  | |||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
		Reference in New Issue