Merge branch 'main' into feature-14347

# Conflicts:
#	lib/ConstPlugin.js
This commit is contained in:
Ivan Kopeykin 2023-04-22 21:58:34 +03:00
commit f915e08cbc
1380 changed files with 34845 additions and 11798 deletions

View File

@ -1,26 +1,28 @@
# Ignore node_modules
node_modules
# Ignore some test files
test/**/*.*
!test/*.js
!test/**/webpack.config.js
!test/**/test.config.js
!test/**/test.filter.js
test/cases/parsing/es2022/test.filter.js
!test/**/errors.js
!test/**/warnings.js
!test/**/deprecations.js
!test/helpers/*.*
# Ignore some folders
benchmark
coverage
# Ignore generated files
*.check.js
# Ignore not supported files
!.*.js
.eslintrc.js
*.d.ts
# Ignore precompiled schemas
schemas/**/*.check.js
# Ignore some test files
test/*
!test/*Cases
!test/helpers
!test/*.js
test/*Cases/**/*.js
!test/*Cases/**/webpack.config.js
# Ignore some examples files
examples/**/*.js
!examples/*/webpack.config.js

View File

@ -56,7 +56,7 @@ module.exports = {
...["implements", "const", "memberof", "readonly", "yields"].reduce(
(acc, tag) => {
acc[tag] = {
message: `@${tag} currently not supported in Typescript`
message: `@${tag} currently not supported in TypeScript`
};
return acc;
},
@ -90,6 +90,13 @@ module.exports = {
ecmaVersion: 5
}
},
{
files: ["tooling/**/*.js"],
env: { es6: true },
parserOptions: {
ecmaVersion: 2020
}
},
{
files: ["test/**/*.js"],
env: {

1
.gitattributes vendored
View File

@ -3,4 +3,5 @@ test/statsCases/** eol=lf
examples/* eol=lf
bin/* eol=lf
*.svg eol=lf
*.css eol=lf
**/*webpack.lock.data/** -text

View File

@ -2,7 +2,7 @@
<!-- Before creating an issue please make sure you are using the latest version of webpack. -->
<!-- Also consider trying the webpack@beta version, maybe it's already fixed. -->
**Do you want to request a *feature* or report a *bug*?**
**Do you want to request a _feature_ or report a _bug_?**
<!-- Please ask questions on StackOverflow or the webpack Gitter (https://gitter.im/webpack/webpack). -->
<!-- Issues which contain questions or support requests will be closed. -->

View File

@ -15,10 +15,8 @@ about: Create a report to help us improve
**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 repository -->
<!-- The most helpful is a minimal reproduction with instructions on how to reproduce -->
<!-- Repositories with too many files or large `webpack.config.js` files are not suitable -->
@ -28,12 +26,11 @@ about: Create a report to help us improve
**What is the expected behavior?**
<!-- "It should work" is not a helpful explanation -->
<!-- Explain exactly how it should behave -->
**Other relevant information:**
webpack version:
Node.js version:
Operating System:
Node.js version:
Operating System:
Additional tools:

View File

@ -1,7 +1,6 @@
---
name: Feature request
about: Suggest an idea for this project
---
<!-- Please don't delete this template or we'll close your issue -->
@ -16,12 +15,9 @@ about: Suggest an idea for this project
**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

View File

@ -1,7 +1,6 @@
---
name: Other
about: Something else
---
<!-- Bug reports and Feature requests must use other templates, or will be closed -->

View File

@ -1,23 +1,17 @@
<!-- The webpack team is currently a beta pilot for GitHub Copilot for Pull Requests, please leave this template unchanged for now -->
<!-- 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. -->
## Summary
<!-- In addition to that please answer these questions: -->
<!-- cspell:disable-next-line -->
**What kind of change does this PR introduce?**
copilot:summary
<!-- E.g. a bugfix, feature, refactoring, build related change, etc… -->
## Details
**Did you add tests for your changes?**
<!-- cspell:disable-next-line -->
<!-- Note that we won't merge your changes if you don't add tests -->
**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. -->
**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 -->
copilot:walkthrough

View File

@ -0,0 +1,22 @@
<!-- 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?**
<!-- E.g. a bugfix, feature, refactoring, build related change, etc… -->
**Did you add tests for your changes?**
<!-- Note that we won't merge your changes if you don't add tests -->
**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. -->
**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 -->

View File

@ -1,12 +1,21 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "04:00"
timezone: Europe/Berlin
open-pull-requests-limit: 20
labels:
- dependencies
versioning-strategy: widen
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "04:00"
timezone: Europe/Berlin
open-pull-requests-limit: 20
labels:
- dependencies
versioning-strategy: widen
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
time: "04:00"
timezone: Europe/Berlin
open-pull-requests-limit: 20
labels:
- dependencies

View File

@ -1,6 +1,5 @@
name: Test
# cspell:word Ignus
# cspell:word eslintcache
on:
@ -13,18 +12,21 @@ on:
- main
- dev-1
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
cache: "yarn"
- run: yarn --frozen-lockfile
- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: .eslintcache
key: lint-${{ env.GITHUB_SHA }}
@ -33,39 +35,51 @@ jobs:
basic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn link --frozen-lockfile || true
- run: yarn link webpack --frozen-lockfile
- run: yarn test:basic --ci
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
flags: basic
functionalities: gcov
validate-legacy-node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 10.x
cache: "yarn"
# Remove `devDependencies` from `package.json` to avoid `yarn install` compatibility error
- run: node -e "const content = require('./package.json');delete content.devDependencies;require('fs').writeFileSync('package.json', JSON.stringify(content, null, 2));"
- run: yarn install --production --frozen-lockfile
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
cache: "yarn"
- run: yarn --frozen-lockfile
- run: yarn link --frozen-lockfile || true
- run: yarn link webpack --frozen-lockfile
- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: .jest-cache
key: jest-unit-${{ env.GITHUB_SHA }}
restore-keys: jest-unit-
- run: yarn cover:unit --ci --cacheDirectory .jest-cache
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
flags: unit
functionalities: gcov
@ -75,9 +89,15 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10.x, 16.x]
node-version: [10.x, 20.x]
part: [a, b]
include:
- os: ubuntu-latest
node-version: 18.x
part: a
- os: ubuntu-latest
node-version: 16.x
part: a
- os: ubuntu-latest
node-version: 14.x
part: a
@ -86,23 +106,29 @@ jobs:
part: a
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache: "yarn"
# Install old `jest` version and deps for legacy node versions
- run: |
yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 @types/jest@^27.4.0 pretty-format@^27.0.2 --ignore-engines
yarn --frozen-lockfile --ignore-engines
if: matrix.node-version == '10.x' || matrix.node-version == '12.x' || matrix.node-version == '14.x'
- run: yarn --frozen-lockfile
if: matrix.node-version != '10.x' && matrix.node-version != '12.x' && matrix.node-version != '14.x'
- run: yarn link --frozen-lockfile || true
- run: yarn link webpack --frozen-lockfile
- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: .jest-cache
key: jest-integration-${{ env.GITHUB_SHA }}
restore-keys: jest-integration-
- run: yarn cover:integration:${{ matrix.part }} --ci --cacheDirectory .jest-cache || yarn cover:integration:${{ matrix.part }} --ci --cacheDirectory .jest-cache -f
- run: yarn cover:merge
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
flags: integration
functionalities: gcov

1
.gitignore vendored
View File

@ -4,6 +4,7 @@
/test/fixtures/temp-*
/test/temp
/test/ChangesAndRemovals
/test/**/dev-defaults.webpack.lock
/benchmark/js
/benchmark/fixtures
/examples/**/dist

1
.husky/.gitignore vendored
View File

@ -1 +0,0 @@
_

View File

@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no-install lint-staged

View File

@ -1,14 +1,30 @@
package.json
# Ignore test fixtures
test/*.*
# Ignore some test files
test/**/*.*
!test/*.js
!test/**/webpack.config.js
!test/**/test.config.js
!test/**/test.filter.js
!test/**/errors.js
!test/**/warnings.js
!test/**/deprecations.js
!test/*.md
!test/helpers/*.*
# Ignore example fixtures
examples/*.*
!examples/**/webpack.config.js
# Ignore some folders
benchmark/
coverage/
# Ignore generated files
*.check.js
# Ignore not supported files
*.d.ts
# Ignore precompiled schemas
schemas/**/*.check.js
# Ignore example fixtures
examples/
!examples/**/webpack.config.js

View File

@ -1,74 +0,0 @@
dist: trusty
language: node_js
branches:
only:
- webpack-4
- main
- next
- dev-1
cache:
yarn: true
directories:
- ".jest-cache"
- ".eslintcache"
stages:
- basic
- advanced
matrix:
include:
- os: linux
node_js: "12"
env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=basic
stage: basic
- os: linux
node_js: "12"
env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=lintunit
stage: advanced
- os: linux
node_js: "12"
env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration
stage: advanced
- os: linux
node_js: "12"
env: NO_WATCH_TESTS=1 ALTERNATIVE_SORT=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration
stage: advanced
- os: linux
node_js: "10"
env:
- NODEJS_VERSION=v15.0.0-nightly2020082003293aa3a1
- YARN_EXTRA_ARGS="--ignore-engines"
- NO_WATCH_TESTS=1
- JEST="--maxWorkers=2 --cacheDirectory .jest-cache"
- JOB_PART=integration
stage: advanced
fast_finish: true
before_install:
- |
if [ "$NODEJS_VERSION" != "" ];
then
mkdir /opt/node
curl --silent "https://nodejs.org/download/nightly/$NODEJS_VERSION/node-$NODEJS_VERSION-linux-x64.tar.gz" | tar -zxf - --directory /opt/node
export PATH="/opt/node/node-$NODEJS_VERSION-linux-x64/bin:$PATH"
node --version
fi
install:
- yarn --frozen-lockfile $YARN_EXTRA_ARGS
- yarn link --frozen-lockfile $YARN_EXTRA_ARGS || true
- yarn link webpack --frozen-lockfile $YARN_EXTRA_ARGS
script: yarn travis:$JOB_PART
after_success:
- cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose
- bash <(curl -s https://codecov.io/bash) -F $JOB_PART -X gcov
- rm -f .jest-cache/haste-map* .jest-cache/perf-cache*
notifications:
slack:
secure: JduSdKWwbnLCwo7Z4E59SGE+Uw832UwnXzQiKEpg1BV45MYDPRiGltly1tRHmPh9OGjvGx3XSkC2tNGOBLtL4UL2SCkf012x0t7jDutKRfcv/njynl8jk8l+UhPmaWiHXDQAgGiiKdL4RfzPLW3HeVHCOWm0LKMzcarTa8tw+rE=

View File

@ -8,17 +8,14 @@
[![npm][npm]][npm-url]
[![node][node]][node-url]
[![deps][deps]][deps-url]
[![tests][tests]][tests-url]
[![builds][builds]][builds-url]
[![builds2][builds2]][builds2-url]
[![coverage][cover]][cover-url]
[![licenses][licenses]][licenses-url]
[![PR's welcome][prs]][prs-url]
<br>
<a href="https://dependabot.com/compatibility-score.html?dependency-name=webpack&package-manager=npm_and_yarn&new-version=latest">
<img src="https://api.dependabot.com/badges/compatibility_score?dependency-name=webpack&package-manager=npm_and_yarn&version-scheme=semver&target-version=latest">
<a href="https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates#about-compatibility-scores">
<img src="https://api.dependabot.com/badges/compatibility_score?dependency-name=webpack&package-manager=npm_and_yarn&previous-version=5.72.1&new-version=5.73.0">
</a>
<a href="https://npmcharts.com/compare/webpack?minimal=true">
<img src="https://img.shields.io/npm/dm/webpack.svg">
@ -38,6 +35,9 @@
<a href="https://gitter.im/webpack/webpack">
<img src="https://badges.gitter.im/webpack/webpack.svg">
</a>
<a href="https://twitter.com/Webpack">
<img src="https://img.shields.io/twitter/follow/Webpack?style=social">
</a>
<h1>webpack</h1>
<p>
Webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.
@ -112,6 +112,7 @@ within webpack itself use this plugin interface. This makes webpack very
| [mini-css-extract-plugin][mini-css] | ![mini-css-npm] | ![mini-css-size] | Extracts CSS into separate files. It creates a CSS file per JS file which contains CSS. |
| [compression-webpack-plugin][compression] | ![compression-npm] | ![compression-size] | Prepares compressed versions of assets to serve them with Content-Encoding |
| [html-webpack-plugin][html-plugin] | ![html-plugin-npm] | ![html-plugin-size] | Simplifies creation of HTML files (`index.html`) to serve your bundles |
| [pug-plugin][pug-plugin] | ![pug-plugin-npm] | ![pug-plugin-size] | Renders Pug files to HTML, extracts JS and CSS from sources specified directly in Pug. |
[common-npm]: https://img.shields.io/npm/v/webpack.svg
[mini-css]: https://github.com/webpack-contrib/mini-css-extract-plugin
@ -126,6 +127,9 @@ within webpack itself use this plugin interface. This makes webpack very
[html-plugin]: https://github.com/jantimon/html-webpack-plugin
[html-plugin-npm]: https://img.shields.io/npm/v/html-webpack-plugin.svg
[html-plugin-size]: https://packagephobia.com/badge?p=html-webpack-plugin
[pug-plugin]: https://github.com/webdiscus/pug-plugin
[pug-plugin-npm]: https://img.shields.io/npm/v/pug-plugin.svg
[pug-plugin-size]: https://packagephobia.com/badge?p=pug-plugin
### [Loaders](https://webpack.js.org/loaders/)
@ -157,11 +161,11 @@ or are automatically applied via regex from your webpack configuration.
#### Transpiling
| Name | Status | Install Size | Description |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------: | :------------: | :------------------------------------------------------------------------------------------------ |
| <a href="https://github.com/babel/babel-loader"><img width="48" height="48" title="babel-loader" src="https://worldvectorlogo.com/logos/babel-10.svg"></a> | ![babel-npm] | ![babel-size] | Loads ES2015+ code and transpiles to ES5 using <a href="https://github.com/babel/babel">Babel</a> |
| <a href="https://github.com/TypeStrong/ts-loader"><img width="48" height="48" src="https://cdn.rawgit.com/Microsoft/TypeScript/master/doc/logo.svg"></a> | ![type-npm] | ![type-size] | Loads TypeScript like JavaScript |
| <a href="https://github.com/webpack-contrib/coffee-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/coffeescript.svg"></a> | ![coffee-npm] | ![coffee-size] | Loads CoffeeScript like JavaScript |
| Name | Status | Install Size | Description |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------: | :------------: | :------------------------------------------------------------------------------------------------ |
| <a href="https://github.com/babel/babel-loader"><img width="48" height="48" title="babel-loader" src="https://worldvectorlogo.com/logos/babel-10.svg"></a> | ![babel-npm] | ![babel-size] | Loads ES2015+ code and transpiles to ES5 using <a href="https://github.com/babel/babel">Babel</a> |
| <a href="https://github.com/TypeStrong/ts-loader"><img width="48" height="48" src="https://raw.githubusercontent.com/microsoft/TypeScript-Website/f407e1ae19e5e990d9901ac8064a32a8cc60edf0/packages/typescriptlang-org/static/branding/ts-logo-128.svg"></a> | ![type-npm] | ![type-size] | Loads TypeScript like JavaScript |
| <a href="https://github.com/webpack-contrib/coffee-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/coffeescript.svg"></a> | ![coffee-npm] | ![coffee-size] | Loads CoffeeScript like JavaScript |
[babel-npm]: https://img.shields.io/npm/v/babel-loader.svg
[babel-size]: https://packagephobia.com/badge?p=babel-loader
@ -172,18 +176,21 @@ or are automatically applied via regex from your webpack configuration.
#### Templating
| Name | Status | Install Size | Description |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------: | :--------------: | :-------------------------------------------------------------------------------------- |
| <a href="https://github.com/webpack-contrib/html-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/html5.svg"></a> | ![html-npm] | ![html-size] | Exports HTML as string, requires references to static resources |
| <a href="https://github.com/pugjs/pug-loader"><img width="48" height="48" src="https://cdn.rawgit.com/pugjs/pug-logo/master/SVG/pug-final-logo-_-colour-128.svg"></a> | ![pug-npm] | ![pug-size] | Loads Pug templates and returns a function |
| <a href="https://github.com/peerigon/markdown-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/markdown.svg"></a> | ![md-npm] | ![md-size] | Compiles Markdown to HTML |
| <a href="https://github.com/posthtml/posthtml-loader"><img width="48" height="48" src="https://posthtml.github.io/posthtml/logo.svg"></a> | ![posthtml-npm] | ![posthtml-size] | Loads and transforms a HTML file using [PostHTML](https://github.com/posthtml/posthtml) |
| <a href="https://github.com/pcardune/handlebars-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/handlebars-1.svg"></a> | ![hbs-npm] | ![hbs-size] | Compiles Handlebars to HTML |
| Name | Status | Install Size | Description |
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------: | :--------------: | :-------------------------------------------------------------------------------------- |
| <a href="https://github.com/webpack-contrib/html-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/html5-2.svg"></a> | ![html-npm] | ![html-size] | Exports HTML as string, requires references to static resources |
| <a href="https://github.com/pugjs/pug-loader"><img width="48" height="48" src="https://cdn.rawgit.com/pugjs/pug-logo/master/SVG/pug-final-logo-_-colour-128.svg"></a> | ![pug-npm] | ![pug-size] | Loads Pug templates and returns a function |
| <a href="https://github.com/webdiscus/pug-loader"><img width="48" height="48" src="https://cdn.rawgit.com/pugjs/pug-logo/master/SVG/pug-final-logo-_-colour-128.svg"></a> | ![pug3-npm] | ![pug3-size] | Compiles Pug to a function or HTML string, useful for use with Vue, React, Angular |
| <a href="https://github.com/peerigon/markdown-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/markdown.svg"></a> | ![md-npm] | ![md-size] | Compiles Markdown to HTML |
| <a href="https://github.com/posthtml/posthtml-loader"><img width="48" height="48" src="https://posthtml.github.io/posthtml/logo.svg"></a> | ![posthtml-npm] | ![posthtml-size] | Loads and transforms a HTML file using [PostHTML](https://github.com/posthtml/posthtml) |
| <a href="https://github.com/pcardune/handlebars-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/handlebars-1.svg"></a> | ![hbs-npm] | ![hbs-size] | Compiles Handlebars to HTML |
[html-npm]: https://img.shields.io/npm/v/html-loader.svg
[html-size]: https://packagephobia.com/badge?p=html-loader
[pug-npm]: https://img.shields.io/npm/v/pug-loader.svg
[pug-size]: https://packagephobia.com/badge?p=pug-loader
[pug3-npm]: https://img.shields.io/npm/v/@webdiscus/pug-loader.svg
[pug3-size]: https://packagephobia.com/badge?p=@webdiscus/pug-loader
[jade-npm]: https://img.shields.io/npm/v/jade-loader.svg
[jade-size]: https://packagephobia.com/badge?p=jade-loader
[md-npm]: https://img.shields.io/npm/v/markdown-loader.svg
@ -689,7 +696,7 @@ src="https://static.monei.net/monei-logo.svg" height="30" alt="MONEI"></a>
- [@google](https://github.com/google) for [Google Web Toolkit (GWT)](http://www.gwtproject.org/), which aims to compile Java to JavaScript. It features a similar [Code Splitting](http://www.gwtproject.org/doc/latest/DevGuideCodeSplitting.html) as webpack.
- [@medikoo](https://github.com/medikoo) for [modules-webmake](https://github.com/medikoo/modules-webmake), which is a similar project. webpack was born because I wanted Code Splitting for modules-webmake. Interestingly the [Code Splitting issue is still open](https://github.com/medikoo/modules-webmake/issues/7) (thanks also to @Phoscur for the discussion).
- [@substack](https://github.com/substack) for [browserify](http://browserify.org/), which is a similar project and source for many ideas.
- [@substack](https://github.com/substack) for [browserify](https://browserify.org/), which is a similar project and source for many ideas.
- [@jrburke](https://github.com/jrburke) for [require.js](https://requirejs.org/), which is a similar project and source for many ideas.
- [@defunctzombie](https://github.com/defunctzombie) for the [browser-field spec](https://github.com/defunctzombie/package-browser-field-spec), which makes modules available for node.js, browserify and webpack.
- Every early webpack user, which contributed to webpack by writing issues or PRs. You influenced the direction...
@ -701,14 +708,8 @@ src="https://static.monei.net/monei-logo.svg" height="30" alt="MONEI"></a>
[npm-url]: https://npmjs.com/package/webpack
[node]: https://img.shields.io/node/v/webpack.svg
[node-url]: https://nodejs.org
[deps]: https://img.shields.io/david/webpack/webpack.svg
[deps-url]: https://david-dm.org/webpack/webpack
[tests]: https://img.shields.io/travis/webpack/webpack/main.svg
[tests-url]: https://travis-ci.org/webpack/webpack
[prs]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
[prs-url]: https://webpack.js.org/contribute/
[builds-url]: https://ci.appveyor.com/project/sokra/webpack/branch/main
[builds]: https://ci.appveyor.com/api/projects/status/github/webpack/webpack?svg=true
[builds2]: https://dev.azure.com/webpack/webpack/_apis/build/status/webpack.webpack
[builds2-url]: https://dev.azure.com/webpack/webpack/_build/latest?definitionId=3
[licenses-url]: https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fwebpack%2Fwebpack?ref=badge_shield

View File

@ -1,37 +0,0 @@
# appveyor file
# http://www.appveyor.com/docs/appveyor-yml
branches:
only:
- webpack-4
- main
- next
- dev-1
init:
- git config --global core.autocrlf input
cache:
- "..\\.yarn-cache"
- ".jest-cache"
install:
- ps: Install-Product node 14 x64
- yarn --frozen-lockfile --preferred-cache-folder ..\\.yarn-cache
- yarn link --frozen-lockfile --preferred-cache-folder ..\\.yarn-cache || yarn link --frozen-lockfile --preferred-cache-folder ..\\.yarn-cache
- yarn link webpack --frozen-lockfile --preferred-cache-folder ..\\.yarn-cache
build: off
matrix:
fast_finish: true
test_script:
- node --version
- yarn --version
- cmd: set JEST=--maxWorkers=2 --cacheDirectory .jest-cache
- cmd: yarn appveyor:integration
- cmd: yarn cover:report --reporter=lcovonly
- cmd: yarn unlink webpack
- cmd: yarn global add codecov && codecov -F integration --disable=gcov
- cmd: del /F /Q .jest-cache\\haste-map* .jest-cache\\perf-cache* 2> null || Ver > null

177
assembly/hash/md4.asm.ts Normal file
View File

@ -0,0 +1,177 @@
/*
** ********************************************************************
** md4.c -- Implementation of MD4 Message Digest Algorithm **
** Updated: 2/16/90 by Ronald L. Rivest **
** (C) 1990 RSA Data Security, Inc. **
** ********************************************************************
*/
// Ported to assemblyscript by Tobias Koppers
let totalLength: u32;
let A: u32;
let B: u32;
let C: u32;
let D: u32;
function F(x: u32, y: u32, z: u32): u32 {
return z ^ (x & (y ^ z));
}
function G(x: u32, y: u32, z: u32): u32 {
return (x & (y | z)) | (y & z);
}
function H(x: u32, y: u32, z: u32): u32 {
return x ^ y ^ z;
}
function roundF(a: u32, b: u32, c: u32, d: u32, i: u32, s: u32): u32 {
return rotl<u32>(a + F(b, c, d) + load<u32>(i), s);
}
function roundG(a: u32, b: u32, c: u32, d: u32, i: u32, s: u32): u32 {
return rotl<u32>(a + G(b, c, d) + load<u32>(i) + 0x5a827999, s);
}
function roundH(a: u32, b: u32, c: u32, d: u32, i: u32, s: u32): u32 {
return rotl<u32>(a + H(b, c, d) + load<u32>(i) + 0x6ed9eba1, s);
}
export function init(): void {
A = 0x67452301;
B = 0xefcdab89;
C = 0x98badcfe;
D = 0x10325476;
totalLength = 0;
}
function body(size: u32): void {
let _A = A;
let _B = B;
let _C = C;
let _D = D;
for (let i: u32 = 0; i < size; i += 64) {
let a = _A;
let b = _B;
let c = _C;
let d = _D;
// Round F
a = roundF(a, b, c, d, i + 4 * 0, 3);
d = roundF(d, a, b, c, i + 4 * 1, 7);
c = roundF(c, d, a, b, i + 4 * 2, 11);
b = roundF(b, c, d, a, i + 4 * 3, 19);
a = roundF(a, b, c, d, i + 4 * 4, 3);
d = roundF(d, a, b, c, i + 4 * 5, 7);
c = roundF(c, d, a, b, i + 4 * 6, 11);
b = roundF(b, c, d, a, i + 4 * 7, 19);
a = roundF(a, b, c, d, i + 4 * 8, 3);
d = roundF(d, a, b, c, i + 4 * 9, 7);
c = roundF(c, d, a, b, i + 4 * 10, 11);
b = roundF(b, c, d, a, i + 4 * 11, 19);
a = roundF(a, b, c, d, i + 4 * 12, 3);
d = roundF(d, a, b, c, i + 4 * 13, 7);
c = roundF(c, d, a, b, i + 4 * 14, 11);
b = roundF(b, c, d, a, i + 4 * 15, 19);
// Round G
a = roundG(a, b, c, d, i + 4 * 0, 3);
d = roundG(d, a, b, c, i + 4 * 4, 5);
c = roundG(c, d, a, b, i + 4 * 8, 9);
b = roundG(b, c, d, a, i + 4 * 12, 13);
a = roundG(a, b, c, d, i + 4 * 1, 3);
d = roundG(d, a, b, c, i + 4 * 5, 5);
c = roundG(c, d, a, b, i + 4 * 9, 9);
b = roundG(b, c, d, a, i + 4 * 13, 13);
a = roundG(a, b, c, d, i + 4 * 2, 3);
d = roundG(d, a, b, c, i + 4 * 6, 5);
c = roundG(c, d, a, b, i + 4 * 10, 9);
b = roundG(b, c, d, a, i + 4 * 14, 13);
a = roundG(a, b, c, d, i + 4 * 3, 3);
d = roundG(d, a, b, c, i + 4 * 7, 5);
c = roundG(c, d, a, b, i + 4 * 11, 9);
b = roundG(b, c, d, a, i + 4 * 15, 13);
// Round H
a = roundH(a, b, c, d, i + 4 * 0, 3);
d = roundH(d, a, b, c, i + 4 * 8, 9);
c = roundH(c, d, a, b, i + 4 * 4, 11);
b = roundH(b, c, d, a, i + 4 * 12, 15);
a = roundH(a, b, c, d, i + 4 * 2, 3);
d = roundH(d, a, b, c, i + 4 * 10, 9);
c = roundH(c, d, a, b, i + 4 * 6, 11);
b = roundH(b, c, d, a, i + 4 * 14, 15);
a = roundH(a, b, c, d, i + 4 * 1, 3);
d = roundH(d, a, b, c, i + 4 * 9, 9);
c = roundH(c, d, a, b, i + 4 * 5, 11);
b = roundH(b, c, d, a, i + 4 * 13, 15);
a = roundH(a, b, c, d, i + 4 * 3, 3);
d = roundH(d, a, b, c, i + 4 * 11, 9);
c = roundH(c, d, a, b, i + 4 * 7, 11);
b = roundH(b, c, d, a, i + 4 * 15, 15);
_A += a;
_B += b;
_C += c;
_D += d;
}
A = _A;
B = _B;
C = _C;
D = _D;
}
export function update(length: u32): void {
body(length);
totalLength += length;
}
export function final(length: u32): void {
const bits: u64 = u64(totalLength + length) << 3;
const finalLength: u32 = (length + 9 + 63) & ~63;
const bitsPosition = finalLength - 8;
// end
store<u8>(length++, 0x80);
// padding
for (; length & 7 && length < finalLength; length++) store<u8>(length, 0);
for (; length < finalLength; length += 8) store<u64>(length, 0);
// bits
store<u64>(bitsPosition, bits);
body(finalLength);
store<u64>(0, u32ToHex(A));
store<u64>(8, u32ToHex(B));
store<u64>(16, u32ToHex(C));
store<u64>(24, u32ToHex(D));
}
function u32ToHex(x: u64): u64 {
// from https://johnnylee-sde.github.io/Fast-unsigned-integer-to-hex-string/
x = ((x & 0xffff0000) << 16) | (x & 0xffff);
x = ((x & 0x0000ff000000ff00) << 8) | (x & 0x000000ff000000ff);
x = ((x & 0x00f000f000f000f0) >> 4) | ((x & 0x000f000f000f000f) << 8);
const mask = ((x + 0x0606060606060606) >> 4) & 0x0101010101010101;
x |= 0x3030303030303030;
x += 0x27 * mask;
return x;
}

View File

@ -108,8 +108,6 @@ export function final(length: u32): void {
result *= Prime3;
result ^= result >> 32;
store<u64>(0, result);
store<u64>(0, u32ToHex(result >> 32));
store<u64>(8, u32ToHex(result & 0xffffffff));
}

View File

@ -1,6 +1,4 @@
{
"extends": "assemblyscript/std/assembly.json",
"include": [
"./**/*.asm.ts"
]
"include": ["./**/*.asm.ts"]
}

View File

@ -60,7 +60,7 @@ jobs:
steps:
- task: NodeTool@0
inputs:
versionSpec: "^14.0.0"
versionSpec: "^16.0.0"
displayName: "Install Node.js"
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
@ -86,13 +86,7 @@ jobs:
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn -s run code-lint --format junit > junit.xml
yarn special-lint
yarn type-lint
yarn typings-lint
yarn yarn-lint
yarn pretty-lint
yarn spellcheck
yarn lint
env:
CI: "true"
displayName: "Run linting"
@ -147,8 +141,15 @@ jobs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
# Install old `jest` version and ignore platform problem for legacy node versions
- script: |
yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 @types/jest@^27.4.0 pretty-format@^27.0.2 --ignore-engines
yarn --frozen-lockfile --ignore-engines
displayName: "Install dependencies (old node.js version)"
condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0'))
- script: yarn --frozen-lockfile
displayName: "Install dependencies"
condition: and(not(eq(variables['node_version'], '^10.13.0')), not(eq(variables['node_version'], '^12.4.0')))
- script: yarn link --frozen-lockfile || true
displayName: "Link webpack"
continueOnError: true
@ -213,6 +214,16 @@ jobs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
# Install old `jest` version and ignore platform problem for legacy node versions
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 @types/jest@^27.4.0 pretty-format@^27.0.2 --ignore-engines
yarn --frozen-lockfile --ignore-engines
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies (old node.js version)"
condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0'), eq(variables['node_version'], '^14.0.0'))
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
@ -220,6 +231,7 @@ jobs:
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies"
condition: and(not(eq(variables['node_version'], '^10.13.0')), not(eq(variables['node_version'], '^12.4.0')), not(eq(variables['node_version'], '^14.0.0')))
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
@ -275,6 +287,15 @@ jobs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(YARN_CACHE_FOLDER)
displayName: "Cache Yarn packages"
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn upgrade jest@^27.5.0 jest-circus@^27.5.0 jest-cli@^27.5.0 jest-diff@^27.5.0 jest-environment-node@^27.5.0 jest-junit@^13.0.0 @types/jest@^27.4.0 pretty-format@^27.0.2 --ignore-engines
yarn --frozen-lockfile --ignore-engines
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies (old node.js version)"
condition: or(eq(variables['node_version'], '^10.13.0'), eq(variables['node_version'], '^12.4.0'))
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
@ -282,6 +303,7 @@ jobs:
yarn link --frozen-lockfile || true
yarn link webpack --frozen-lockfile
displayName: "Install dependencies"
condition: and(not(eq(variables['node_version'], '^10.13.0')), not(eq(variables['node_version'], '^12.4.0')))
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

39
benchmark/md4-cache.js Normal file
View File

@ -0,0 +1,39 @@
const createHash = require("../lib/util/createHash");
const compare = require("./micro-compare");
const size = 50;
const strings = [];
for (let count = 1; ; count *= 10) {
while (strings.length < count) {
const s = require("crypto").randomBytes(size).toString("hex");
strings.push(s);
const hash = createHash("native-md4");
hash.update(s);
hash.update(s);
hash.digest("hex");
}
let i = 0;
console.log(
`${count} different 200 char strings: ` +
compare(
"native md4",
() => {
const hash = createHash("native-md4");
const s = strings[(i = (i + 1) % strings.length)];
hash.update(s);
hash.update(s);
return hash.digest("hex");
},
"wasm md4",
() => {
const hash = createHash("md4");
const s = strings[(i = (i + 1) % strings.length)];
hash.update(s);
hash.update(s);
return hash.digest("hex");
}
)
);
}

49
benchmark/md4.js Normal file
View File

@ -0,0 +1,49 @@
const createHash = require("../lib/util/createHash");
const compare = require("./micro-compare");
for (const size of [
1, 10, 20, 40, 60, 80, 100, 200, 400, 1000, 1001, 5000, 8183, 8184, 8185,
10000, 20000, 32768, 32769, 50000, 100000, 200000
]) {
const longString = require("crypto").randomBytes(size).toString("hex");
const buffer = require("crypto").randomBytes(size * 2);
console.log(
`string ${longString.length} chars: ` +
compare(
"native md4",
() => {
const hash = createHash("native-md4");
hash.update(longString);
hash.update(longString);
return hash.digest("hex");
},
"wasm md4",
() => {
const hash = createHash("md4");
hash.update(longString);
hash.update(longString);
return hash.digest("hex");
}
)
);
console.log(
`buffer ${buffer.length} bytes: ` +
compare(
"native md4",
() => {
const hash = createHash("native-md4");
hash.update(buffer);
hash.update(buffer);
return hash.digest("hex");
},
"wasm md4",
() => {
const hash = createHash("md4");
hash.update(buffer);
hash.update(buffer);
return hash.digest("hex");
}
)
);
}

View File

@ -0,0 +1,44 @@
let result;
const measure = (fn, count) => {
const start = process.hrtime.bigint();
for (let i = 0; i < count; i++) result = fn();
return Number(process.hrtime.bigint() - start);
};
const NS_PER_MS = 1000000; // 1ms
const MIN_DURATION = 100 * NS_PER_MS; // 100ms
const MAX_DURATION = 1000 * NS_PER_MS; // 1000ms
const MAX_WARMUP_DURATION = 1 * NS_PER_MS; // 1ms
const format = (fast, slow, fastName, slowName, count) => {
return `${fastName} is ${
Math.round(((slow - fast) * 1000) / slow) / 10
}% faster than ${slowName} (${Math.round(fast / 100 / count) / 10} µs vs ${
Math.round(slow / 100 / count) / 10
} µs, ${count}x)`;
};
const compare = (n1, f1, n2, f2) => {
let count = 1;
while (true) {
const timings = [f1, f2, f1, f2, f1, f2].map(f => measure(f, count));
const t1 = Math.min(timings[0], timings[2], timings[4]);
const t2 = Math.min(timings[1], timings[3], timings[5]);
if (count === 1 && (t1 > MAX_WARMUP_DURATION || t2 > MAX_WARMUP_DURATION)) {
continue;
}
if (
(t1 > MIN_DURATION && t2 > MIN_DURATION) ||
t1 > MAX_DURATION ||
t2 > MAX_DURATION
) {
return t1 > t2
? format(t2, t1, n2, n1, count)
: format(t1, t2, n1, n2, count);
}
count *= 2;
}
};
module.exports = compare;

View File

@ -0,0 +1,45 @@
const createHash = require("../lib/util/createHash");
const compare = require("./micro-compare");
for (const size of [
1, 10, 20, 40, 60, 80, 100, 200, 400, 1000, 1001, 5000, 8183, 8184, 8185,
10000, 20000, 32768, 32769, 50000, 100000, 200000
]) {
const longString = require("crypto").randomBytes(size).toString("hex");
const buffer = require("crypto").randomBytes(size * 2);
console.log(
`string ${longString.length} chars: ` +
compare(
"wasm xxhash64",
() => {
const hash = createHash("xxhash64");
hash.update(longString);
return hash.digest("hex");
},
"wasm md4",
() => {
const hash = createHash("md4");
hash.update(longString);
return hash.digest("hex");
}
)
);
console.log(
`buffer ${buffer.length} bytes: ` +
compare(
"wasm xxhash64",
() => {
const hash = createHash("xxhash64");
hash.update(buffer);
return hash.digest("hex");
},
"wasm md4",
() => {
const hash = createHash("md4");
hash.update(buffer);
return hash.digest("hex");
}
)
);
}

49
benchmark/xxhash64.js Normal file
View File

@ -0,0 +1,49 @@
const createHash = require("../lib/util/createHash");
const compare = require("./micro-compare");
for (const size of [
1, 10, 20, 40, 60, 80, 100, 200, 400, 1000, 1001, 5000, 8183, 8184, 8185,
10000, 20000, 32768, 32769, 50000, 100000, 200000
]) {
const longString = require("crypto").randomBytes(size).toString("hex");
const buffer = require("crypto").randomBytes(size * 2);
console.log(
`string ${longString.length} chars: ` +
compare(
"wasm xxhash64",
() => {
const hash = createHash("xxhash64");
hash.update(longString);
hash.update(longString);
return hash.digest("hex");
},
"native md4",
() => {
const hash = createHash("native-md4");
hash.update(longString);
hash.update(longString);
return hash.digest("hex");
}
)
);
console.log(
`buffer ${buffer.length} bytes: ` +
compare(
"wasm xxhash64",
() => {
const hash = createHash("xxhash64");
hash.update(buffer);
hash.update(buffer);
return hash.digest("hex");
},
"native md4",
() => {
const hash = createHash("native-md4");
hash.update(buffer);
hash.update(buffer);
return hash.digest("hex");
}
)
);
}

View File

@ -53,6 +53,19 @@ const isInstalled = packageName => {
}
} while (dir !== (dir = path.dirname(dir)));
// https://github.com/nodejs/node/blob/v18.9.1/lib/internal/modules/cjs/loader.js#L1274
// eslint-disable-next-line no-warning-comments
// @ts-ignore
for (const internalPath of require("module").globalPaths) {
try {
if (fs.statSync(path.join(internalPath, packageName)).isDirectory()) {
return true;
}
} catch (_error) {
// Nothing
}
}
return false;
};

View File

@ -1,241 +1,316 @@
{
"version": "0.1",
"version": "0.2",
"language": "en",
"words": [
"webpack",
"webpack's",
"endregion",
"entrypoint",
"entrypoints",
"splitted",
"dedupe",
"deduplication",
"deduplicating",
"unoptimized",
"prefetch",
"prefetching",
"prefetched",
"preload",
"preloading",
"preloaded",
"gzipping",
"brotli",
"submodule",
"submodules",
"typeof",
"devtool",
"wasi",
"wasm",
"webassembly",
"IIFE",
"IIFE's",
"bigint",
"unexception",
"etag",
"builtins",
"uncacheable",
"cacheable",
"mergeable",
"devtools",
"transpiled",
"mixins",
"subdir",
"errored",
"eval",
"multiplicator",
"finalizer",
"promisify",
"absolutify",
"camelcase",
"filebase",
"moduleid",
"modulehash",
"chunkfilename",
"chunkname",
"chunkhash",
"fullhash",
"contenthash",
"hashable",
"hotupdatechunk",
"middleware",
"middlewares",
"serializer",
"serializers",
"deserialization",
"referenceable",
"polyfilled",
"transpiling",
"transpile",
"transpiles",
"snapshotting",
"sourcemap",
"nosources",
"filepath",
"subpath",
"pathinfo",
"undelayed",
"microtask",
"microtasks",
"deopt",
"deopts",
"sandboxed",
"mangleable",
"passthrough",
"prioritise",
"booleanized",
"serializables",
"unreviewed",
"unshifted",
"nonrecursive",
"symlinked",
"subfolder",
"prettierrc",
"templated",
"templating",
"kibibytes",
"mebibytes",
"gibibytes",
"typechecker",
"recurse",
"preparsed",
"acircular",
"amdmodule",
"analyse",
"analysed",
"asmjs",
"assemblyscript",
"asyncloader",
"atlaskit",
"autocrlf",
"lcov",
"lcovonly",
"gcov",
"lintunit",
"instanceof",
"loglevel",
"runtime",
"runtimes",
"mimetype",
"testvalue",
"unusedkey",
"unusedvalue",
"performant",
"watchings",
"jsons",
"exitance",
"ident",
"idents",
"globstar",
"inversed",
"concated",
"RBDT",
"opensource",
"babeljs",
"backport",
"backported",
"basictest",
"bigint",
"bindgen",
"Biró",
"bitfield",
"bomfile",
"booleanized",
"boolish",
"brotli",
"browserified",
"browserslist",
"browserslistrc",
"Brumme",
"bugfix",
"bugfixes",
"declarators",
"rrrlll",
"undefine",
"finializer",
"quasis",
"hashs",
"functype",
"funcindex",
"Descr",
"valtype",
"informations",
"reexecuted",
"global's",
"unsplittable",
"builtins",
"cacheable",
"callme",
"camelcase",
"chainable",
"metacharacters",
"Xarray",
"Xfactory",
"Xmodule",
"Xexports",
"moji",
"bitfield",
"precompute",
"toplevel",
"modulos",
"untaint",
"ufeff",
"timestamping",
"loadername",
"laof",
"chunkfilename",
"chunkhash",
"chunkname",
"cmodule",
"codecov",
"cofounder",
"hashchange",
"popstate",
"hotpink",
"navigations",
"Collet's",
"compat",
"noimport",
"tmpl",
"concated",
"contenthash",
"contextifies",
"crossorigin",
"csvg",
"repo",
"repos",
"triaging",
"valign",
"returnfalse",
"return'development",
"datastructures",
"prewalking",
"overridables",
"overridable",
"cujojs",
"Dani",
"darkblue",
"darkgreen",
"darkred",
"eqeqeq",
"boolish",
"analysing",
"etags",
"datastructures",
"declarators",
"dedupe",
"deduplicating",
"deduplication",
"defunctzombie",
"deopt",
"deopts",
"dependabot",
"Descr",
"deserialization",
"destructure",
"onconnect",
"nwjs",
"redeclaration",
"kaios",
"parallelism",
"gitattributes",
"hashbang",
"webassemblyjs",
"assemblyscript",
"fsevents",
"watchpack",
"tapable",
"junit",
"memfs",
"rimraf",
"devtool",
"devtools",
"donotcallme",
"endregion",
"entrypoint",
"entrypoints",
"Eoksni",
"eqeqeq",
"errored",
"esmodule",
"estree",
"posthtml",
"etag",
"etags",
"eval",
"Ewald",
"exitance",
"filebase",
"fileoverview",
"filepath",
"finalizer",
"fsevents",
"fullhash",
"funcindex",
"functype",
"gcov",
"gibibytes",
"gitattributes",
"gitter",
"global's",
"globstar",
"gzipping",
"hashable",
"hashbang",
"hashchange",
"hashs",
"hotpink",
"hotupdatechunk",
"ident",
"idents",
"IIFE's",
"IIFE",
"informations",
"instanceof",
"inversed",
"jhnns",
"jrburke",
"jsfile",
"jsons",
"junit",
"Junya",
"kaios",
"Kees",
"kibibytes",
"Kluskens",
"Koppers",
"laof",
"Larkin",
"lcov",
"lcovonly",
"lintunit",
"loadername",
"loglevel",
"longnameforexport",
"mangleable",
"MCEP",
"mebibytes",
"medikoo",
"membertest",
"memfs",
"mergeable",
"metacharacters",
"microtask",
"microtasks",
"middleware",
"middlewares",
"mimetype",
"mixins",
"modulehash",
"moduleid",
"modulos",
"moji",
"MONEI",
"mult",
"multiplicator",
"mylibrary",
"mynamespace",
"navigations",
"nmodule",
"noimport",
"nonexistentfile",
"nonrecursive",
"nosource",
"nosources",
"nwjs",
"onconnect",
"opencollective",
"opensource",
"opuuus",
"overridable",
"overridables",
"parallelism",
"passthrough",
"pathinfo",
"performant",
"Phoscur",
"pmodule",
"pnpm",
"polyfilled",
"popstate",
"posthtml",
"precompute",
"prefetch",
"prefetched",
"prefetching",
"preload",
"preloaded",
"preloading",
"preparsed",
"preprocess",
"prettierrc",
"prewalking",
"prioritise",
"promisify",
"quasis",
"queryloader",
"querystrings",
"RBDT",
"reconsume",
"recurse",
"redeclaration",
"reexecuted",
"referenceable",
"referencer",
"repo",
"repos",
"return'development",
"returnfalse",
"revparse",
"rimraf",
"Rivest",
"rrrlll",
"runtime",
"runtimes",
"samsunginternet",
"sandboxed",
"serializables",
"serializer",
"serializers",
"shama",
"skypack",
"snapshotting",
"sokra",
"somepackage",
"somepath",
"sourcemap",
"sourcemapped",
"splitted",
"stylesheet",
"subdir",
"subfolder",
"submodule",
"submodules",
"subpath",
"substack",
"symlinked",
"syncloader",
"systemjs",
"tapable",
"templated",
"templating",
"testcase",
"testlink",
"testloader",
"testvalue",
"timestamping",
"tmpl",
"toplevel",
"traceur",
"atlaskit",
"transpile",
"transpiled",
"transpiles",
"transpiling",
"triaging",
"Tshs",
"typechecker",
"typeof",
"ufeff",
"uncacheable",
"undefine",
"undelayed",
"unexception",
"unoptimized",
"unreviewed",
"unshifted",
"unsplittable",
"untaint",
"unusedkey",
"unusedvalue",
"url's",
"valign",
"valtype",
"wasi",
"wasm",
"watchings",
"watchpack",
"webassembly",
"webassemblyjs",
"webmake",
"webpack's",
"webpack",
"Xarray",
"Xexports",
"Xfactory",
"Xmodule",
"xxhash",
"xxhashjs",
"systemjs",
"skypack",
"sokra",
"Koppers",
"Junya",
"Eoksni",
"Ewald",
"Larkin",
"Kees",
"Kluskens",
"Phoscur",
"defunctzombie",
"shama",
"jhnns",
"substack",
"MONEI",
"medikoo",
"webmake",
"jrburke",
"gitter",
"codecov",
"opencollective",
"dependabot",
"browserslist",
"samsunginternet",
"pnpm"
"Yann"
],
"ignoreRegExpList": [
"/Author.+/",
"/data:.*/",
"/\"mappings\":\".+\"/",
"/toMatchInlineSnapshot\\(\\s*`[^`]*`\\s*\\)/"
],
"ignoreRegExpList": ["/Author.+/", "/data:.*/", "/\"mappings\":\".+\"/"],
"ignorePaths": [
"**/dist/**",
"examples/**/README.md",
"**/webpack.lock.data/**"
"examples/wasm-bindgen*/pkg/*_bg.js",
"examples/wasm-bindgen*/pkg/*_bg*.d.ts",
"**/webpack.lock.data/**",
"package.json",
"yarn.lock",
"types.d.ts",
"**/**/*.snap",
"test/cases/json/weird-properties/globals.json",
"test/JavascriptParser.unittest.js",
"**/*.svg",
"*.log",
"**/*.wasm",
"coverage/**",
"test/**/module.js",
"test/js/**",
"test/cases/**",
"test/configCases/**",
"test/statsCases/**",
"test/fixtures/**",
"test/memoryLimitCases/**"
]
}

14
declarations.d.ts vendored
View File

@ -204,7 +204,7 @@ declare module "@webassemblyjs/ast" {
raw?: string
): FloatLiteral;
export function global(globalType: string, nodes: Node[]): Global;
export function identifier(indentifier: string): Identifier;
export function identifier(identifier: string): Identifier;
export function funcParam(valType: string, id: Identifier): FuncParam;
export function instruction(inst: string, args?: Node[]): Instruction;
export function callInstruction(funcIndex: Index): CallInstruction;
@ -246,10 +246,20 @@ declare module "@webassemblyjs/ast" {
declare module "webpack-sources" {
export type MapOptions = { columns?: boolean; module?: boolean };
export type RawSourceMap = {
version: number;
sources: string[];
names: string[];
sourceRoot?: string;
sourcesContent?: string[];
mappings: string;
file: string;
};
export abstract class Source {
size(): number;
map(options?: MapOptions): Object;
map(options?: MapOptions): RawSourceMap | null;
sourceAndMap(options?: MapOptions): {
source: string | Buffer;

View File

@ -5,6 +5,7 @@ import type { ResolveOptionsWithDependencyType } from "../lib/ResolverFactory";
import type Compilation from "../lib/Compilation";
import type Compiler from "../lib/Compiler";
import type NormalModule from "../lib/NormalModule";
import type Hash from "../lib/util/Hash";
import type { InputFileSystem } from "../lib/util/fs";
import type { Logger } from "../lib/logging/Logger";
import type {
@ -39,6 +40,7 @@ export interface NormalModuleLoaderContext<OptionsType> {
utils: {
absolutify: (context: string, request: string) => string;
contextify: (context: string, request: string) => string;
createHash: (algorithm?: string) => Hash;
};
rootContext: string;
fs: InputFileSystem;
@ -185,6 +187,7 @@ export interface LoaderRunnerLoaderContext<OptionsType> {
data: object | undefined;
pitchExecuted: boolean;
normalExecuted: boolean;
type?: "commonjs" | "module" | undefined;
}[];
/**
@ -210,6 +213,12 @@ export interface LoaderRunnerLoaderContext<OptionsType> {
* Example: "/abc/resource.js?query#frag"
*/
resource: string;
/**
* Target of compilation.
* Example: "web"
*/
target: string;
}
type AdditionalData = {

View File

@ -82,6 +82,10 @@ export type FilenameTemplate =
* Specifies the layer in which modules of this entrypoint are placed.
*/
export type Layer = null | string;
/**
* Add a container for define/require functions in the AMD module.
*/
export type AmdContainer = string;
/**
* Add a comment in the UMD wrapper.
*/
@ -95,7 +99,7 @@ export type LibraryExport = string[] | string;
*/
export type LibraryName = string[] | string | LibraryCustomUmdObject;
/**
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
*/
export type LibraryType =
| (
@ -110,6 +114,7 @@ export type LibraryType =
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "commonjs-static"
| "amd"
| "amd-require"
| "umd"
@ -153,6 +158,10 @@ export type WasmLoadingType =
* An entry point without name.
*/
export type EntryUnnamed = EntryItem;
/**
* Enables/Disables experiments (experimental features with relax SemVer compatibility).
*/
export type Experiments = ExperimentsCommon & ExperimentsExtra;
/**
* Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.
*/
@ -185,6 +194,7 @@ export type ExternalsType =
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "commonjs-static"
| "amd"
| "amd-require"
| "umd"
@ -439,6 +449,14 @@ export type CompareBeforeEmit = boolean;
* This option enables cross-origin loading of chunks.
*/
export type CrossOriginLoading = false | "anonymous" | "use-credentials";
/**
* Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
export type CssChunkFilename = FilenameTemplate;
/**
* Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
export type CssFilename = FilenameTemplate;
/**
* Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
*/
@ -555,6 +573,10 @@ export type UniqueName = string;
* The filename of WebAssembly modules as relative path inside the 'output.path' directory.
*/
export type WebassemblyModuleFilename = string;
/**
* Worker public path. Much like the public path, this sets the location where the worker script file is intended to be found. If not set, webpack will use the publicPath. Don't set this option unless your worker scripts are located at a different path from your other script files.
*/
export type WorkerPublicPath = string;
/**
* The number of parallel processed modules in the compilation.
*/
@ -667,7 +689,7 @@ export type AssetGeneratorDataUrl =
| AssetGeneratorDataUrlOptions
| AssetGeneratorDataUrlFunction;
/**
* Function that executes for module and should return an DataUrl string.
* Function that executes for module and should return an DataUrl string. It can have a string as 'ident' property which contributes to the module hash.
*/
export type AssetGeneratorDataUrlFunction = (
source: string | Buffer,
@ -678,6 +700,15 @@ export type AssetGeneratorDataUrlFunction = (
*/
export type AssetGeneratorOptions = AssetInlineGeneratorOptions &
AssetResourceGeneratorOptions;
/**
* Emit the asset in the specified folder relative to 'output.path'. This should only be needed when custom 'publicPath' is specified to match the folder structure there.
*/
export type AssetModuleOutputPath =
| string
| ((
pathData: import("../lib/Compilation").PathData,
assetInfo?: import("../lib/Compilation").AssetInfo
) => string);
/**
* Function that executes for module and should return whenever asset should be inlined as DataUrl.
*/
@ -693,6 +724,11 @@ export type EntryDynamicNormalized = () => Promise<EntryStaticNormalized>;
* The entry point(s) of the compilation.
*/
export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
/**
* Enables/Disables experiments (experimental features with relax SemVer compatibility).
*/
export type ExperimentsNormalized = ExperimentsCommon &
ExperimentsNormalizedExtra;
/**
* The dependency used for the external.
*/
@ -703,6 +739,18 @@ export type ExternalItemValue =
| {
[k: string]: any;
};
/**
* List of allowed URIs for building http resources.
*/
export type HttpUriAllowedUris = HttpUriOptionsAllowedUris;
/**
* List of allowed URIs (resp. the beginning of them).
*/
export type HttpUriOptionsAllowedUris = (
| RegExp
| string
| ((uri: string) => boolean)
)[];
/**
* Ignore specific warnings.
*/
@ -941,11 +989,11 @@ export interface FileCacheOptions {
/**
* List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
*/
immutablePaths?: string[];
immutablePaths?: (RegExp | string)[];
/**
* List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
*/
managedPaths?: string[];
managedPaths?: (RegExp | string)[];
/**
* Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
*/
@ -998,6 +1046,14 @@ export interface EntryObject {
* An object with entry point description.
*/
export interface EntryDescription {
/**
* Enable/disable creating async chunks that are loaded on demand.
*/
asyncChunks?: boolean;
/**
* Base uri for this entry.
*/
baseUri?: string;
/**
* The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
*/
@ -1039,6 +1095,10 @@ export interface EntryDescription {
* Options for library.
*/
export interface LibraryOptions {
/**
* Add a container for define/require functions in the AMD module.
*/
amdContainer?: AmdContainer;
/**
* Add a comment in the UMD wrapper.
*/
@ -1052,7 +1112,7 @@ export interface LibraryOptions {
*/
name?: LibraryName;
/**
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
*/
type: LibraryType;
/**
@ -1098,104 +1158,6 @@ export interface LibraryCustomUmdObject {
*/
root?: string[] | string;
}
/**
* Enables/Disables experiments (experimental features with relax SemVer compatibility).
*/
export interface Experiments {
/**
* Allow module type 'asset' to generate assets.
*/
asset?: boolean;
/**
* Support WebAssembly as asynchronous EcmaScript Module.
*/
asyncWebAssembly?: boolean;
/**
* Build http(s): urls using a lockfile and resource content cache.
*/
buildHttp?: boolean | HttpUriOptions;
/**
* Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
*/
cacheUnaffected?: boolean;
/**
* Apply defaults of next major version.
*/
futureDefaults?: boolean;
/**
* Enable module and chunk layers.
*/
layers?: boolean;
/**
* Compile entrypoints and import()s only when they are accessed.
*/
lazyCompilation?:
| boolean
| {
/**
* A custom backend.
*/
backend?:
| ((
compiler: import("../lib/Compiler"),
client: string,
callback: (err?: Error, api?: any) => void
) => void)
| ((
compiler: import("../lib/Compiler"),
client: string
) => Promise<any>);
/**
* A custom client.
*/
client?: string;
/**
* Enable/disable lazy compilation for entries.
*/
entries?: boolean;
/**
* Enable/disable lazy compilation for import() modules.
*/
imports?: boolean;
/**
* Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
*/
test?: RegExp | string | ((module: import("../lib/Module")) => boolean);
};
/**
* Allow output javascript files as module source type.
*/
outputModule?: boolean;
/**
* Support WebAssembly as synchronous EcmaScript Module (outdated).
*/
syncWebAssembly?: boolean;
/**
* Allow using top-level-await in EcmaScript Modules.
*/
topLevelAwait?: boolean;
}
/**
* Options for building http resources.
*/
export interface HttpUriOptions {
/**
* Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
*/
cacheLocation?: false | string;
/**
* When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
*/
frozen?: boolean;
/**
* Location of the lockfile.
*/
lockfileLocation?: string;
/**
* When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
*/
upgrade?: boolean;
}
/**
* Enable presets of externals for specific targets.
*/
@ -1555,6 +1517,15 @@ export interface ResolveOptions {
* Field names from the description file (usually package.json) which are used to provide entry points of a package.
*/
exportsFields?: string[];
/**
* An object which maps extension to extension aliases.
*/
extensionAlias?: {
/**
* Extension alias.
*/
[k: string]: string[] | string;
};
/**
* Extensions added to the request when trying to find the file.
*/
@ -1812,6 +1783,12 @@ export interface OptimizationSplitChunksOptions {
* Sets the name delimiter for created chunks.
*/
automaticNameDelimiter?: string;
/**
* Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
*/
chunks?:
| ("initial" | "async" | "all")
| ((chunk: import("../lib/Chunk")) => boolean);
/**
* Maximal size hint for the on-demand chunks.
*/
@ -1828,6 +1805,10 @@ export interface OptimizationSplitChunksOptions {
* Minimal size for the created chunk.
*/
minSize?: OptimizationSplitChunksSizes;
/**
* Minimum size reduction due to the created chunk.
*/
minSizeReduction?: OptimizationSplitChunksSizes;
};
/**
* Sets the template for the filename for created chunks.
@ -1874,6 +1855,10 @@ export interface OptimizationSplitChunksOptions {
* Minimal size for the created chunks.
*/
minSize?: OptimizationSplitChunksSizes;
/**
* Minimum size reduction due to the created chunk.
*/
minSizeReduction?: OptimizationSplitChunksSizes;
/**
* Give chunks created a name (chunks with equal name are merged).
*/
@ -1954,6 +1939,10 @@ export interface OptimizationSplitChunksCacheGroup {
* Minimal size for the created chunk.
*/
minSize?: OptimizationSplitChunksSizes;
/**
* Minimum size reduction due to the created chunk.
*/
minSizeReduction?: OptimizationSplitChunksSizes;
/**
* Give chunks for this cache group a name (chunks with equal name are merged).
*/
@ -1983,10 +1972,18 @@ export interface OptimizationSplitChunksCacheGroup {
* Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
*/
export interface Output {
/**
* Add a container for define/require functions in the AMD module.
*/
amdContainer?: AmdContainer;
/**
* The filename of asset modules as relative path inside the 'output.path' directory.
*/
assetModuleFilename?: AssetModuleFilename;
/**
* Enable/disable creating async chunks that are loaded on demand.
*/
asyncChunks?: boolean;
/**
* Add a comment in the UMD wrapper.
*/
@ -2027,6 +2024,14 @@ export interface Output {
* This option enables cross-origin loading of chunks.
*/
crossOriginLoading?: CrossOriginLoading;
/**
* Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
cssChunkFilename?: CssChunkFilename;
/**
* Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
cssFilename?: CssFilename;
/**
* Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
*/
@ -2112,7 +2117,7 @@ export interface Output {
*/
libraryExport?: LibraryExport;
/**
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
*/
libraryTarget?: LibraryType;
/**
@ -2175,6 +2180,10 @@ export interface Output {
* The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
*/
workerChunkLoading?: ChunkLoading;
/**
* Worker public path. Much like the public path, this sets the location where the worker script file is intended to be found. If not set, webpack will use the publicPath. Don't set this option unless your worker scripts are located at a different path from your other script files.
*/
workerPublicPath?: WorkerPublicPath;
/**
* The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
*/
@ -2225,6 +2234,14 @@ export interface Environment {
* The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
*/
module?: boolean;
/**
* The environment supports optional chaining ('obj?.a' or 'obj?.()').
*/
optionalChaining?: boolean;
/**
* The environment supports template literals.
*/
templateLiteral?: boolean;
}
/**
* Use a Trusted Types policy to create urls for chunks.
@ -2276,11 +2293,11 @@ export interface SnapshotOptions {
/**
* List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
*/
immutablePaths?: string[];
immutablePaths?: (RegExp | string)[];
/**
* List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
*/
managedPaths?: string[];
managedPaths?: (RegExp | string)[];
/**
* Options for snapshotting dependencies of modules to determine if they need to be built again.
*/
@ -2468,6 +2485,10 @@ export interface StatsOptions {
* Add errors count.
*/
errorsCount?: boolean;
/**
* Space to display errors (value is in number of lines).
*/
errorsSpace?: number;
/**
* Please use excludeModules instead.
*/
@ -2652,6 +2673,10 @@ export interface StatsOptions {
* Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
*/
warningsFilter?: WarningFilterTypes;
/**
* Space to display warnings (value is in number of lines).
*/
warningsSpace?: number;
}
/**
* Options for the watcher.
@ -2730,11 +2755,32 @@ export interface AssetResourceGeneratorOptions {
* Specifies the filename template of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
filename?: FilenameTemplate;
/**
* Emit the asset in the specified folder relative to 'output.path'. This should only be needed when custom 'publicPath' is specified to match the folder structure there.
*/
outputPath?: AssetModuleOutputPath;
/**
* The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
*/
publicPath?: RawPublicPath;
}
/**
* Options for css handling.
*/
export interface CssExperimentOptions {
/**
* Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
*/
exportsOnly?: boolean;
}
/**
* Generator options for css modules.
*/
export interface CssGeneratorOptions {}
/**
* Parser options for css modules.
*/
export interface CssParserOptions {}
/**
* No generator options are supported for this module type.
*/
@ -2747,6 +2793,14 @@ export interface EmptyParserOptions {}
* An object with entry point description.
*/
export interface EntryDescriptionNormalized {
/**
* Enable/disable creating async chunks that are loaded on demand.
*/
asyncChunks?: boolean;
/**
* Base uri for this entry.
*/
baseUri?: string;
/**
* The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
*/
@ -2793,6 +2847,43 @@ export interface EntryStaticNormalized {
*/
[k: string]: EntryDescriptionNormalized;
}
/**
* Enables/Disables experiments (experimental features with relax SemVer compatibility).
*/
export interface ExperimentsCommon {
/**
* Support WebAssembly as asynchronous EcmaScript Module.
*/
asyncWebAssembly?: boolean;
/**
* Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
*/
backCompat?: boolean;
/**
* Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
*/
cacheUnaffected?: boolean;
/**
* Apply defaults of next major version.
*/
futureDefaults?: boolean;
/**
* Enable module layers.
*/
layers?: boolean;
/**
* Allow output javascript files as module source type.
*/
outputModule?: boolean;
/**
* Support WebAssembly as synchronous EcmaScript Module (outdated).
*/
syncWebAssembly?: boolean;
/**
* Allow using top-level-await in EcmaScript Modules.
*/
topLevelAwait?: boolean;
}
/**
* Data object passed as argument when a function is set for 'externals'.
*/
@ -2826,6 +2917,35 @@ export interface ExternalItemFunctionData {
*/
request?: string;
}
/**
* Options for building http resources.
*/
export interface HttpUriOptions {
/**
* List of allowed URIs (resp. the beginning of them).
*/
allowedUris: HttpUriOptionsAllowedUris;
/**
* Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
*/
cacheLocation?: false | string;
/**
* When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
*/
frozen?: boolean;
/**
* Location of the lockfile.
*/
lockfileLocation?: string;
/**
* Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
*/
proxy?: string;
/**
* When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
*/
upgrade?: boolean;
}
/**
* Parser options for javascript modules.
*/
@ -2846,6 +2966,26 @@ export interface JavascriptParserOptions {
* Enable/disable parsing of magic comments in CommonJs syntax.
*/
commonjsMagicComments?: boolean;
/**
* Enable/disable parsing "import { createRequire } from "module"" and evaluating createRequire().
*/
createRequire?: boolean | string;
/**
* Specifies global mode for dynamic import.
*/
dynamicImportMode?: "eager" | "weak" | "lazy" | "lazy-once";
/**
* Specifies global prefetch for dynamic import.
*/
dynamicImportPrefetch?: number | boolean;
/**
* Specifies global preload for dynamic import.
*/
dynamicImportPreload?: number | boolean;
/**
* Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
*/
exportsPresence?: "error" | "warn" | "auto" | false;
/**
* Enable warnings for full dynamic dependencies.
*/
@ -2870,10 +3010,26 @@ export interface JavascriptParserOptions {
* Enable/disable parsing of import() syntax.
*/
import?: boolean;
/**
* Specifies the behavior of invalid export names in "import ... from ...".
*/
importExportsPresence?: "error" | "warn" | "auto" | false;
/**
* Enable/disable evaluating import.meta.
*/
importMeta?: boolean;
/**
* Enable/disable evaluating import.meta.webpackContext.
*/
importMetaContext?: boolean;
/**
* Include polyfills or mocks for various node stuff.
*/
node?: Node;
/**
* Specifies the behavior of invalid export names in "export ... from ...". This might be useful to disable during the migration from "export ... from ..." to "export type ... from ..." when reexporting types in TypeScript.
*/
reexportExportsPresence?: "error" | "warn" | "auto" | false;
/**
* Enable/disable parsing of require.context syntax.
*/
@ -2891,7 +3047,7 @@ export interface JavascriptParserOptions {
*/
requireJs?: boolean;
/**
* Emit errors instead of warnings when imported names don't exist in imported module.
* Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
*/
strictExportPresence?: boolean;
/**
@ -2940,6 +3096,66 @@ export interface JavascriptParserOptions {
wrappedContextRegExp?: RegExp;
[k: string]: any;
}
/**
* Options for the default backend.
*/
export interface LazyCompilationDefaultBackendOptions {
/**
* A custom client.
*/
client?: string;
/**
* Specifies where to listen to from the server.
*/
listen?:
| number
| import("net").ListenOptions
| ((server: import("net").Server) => void);
/**
* Specifies the protocol the client should use to connect to the server.
*/
protocol?: "http" | "https";
/**
* Specifies how to create the server handling the EventSource requests.
*/
server?:
| (import("https").ServerOptions | import("http").ServerOptions)
| (() => import("net").Server);
}
/**
* Options for compiling entrypoints and import()s only when they are accessed.
*/
export interface LazyCompilationOptions {
/**
* Specifies the backend that should be used for handling client keep alive.
*/
backend?:
| (
| ((
compiler: import("../lib/Compiler"),
callback: (
err?: Error,
api?: import("../lib/hmr/LazyCompilationPlugin").BackendApi
) => void
) => void)
| ((
compiler: import("../lib/Compiler")
) => Promise<import("../lib/hmr/LazyCompilationPlugin").BackendApi>)
)
| LazyCompilationDefaultBackendOptions;
/**
* Enable/disable lazy compilation for entries.
*/
entries?: boolean;
/**
* Enable/disable lazy compilation for import() modules.
*/
imports?: boolean;
/**
* Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
*/
test?: RegExp | string | ((module: import("../lib/Module")) => boolean);
}
/**
* Options affecting the normal modules (`NormalModuleFactory`).
*/
@ -2977,6 +3193,10 @@ export interface OutputNormalized {
* The filename of asset modules as relative path inside the 'output.path' directory.
*/
assetModuleFilename?: AssetModuleFilename;
/**
* Enable/disable creating async chunks that are loaded on demand.
*/
asyncChunks?: boolean;
/**
* Add charset attribute for script tag.
*/
@ -3013,6 +3233,14 @@ export interface OutputNormalized {
* This option enables cross-origin loading of chunks.
*/
crossOriginLoading?: CrossOriginLoading;
/**
* Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
cssChunkFilename?: CssChunkFilename;
/**
* Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
cssFilename?: CssFilename;
/**
* Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
*/
@ -3149,6 +3377,10 @@ export interface OutputNormalized {
* The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
*/
workerChunkLoading?: ChunkLoading;
/**
* Worker public path. Much like the public path, this sets the location where the worker script file is intended to be found. If not set, webpack will use the publicPath. Don't set this option unless your worker scripts are located at a different path from your other script files.
*/
workerPublicPath?: WorkerPublicPath;
/**
* The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
*/
@ -3193,7 +3425,7 @@ export interface WebpackOptionsNormalized {
/**
* Enables/Disables experiments (experimental features with relax SemVer compatibility).
*/
experiments: Experiments;
experiments: ExperimentsNormalized;
/**
* Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.
*/
@ -3295,6 +3527,40 @@ export interface WebpackOptionsNormalized {
*/
watchOptions: WatchOptions;
}
/**
* Enables/Disables experiments (experimental features with relax SemVer compatibility).
*/
export interface ExperimentsExtra {
/**
* Build http(s): urls using a lockfile and resource content cache.
*/
buildHttp?: HttpUriAllowedUris | HttpUriOptions;
/**
* Enable css support.
*/
css?: boolean | CssExperimentOptions;
/**
* Compile entrypoints and import()s only when they are accessed.
*/
lazyCompilation?: boolean | LazyCompilationOptions;
}
/**
* Enables/Disables experiments (experimental features with relax SemVer compatibility).
*/
export interface ExperimentsNormalizedExtra {
/**
* Build http(s): urls using a lockfile and resource content cache.
*/
buildHttp?: HttpUriOptions;
/**
* Enable css support.
*/
css?: false | CssExperimentOptions;
/**
* Compile entrypoints and import()s only when they are accessed.
*/
lazyCompilation?: false | LazyCompilationOptions;
}
/**
* If an dependency matches exactly a property of the object, the property value is used as dependency.
*/

View File

@ -38,6 +38,10 @@ export interface BannerPluginOptions {
* Exclude all modules matching any of these conditions.
*/
exclude?: Rules;
/**
* If true, banner will be placed at the end of the output.
*/
footer?: boolean;
/**
* Include all modules matching any of these conditions.
*/

View File

@ -16,6 +16,10 @@ export type ExposesItem = string;
* Modules that should be exposed by this container.
*/
export type ExposesItems = ExposesItem[];
/**
* Add a container for define/require functions in the AMD module.
*/
export type AmdContainer = string;
/**
* Add a comment in the UMD wrapper.
*/
@ -29,7 +33,7 @@ export type LibraryExport = string[] | string;
*/
export type LibraryName = string[] | string | LibraryCustomUmdObject;
/**
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
*/
export type LibraryType =
| (
@ -44,6 +48,7 @@ export type LibraryType =
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "commonjs-static"
| "amd"
| "amd-require"
| "umd"
@ -113,6 +118,10 @@ export interface ExposesConfig {
* Options for library.
*/
export interface LibraryOptions {
/**
* Add a container for define/require functions in the AMD module.
*/
amdContainer?: AmdContainer;
/**
* Add a comment in the UMD wrapper.
*/
@ -126,7 +135,7 @@ export interface LibraryOptions {
*/
name?: LibraryName;
/**
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
*/
type: LibraryType;
/**

View File

@ -18,6 +18,7 @@ export type ExternalsType =
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "commonjs-static"
| "amd"
| "amd-require"
| "umd"

View File

@ -16,6 +16,10 @@ export type ExposesItem = string;
* Modules that should be exposed by this container.
*/
export type ExposesItems = ExposesItem[];
/**
* Add a container for define/require functions in the AMD module.
*/
export type AmdContainer = string;
/**
* Add a comment in the UMD wrapper.
*/
@ -29,7 +33,7 @@ export type LibraryExport = string[] | string;
*/
export type LibraryName = string[] | string | LibraryCustomUmdObject;
/**
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
*/
export type LibraryType =
| (
@ -44,6 +48,7 @@ export type LibraryType =
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "commonjs-static"
| "amd"
| "amd-require"
| "umd"
@ -70,6 +75,7 @@ export type ExternalsType =
| "commonjs"
| "commonjs2"
| "commonjs-module"
| "commonjs-static"
| "amd"
| "amd-require"
| "umd"
@ -169,6 +175,10 @@ export interface ExposesConfig {
* Options for library.
*/
export interface LibraryOptions {
/**
* Add a container for define/require functions in the AMD module.
*/
amdContainer?: AmdContainer;
/**
* Add a comment in the UMD wrapper.
*/
@ -182,7 +192,7 @@ export interface LibraryOptions {
*/
name?: LibraryName;
/**
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
* Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
*/
type: LibraryType;
/**

View File

@ -5,11 +5,23 @@
*/
export type HttpUriPluginOptions = HttpUriOptions;
/**
* List of allowed URIs (resp. the beginning of them).
*/
export type HttpUriOptionsAllowedUris = (
| RegExp
| string
| ((uri: string) => boolean)
)[];
/**
* Options for building http resources.
*/
export interface HttpUriOptions {
/**
* List of allowed URIs (resp. the beginning of them).
*/
allowedUris: HttpUriOptionsAllowedUris;
/**
* Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
*/
@ -22,6 +34,10 @@ export interface HttpUriOptions {
* Location of the lockfile.
*/
lockfileLocation?: string;
/**
* Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
*/
proxy?: string;
/**
* When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
*/

View File

@ -50,8 +50,6 @@
[two-explicit-vendor-chunks](two-explicit-vendor-chunks)
## Code Splitted
[code-splitted-css-bundle](code-splitted-css-bundle)
[code-splitted-require.context-amd](code-splitted-require.context-amd) example demonstrating contexts in a code-split environment with AMD.
[code-splitted-require.context](code-splitted-require.context) example demonstrating contexts in a code-split environment.
@ -59,7 +57,7 @@
## Code Splitting
[code-splitting](code-splitting) example demonstrating a very simple case of Code Splitting.
[code-splitting-bundle-loader](code-splitting-bundle-loader) example demonstrating Code Splitting through the builder loader
[code-splitting-bundle-loader](code-splitting-bundle-loader) example demonstrating Code Splitting through the bundle loader
[code-splitting-harmony](code-splitting-harmony)

View File

@ -60,20 +60,20 @@ module.exports = {
## Unoptimized
```
asset pageA.bundle.js 8.91 KiB [emitted] (name: pageA)
asset pageB.bundle.js 8.91 KiB [emitted] (name: pageB)
asset pageC.bundle.js 8.91 KiB [emitted] (name: pageC)
asset pageA.bundle.js 8.9 KiB [emitted] (name: pageA)
asset pageB.bundle.js 8.9 KiB [emitted] (name: pageB)
asset pageC.bundle.js 8.9 KiB [emitted] (name: pageC)
asset 456.chunk.js 6.28 KiB [emitted]
asset 394.chunk.js 606 bytes [emitted]
chunk (runtime: pageB) pageB.bundle.js (pageB) 69 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: pageB) pageB.bundle.js (pageB) 69 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./pageB pageB
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./pageB.js 69 bytes [built] [code generated]
[used exports unknown]
entry ./pageB pageB
chunk (runtime: pageC) pageC.bundle.js (pageC) 68 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: pageC) pageC.bundle.js (pageC) 68 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./pageC pageC
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./pageC.js 68 bytes [built] [code generated]
[used exports unknown]
entry ./pageC pageC
@ -89,9 +89,9 @@ chunk (runtime: pageC) 394.chunk.js 42 bytes [rendered]
cjs self exports reference ./b.js 1:0-14
cjs require ./b ./pageB.js 2:8-22
cjs require ./b ./pageC.js 2:17-31
chunk (runtime: pageA) pageA.bundle.js (pageA) 69 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: pageA) pageA.bundle.js (pageA) 69 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./pageA pageA
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./pageA.js 69 bytes [built] [code generated]
[used exports unknown]
entry ./pageA pageA
@ -113,7 +113,7 @@ chunk (runtime: pageA, pageB) 456.chunk.js 5.45 KiB [rendered]
cjs self exports reference ./common.js 1:0-14
amd require ./common ./pageA.js 1:0-3:2
amd require ./common ./pageB.js 1:0-3:2
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -124,15 +124,15 @@ asset pageA.bundle.js 1.73 KiB [emitted] [minimized] (name: pageA)
asset pageB.bundle.js 1.73 KiB [emitted] [minimized] (name: pageB)
asset 456.chunk.js 155 bytes [emitted] [minimized]
asset 394.chunk.js 104 bytes [emitted] [minimized]
chunk (runtime: pageB) pageB.bundle.js (pageB) 69 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: pageB) pageB.bundle.js (pageB) 69 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./pageB pageB
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./pageB.js 69 bytes [built] [code generated]
[no exports used]
entry ./pageB pageB
chunk (runtime: pageC) pageC.bundle.js (pageC) 68 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: pageC) pageC.bundle.js (pageC) 68 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./pageC pageC
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./pageC.js 68 bytes [built] [code generated]
[no exports used]
entry ./pageC pageC
@ -148,9 +148,9 @@ chunk (runtime: pageC) 394.chunk.js 42 bytes [rendered]
cjs self exports reference ./b.js 1:0-14
cjs require ./b ./pageB.js 2:8-22
cjs require ./b ./pageC.js 2:17-31
chunk (runtime: pageA) pageA.bundle.js (pageA) 69 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: pageA) pageA.bundle.js (pageA) 69 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./pageA pageA
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./pageA.js 69 bytes [built] [code generated]
[no exports used]
entry ./pageA pageA
@ -172,5 +172,5 @@ chunk (runtime: pageA, pageB) 456.chunk.js 5.45 KiB [rendered]
cjs self exports reference ./common.js 1:0-14
amd require ./common ./pageA.js 1:0-3:2
amd require ./common ./pageB.js 1:0-3:2
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -196,5 +196,5 @@ chunk (runtime: main) output.js (main) 1.54 KiB (javascript) 274 bytes (runtime)
[no exports]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -68,7 +68,7 @@ module.exports = {
\*************************/
/*! default exports */
/*! exports [not provided] [no usage info] */
/*! runtime requirements: module, __webpack_require__.p, __webpack_require__.* */
/*! runtime requirements: __webpack_require__.p, module, __webpack_require__.* */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = __webpack_require__.p + "images/89a353e9c515885abd8e.png";
@ -217,5 +217,5 @@ chunk (runtime: main) output.js (main) 9.58 KiB (javascript) 14.6 KiB (asset) 30
[no exports]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -20,7 +20,12 @@ module.exports = {
// loggingDebug: /HttpUriPlugin/
// },
experiments: {
buildHttp: true
buildHttp: [
"https://cdn.esm.sh/",
"https://cdn.skypack.dev/",
"https://jspm.dev/",
/^https:\/\/unpkg\.com\/.+\?module$/
]
}
};
```
@ -33,12 +38,35 @@ module.exports = {
asset output.js 82.6 KiB [emitted] (name: main)
runtime modules 670 bytes 3 modules
modules by path https:// 30 KiB
modules by path https://jspm.dev/ 16.1 KiB
modules by path https://jspm.dev/*.0 6.04 KiB 5 modules
modules by path https://jspm.dev/npm:@jspm/ 9.67 KiB 3 modules
4 modules
modules by path https://cdn.esm.sh/ 6.15 KiB 7 modules
modules by path https://cdn.skypack.dev/ 7.46 KiB 6 modules
modules by path https://jspm.dev/ 16.1 KiB 12 modules
modules by path https://cdn.esm.sh/ 6.15 KiB
https://cdn.esm.sh/p-map 173 bytes [built] [code generated]
[exports: default, pMapSkip]
[used exports unknown]
harmony side effect evaluation https://cdn.esm.sh/p-map ./example.js 2:0-45
harmony import specifier https://cdn.esm.sh/p-map ./example.js 6:12-17
https://cdn.esm.sh/v53/p-map@5.1.0/es2015/p-map.js 1.18 KiB [built] [code generated]
[exports: default, pMapSkip]
[used exports unknown]
harmony side effect evaluation https://cdn.esm.sh/v53/p-map@5.1.0/es2015/p-map.js https://cdn.esm.sh/p-map 2:0-67
harmony export imported specifier https://cdn.esm.sh/v53/p-map@5.1.0/es2015/p-map.js https://cdn.esm.sh/p-map 2:0-67
harmony side effect evaluation https://cdn.esm.sh/v53/p-map@5.1.0/es2015/p-map.js https://cdn.esm.sh/p-map 3:0-77
harmony export imported specifier https://cdn.esm.sh/v53/p-map@5.1.0/es2015/p-map.js https://cdn.esm.sh/p-map 3:0-77
+ 5 modules
modules by path https://cdn.skypack.dev/ 7.46 KiB
https://cdn.skypack.dev/p-map 757 bytes [built] [code generated]
[exports: default, pMapSkip]
[used exports unknown]
harmony side effect evaluation https://cdn.skypack.dev/p-map ./example.js 1:0-50
harmony import specifier https://cdn.skypack.dev/p-map ./example.js 5:12-17
https://cdn.skypack.dev/-/p-map@v5.1.0-7ixXvZxXPKKt9unR9LT0/dist=es2020,mode=imports/optimized/p-map.js 2.29 KiB [built] [code generated]
[exports: default, pMapSkip]
[used exports unknown]
harmony side effect evaluation /-/p-map@v5.1.0-7ixXvZxXPKKt9unR9LT0/dist=es2020,mode=imports/optimized/p-map.js https://cdn.skypack.dev/p-map 15:0-97
harmony export imported specifier /-/p-map@v5.1.0-7ixXvZxXPKKt9unR9LT0/dist=es2020,mode=imports/optimized/p-map.js https://cdn.skypack.dev/p-map 15:0-97
harmony side effect evaluation /-/p-map@v5.1.0-7ixXvZxXPKKt9unR9LT0/dist=es2020,mode=imports/optimized/p-map.js https://cdn.skypack.dev/p-map 16:0-105
harmony export imported specifier /-/p-map@v5.1.0-7ixXvZxXPKKt9unR9LT0/dist=es2020,mode=imports/optimized/p-map.js https://cdn.skypack.dev/p-map 16:0-105
+ 4 modules
https://unpkg.com/p-map-series?module 263 bytes [built] [code generated]
[exports: default]
[used exports unknown]
@ -48,17 +76,17 @@ modules by path https:// 30 KiB
[no exports]
[used exports unknown]
entry ./example.js main
webpack 5.53.0 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
```
asset output.js 12.5 KiB [emitted] [minimized] (name: main)
asset output.js 12.4 KiB [emitted] [minimized] (name: main)
orphan modules 30 KiB [orphan] 26 modules
./example.js + 25 modules 30.2 KiB [built] [code generated]
[no exports]
[no exports used]
entry ./example.js main
webpack 5.53.0 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -4,6 +4,11 @@ module.exports = {
// loggingDebug: /HttpUriPlugin/
// },
experiments: {
buildHttp: true
buildHttp: [
"https://cdn.esm.sh/",
"https://cdn.skypack.dev/",
"https://jspm.dev/",
/^https:\/\/unpkg\.com\/.+\?module$/
]
}
};

View File

@ -20,7 +20,7 @@ import("./async2");
```javascript
var path = require("path");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
entry: {
main: "./example"
},
@ -43,7 +43,7 @@ module.exports = {
<body>
<!-- inlined minimized file "runtime~main.[chunkhash].js" -->
<script>
(()=>{"use strict";var e,r,t,o,n={},a={};function i(e){var r=a[e];if(void 0!==r)return r.exports;var t=a[e]={exports:{}};return n[e](t,t.exports,i),t.exports}i.m=n,e=[],i.O=(r,t,o,n)=>{if(!t){var a=1/0;for(s=0;s<e.length;s++){for(var[t,o,n]=e[s],l=!0,u=0;u<t.length;u++)(!1&n||a>=n)&&Object.keys(i.O).every((e=>i.O[e](t[u])))?t.splice(u--,1):(l=!1,n<a&&(a=n));if(l){e.splice(s--,1);var f=o();void 0!==f&&(r=f)}}return r}n=n||0;for(var s=e.length;s>0&&e[s-1][2]>n;s--)e[s]=e[s-1];e[s]=[t,o,n]},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var n=Object.create(null);i.r(n);var a={};r=r||[null,t({}),t([]),t(t)];for(var l=2&o&&e;"object"==typeof l&&!~r.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach((r=>a[r]=()=>e[r]));return a.default=()=>e,i.d(n,a),n},i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((r,t)=>(i.f[t](e,r),r)),[])),i.u=e=>e+".[chunkhash].js",i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),o={},i.l=(e,r,t,n)=>{if(o[e])o[e].push(r);else{var a,l;if(void 0!==t)for(var u=document.getElementsByTagName("script"),f=0;f<u.length;f++){var s=u[f];if(s.getAttribute("src")==e){a=s;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=e),o[e]=[r];var c=(r,t)=>{a.onerror=a.onload=null,clearTimeout(d);var n=o[e];if(delete o[e],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(t))),r)return r(t)},d=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),l&&document.head.appendChild(a)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="dist/",(()=>{var e={303:0};i.f.j=(r,t)=>{var o=i.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else if(303!=r){var n=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=n);var a=i.p+i.u(r),l=new Error;i.l(a,(t=>{if(i.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;l.message="Loading chunk "+r+" failed.\n("+n+": "+a+")",l.name="ChunkLoadError",l.type=n,l.request=a,o[1](l)}}),"chunk-"+r,r)}else e[r]=0},i.O.j=r=>0===e[r];var r=(r,t)=>{var o,n,[a,l,u]=t,f=0;if(a.some((r=>0!==e[r]))){for(o in l)i.o(l,o)&&(i.m[o]=l[o]);if(u)var s=u(i)}for(r&&r(t);f<a.length;f++)n=a[f],i.o(e,n)&&e[n]&&e[n][0](),e[a[f]]=0;return i.O(s)},t=self.webpackChunk=self.webpackChunk||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})()})();
(()=>{"use strict";var e,r,t,o,n={},a={};function i(e){var r=a[e];if(void 0!==r)return r.exports;var t=a[e]={exports:{}};return n[e](t,t.exports,i),t.exports}i.m=n,e=[],i.O=(r,t,o,n)=>{if(!t){var a=1/0;for(s=0;s<e.length;s++){for(var[t,o,n]=e[s],l=!0,u=0;u<t.length;u++)(!1&n||a>=n)&&Object.keys(i.O).every((e=>i.O[e](t[u])))?t.splice(u--,1):(l=!1,n<a&&(a=n));if(l){e.splice(s--,1);var f=o();void 0!==f&&(r=f)}}return r}n=n||0;for(var s=e.length;s>0&&e[s-1][2]>n;s--)e[s]=e[s-1];e[s]=[t,o,n]},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var n=Object.create(null);i.r(n);var a={};r=r||[null,t({}),t([]),t(t)];for(var l=2&o&&e;"object"==typeof l&&!~r.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach((r=>a[r]=()=>e[r]));return a.default=()=>e,i.d(n,a),n},i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((r,t)=>(i.f[t](e,r),r)),[])),i.u=e=>e+".[chunkhash].js",i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),o={},i.l=(e,r,t,n)=>{if(o[e])o[e].push(r);else{var a,l;if(void 0!==t)for(var u=document.getElementsByTagName("script"),f=0;f<u.length;f++){var s=u[f];if(s.getAttribute("src")==e){a=s;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=e),o[e]=[r];var c=(r,t)=>{a.onerror=a.onload=null,clearTimeout(d);var n=o[e];if(delete o[e],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(t))),r)return r(t)},d=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),l&&document.head.appendChild(a)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="dist/",(()=>{var e={303:0};i.f.j=(r,t)=>{var o=i.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else if(303!=r){var n=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=n);var a=i.p+i.u(r),l=new Error;i.l(a,(t=>{if(i.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;l.message="Loading chunk "+r+" failed.\n("+n+": "+a+")",l.name="ChunkLoadError",l.type=n,l.request=a,o[1](l)}}),"chunk-"+r,r)}else e[r]=0},i.O.j=r=>0===e[r];var r=(r,t)=>{var o,n,[a,l,u]=t,f=0;if(a.some((r=>0!==e[r]))){for(o in l)i.o(l,o)&&(i.m[o]=l[o]);if(u)var s=u(i)}for(r&&r(t);f<a.length;f++)n=a[f],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return i.O(s)},t=self.webpackChunk=self.webpackChunk||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})()})();
</script>
<script src="dist/main.[chunkhash].js"></script>
@ -230,7 +230,6 @@ module.exports = {
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -334,7 +333,7 @@ module.exports = {
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ return __webpack_require__.O(result);
/******/ }
@ -397,9 +396,9 @@ chunk (runtime: runtime~main) main.[chunkhash].js (main) 55 bytes [initial] [ren
./example.js 55 bytes [built] [code generated]
[used exports unknown]
entry ./example main
chunk (runtime: runtime~main) runtime~main.[chunkhash].js (runtime~main) 7.6 KiB [entry] [rendered]
chunk (runtime: runtime~main) runtime~main.[chunkhash].js (runtime~main) 7.59 KiB [entry] [rendered]
> ./example main
runtime modules 7.6 KiB 10 modules
runtime modules 7.59 KiB 10 modules
chunk (runtime: runtime~main) 2.[chunkhash].js 28 bytes [rendered]
> ./async1 ./example.js 2:0-18
./async1.js 28 bytes [built] [code generated]
@ -410,7 +409,7 @@ chunk (runtime: runtime~main) 3.[chunkhash].js 28 bytes [rendered]
./async2.js 28 bytes [built] [code generated]
[used exports unknown]
import() ./async2 ./example.js 3:0-18
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -420,7 +419,7 @@ asset runtime~main.[chunkhash].js 2.73 KiB [emitted] [minimized] (name: runtime~
asset main.[chunkhash].js 157 bytes [emitted] [minimized] (name: main)
asset 114.[chunkhash].js 69 bytes [emitted] [minimized]
asset 172.[chunkhash].js 69 bytes [emitted] [minimized]
Entrypoint main 2.89 KiB = runtime~main.[chunkhash].js 2.73 KiB main.[chunkhash].js 157 bytes
Entrypoint main 2.88 KiB = runtime~main.[chunkhash].js 2.73 KiB main.[chunkhash].js 157 bytes
chunk (runtime: runtime~main) 114.[chunkhash].js 28 bytes [rendered]
> ./async1 ./example.js 2:0-18
./async1.js 28 bytes [built] [code generated]
@ -436,8 +435,8 @@ chunk (runtime: runtime~main) main.[chunkhash].js (main) 55 bytes [initial] [ren
./example.js 55 bytes [built] [code generated]
[no exports used]
entry ./example main
chunk (runtime: runtime~main) runtime~main.[chunkhash].js (runtime~main) 7.6 KiB [entry] [rendered]
chunk (runtime: runtime~main) runtime~main.[chunkhash].js (runtime~main) 7.59 KiB [entry] [rendered]
> ./example main
runtime modules 7.6 KiB 10 modules
webpack 5.51.1 compiled successfully
runtime modules 7.59 KiB 10 modules
webpack 5.78.0 compiled successfully
```

View File

@ -1,6 +1,6 @@
var path = require("path");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
entry: {
main: "./example"
},

View File

@ -65,7 +65,7 @@ exports.multiply = function multiply() {
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
var __webpack_unused_export__;
const add = __webpack_require__(/*! ./math */ 2)/* .add */ .I;
const add = (__webpack_require__(/*! ./math */ 2)/* .add */ .I);
exports.nP = function increment(val) {
return add(val, 1);
};
@ -158,7 +158,7 @@ var __webpack_exports__ = {};
\********************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: __webpack_require__ */
const inc = __webpack_require__(/*! ./increment */ 1)/* .increment */ .nP;
const inc = (__webpack_require__(/*! ./increment */ 1)/* .increment */ .nP);
var a = 1;
inc(a); // 2
@ -187,14 +187,14 @@ inc(a); // 2
## Unoptimized
```
asset output.js 2.93 KiB [emitted] (name: main)
asset output.js 2.94 KiB [emitted] (name: main)
chunk (runtime: main) output.js (main) 634 bytes [entry] [rendered]
> ./example.js main
dependent modules 564 bytes [dependent] 2 modules
./example.js 70 bytes [built] [code generated]
[no exports used]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
asset without.js 3.08 KiB [emitted] (name: main)
chunk (runtime: main) without.js (main) 634 bytes [entry] [rendered]
@ -203,7 +203,7 @@ chunk (runtime: main) without.js (main) 634 bytes [entry] [rendered]
./example.js 70 bytes [built] [code generated]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -216,7 +216,7 @@ chunk (runtime: main) output.js (main) 634 bytes [entry] [rendered]
./example.js 70 bytes [built] [code generated]
[no exports used]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
asset without.js 551 bytes [emitted] [minimized] (name: main) 1 related asset
chunk (runtime: main) without.js (main) 634 bytes [entry] [rendered]
@ -225,5 +225,5 @@ chunk (runtime: main) without.js (main) 634 bytes [entry] [rendered]
./example.js 70 bytes [built] [code generated]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -118,7 +118,6 @@ getTemplate("b", function(b) {
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -211,7 +210,7 @@ getTemplate("b", function(b) {
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
@ -236,7 +235,7 @@ var __webpack_exports__ = {};
function getTemplate(templateName, callback) {
__webpack_require__.e(/*! AMD require */ 577).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(1)("./"+templateName)]; (function(tmpl) {
callback(tmpl());
}).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__);}).catch(__webpack_require__.oe);
}).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__);})['catch'](__webpack_require__.oe);
}
getTemplate("a", function(a) {
console.log(a);
@ -342,11 +341,11 @@ module.exports = function() {
## Unoptimized
```
asset output.js 9.05 KiB [emitted] (name: main)
asset output.js 9.04 KiB [emitted] (name: main)
asset 577.output.js 2.23 KiB [emitted]
chunk (runtime: main) output.js (main) 251 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 251 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./example.js 251 bytes [built] [code generated]
[used exports unknown]
entry ./example.js main
@ -357,7 +356,7 @@ chunk (runtime: main) 577.output.js 457 bytes [rendered]
[no exports]
[used exports unknown]
amd require context ./example.js 2:1-4:3
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -365,9 +364,9 @@ webpack 5.51.1 compiled successfully
```
asset output.js 1.82 KiB [emitted] [minimized] (name: main)
asset 577.output.js 609 bytes [emitted] [minimized]
chunk (runtime: main) output.js (main) 251 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 251 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./example.js 251 bytes [built] [code generated]
[no exports used]
entry ./example.js main
@ -377,5 +376,5 @@ chunk (runtime: main) 577.output.js 457 bytes [rendered]
../require.context/templates/ sync ^\.\/.*$ 217 bytes [built] [code generated]
[no exports]
amd require context ./example.js 2:1-4:3
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -118,7 +118,6 @@ getTemplate("b", function(b) {
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -211,7 +210,7 @@ getTemplate("b", function(b) {
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
@ -236,7 +235,7 @@ var __webpack_exports__ = {};
function getTemplate(templateName, callback) {
__webpack_require__.e(/*! require.ensure */ 577).then((function(require) {
callback(__webpack_require__(1)("./"+templateName)());
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}).bind(null, __webpack_require__))['catch'](__webpack_require__.oe);
}
getTemplate("a", function(a) {
console.log(a);
@ -342,11 +341,11 @@ module.exports = function() {
## Unoptimized
```
asset output.js 8.96 KiB [emitted] (name: main)
asset output.js 8.95 KiB [emitted] (name: main)
asset 577.output.js 2.23 KiB [emitted]
chunk (runtime: main) output.js (main) 266 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 266 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./example.js 266 bytes [built] [code generated]
[used exports unknown]
entry ./example.js main
@ -357,17 +356,17 @@ chunk (runtime: main) 577.output.js 457 bytes [rendered]
[no exports]
[used exports unknown]
cjs require context ./example.js 3:11-64
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
```
asset output.js 1.8 KiB [emitted] [minimized] (name: main)
asset output.js 1.79 KiB [emitted] [minimized] (name: main)
asset 577.output.js 609 bytes [emitted] [minimized]
chunk (runtime: main) output.js (main) 266 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 266 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./example.js 266 bytes [built] [code generated]
[no exports used]
entry ./example.js main
@ -377,5 +376,5 @@ chunk (runtime: main) 577.output.js 457 bytes [rendered]
../require.context/templates/ sync ^\.\/.*$ 217 bytes [built] [code generated]
[no exports]
cjs require context ./example.js 3:11-64
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -44,7 +44,7 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) {
for(var i = 0, l = callbacks.length; i < l; i++) {
callbacks[i](data);
}
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}).bind(null, __webpack_require__))['catch'](__webpack_require__.oe);
/***/ })
/******/ ]);
@ -147,7 +147,6 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) {
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -240,7 +239,7 @@ __webpack_require__.e(/*! require.ensure */ 929).then((function(require) {
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
@ -300,11 +299,11 @@ module.exports = "It works";
## Unoptimized
```
asset output.js 9.7 KiB [emitted] (name: main)
asset output.js 9.68 KiB [emitted] (name: main)
asset 929.output.js 354 bytes [emitted]
chunk (runtime: main) output.js (main) 375 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 375 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
dependent modules 281 bytes [dependent] 1 module
./example.js 94 bytes [built] [code generated]
[used exports unknown]
@ -315,7 +314,7 @@ chunk (runtime: main) 929.output.js 28 bytes [rendered]
[used exports unknown]
cjs self exports reference ./file.js 1:0-14
cjs require !!./file.js ../../node_modules/bundle-loader/index.js!./file.js 8:8-30
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -323,9 +322,9 @@ webpack 5.51.1 compiled successfully
```
asset output.js 1.85 KiB [emitted] [minimized] (name: main)
asset 929.output.js 88 bytes [emitted] [minimized]
chunk (runtime: main) output.js (main) 375 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 375 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
dependent modules 281 bytes [dependent] 1 module
./example.js 94 bytes [built] [code generated]
[no exports used]
@ -336,5 +335,5 @@ chunk (runtime: main) 929.output.js 28 bytes [rendered]
[used exports unknown]
cjs self exports reference ./file.js 1:0-14
cjs require !!./file.js ../../node_modules/bundle-loader/index.js!./file.js 8:8-30
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -222,7 +222,6 @@ console.log(lodash, isomorphicFetch);
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -326,7 +325,7 @@ console.log(lodash, isomorphicFetch);
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ return __webpack_require__.O(result);
/******/ }
@ -555,7 +554,7 @@ asset react-vendors.js 1.33 KiB [emitted] (name: react-vendors)
asset lazy_js.js 1.11 KiB [emitted]
Entrypoint app 1.44 KiB = app.js
Entrypoint page1 1.91 KiB = page1.js
Entrypoint react-vendors 12.5 KiB = runtime.js 11.1 KiB react-vendors.js 1.33 KiB
Entrypoint react-vendors 12.4 KiB = runtime.js 11.1 KiB react-vendors.js 1.33 KiB
Entrypoint other-vendors 13.3 KiB = runtime.js 11.1 KiB other-vendors.js 2.13 KiB
chunk (runtime: runtime) app.js (app) 116 bytes <{other-vendors}> <{runtime}> >{page1}< [initial] [rendered]
> ./app.js app
@ -607,13 +606,13 @@ chunk (runtime: runtime) react-vendors.js (react-vendors) 87 bytes ={runtime}= >
harmony import specifier react ./page1.js 5:29-34
cjs self exports reference ./node_modules/react.js 1:0-14
entry react react-vendors
chunk (runtime: runtime) runtime.js (runtime) 6.75 KiB ={other-vendors}= ={react-vendors}= >{app}< >{page1}< [entry] [rendered]
chunk (runtime: runtime) runtime.js (runtime) 6.74 KiB ={other-vendors}= ={react-vendors}= >{app}< >{page1}< [entry] [rendered]
> ./other-vendors other-vendors
> prop-types react-vendors
> react react-vendors
> react-dom react-vendors
runtime modules 6.75 KiB 10 modules
webpack 5.51.1 compiled successfully
runtime modules 6.74 KiB 10 modules
webpack 5.78.0 compiled successfully
```
## Production mode
@ -627,7 +626,7 @@ asset react-vendors.js 200 bytes [emitted] [minimized] (name: react-vendors)
asset lazy_js.js 159 bytes [emitted] [minimized]
Entrypoint app 207 bytes = app.js
Entrypoint page1 287 bytes = page1.js
Entrypoint react-vendors 2.57 KiB = runtime.js 2.37 KiB react-vendors.js 200 bytes
Entrypoint react-vendors 2.56 KiB = runtime.js 2.37 KiB react-vendors.js 200 bytes
Entrypoint other-vendors 2.6 KiB = runtime.js 2.37 KiB other-vendors.js 239 bytes
chunk (runtime: runtime) app.js (app) 116 bytes <{other-vendors}> <{runtime}> >{page1}< [initial] [rendered]
> ./app.js app
@ -678,11 +677,11 @@ chunk (runtime: runtime) react-vendors.js (react-vendors) 87 bytes ={runtime}= >
harmony import specifier react ./page1.js 5:29-34
cjs self exports reference ./node_modules/react.js 1:0-14
entry react react-vendors
chunk (runtime: runtime) runtime.js (runtime) 6.75 KiB ={other-vendors}= ={react-vendors}= >{app}< >{page1}< [entry] [rendered]
chunk (runtime: runtime) runtime.js (runtime) 6.74 KiB ={other-vendors}= ={react-vendors}= >{app}< >{page1}< [entry] [rendered]
> ./other-vendors other-vendors
> prop-types react-vendors
> react react-vendors
> react-dom react-vendors
runtime modules 6.75 KiB 10 modules
webpack 5.51.1 compiled successfully
runtime modules 6.74 KiB 10 modules
webpack 5.78.0 compiled successfully
```

View File

@ -261,7 +261,7 @@ module.exports = 'prop-types';
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ return __webpack_require__.O(result);
/******/ }
@ -303,11 +303,11 @@ chunk (runtime: react-vendors) app.js (app) 139 bytes <{react-vendors}> [initial
[no exports]
[used exports unknown]
entry ./app.js app
chunk (runtime: react-vendors) react-vendors.js (react-vendors) 87 bytes (javascript) 3.3 KiB (runtime) >{app}< [entry] [rendered]
chunk (runtime: react-vendors) react-vendors.js (react-vendors) 87 bytes (javascript) 3.29 KiB (runtime) >{app}< [entry] [rendered]
> prop-types react-vendors
> react react-vendors
> react-dom react-vendors
runtime modules 3.3 KiB 6 modules
runtime modules 3.29 KiB 6 modules
cacheable modules 87 bytes
./node_modules/prop-types.js 31 bytes [built] [code generated]
[used exports unknown]
@ -330,7 +330,7 @@ chunk (runtime: react-vendors) react-vendors.js (react-vendors) 87 bytes (javasc
harmony import specifier react ./app.js 5:12-17
cjs self exports reference ./node_modules/react.js 1:0-14
entry react react-vendors
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -371,5 +371,5 @@ chunk (runtime: react-vendors) react-vendors.js (react-vendors) 87 bytes (javasc
harmony import specifier react ./app.js 5:12-17
cjs self exports reference ./node_modules/react.js 1:0-14
entry react react-vendors
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -241,7 +241,6 @@ module.exports = webpackAsyncContext;
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -345,7 +344,7 @@ module.exports = webpackAsyncContext;
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
@ -410,9 +409,9 @@ chunk (runtime: main) 98.output.js 13 bytes [rendered]
[used exports unknown]
import() context element ./2 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2
import() context element ./2.js ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2.js
chunk (runtime: main) output.js (main) 414 bytes (javascript) 6.92 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 414 bytes (javascript) 6.91 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 6.92 KiB 10 modules
runtime modules 6.91 KiB 10 modules
dependent modules 171 bytes [dependent] 2 modules
./example.js 243 bytes [built] [code generated]
[no exports]
@ -430,7 +429,7 @@ chunk (runtime: main) 644.output.js 11 bytes [rendered]
./node_modules/b.js 11 bytes [built] [code generated]
[used exports unknown]
import() b ./example.js 3:0-11
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -447,9 +446,9 @@ chunk (runtime: main) 98.output.js 13 bytes [rendered]
[used exports unknown]
import() context element ./2 ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2
import() context element ./2.js ./node_modules/c/ lazy ^\.\/.*$ namespace object ./2.js
chunk (runtime: main) output.js (main) 403 bytes (javascript) 6.66 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 403 bytes (javascript) 6.65 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 6.66 KiB 9 modules
runtime modules 6.65 KiB 9 modules
dependent modules 160 bytes [dependent] 1 module
./example.js 243 bytes [built] [code generated]
[no exports]
@ -467,5 +466,5 @@ chunk (runtime: main) 644.output.js 11 bytes [rendered]
./node_modules/b.js 11 bytes [built] [code generated]
[used exports unknown]
import() b ./example.js 3:0-11
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -215,7 +215,6 @@ module.exports = webpackAsyncContext;
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -319,7 +318,7 @@ module.exports = webpackAsyncContext;
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
@ -407,13 +406,13 @@ chunk (runtime: main) 718.output.js 38 bytes [rendered]
[used exports unknown]
import() context element ./foo ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo
import() context element ./foo.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
```
asset output.js 2.48 KiB [emitted] [minimized] (name: main)
asset output.js 2.47 KiB [emitted] [minimized] (name: main)
asset 398.output.js 130 bytes [emitted] [minimized]
asset 544.output.js 130 bytes [emitted] [minimized]
asset 718.output.js 130 bytes [emitted] [minimized]
@ -445,5 +444,5 @@ chunk (runtime: main) 718.output.js 38 bytes [rendered]
[exports: default]
import() context element ./foo ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo
import() context element ./foo.js ./templates/ lazy ^\.\/.*$ include: \.js$ exclude: \.noimport\.js$ namespace object ./foo.js
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -204,7 +204,6 @@ module.exports = webpackAsyncContext;
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -308,7 +307,7 @@ module.exports = webpackAsyncContext;
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
@ -394,13 +393,13 @@ chunk (runtime: main) 718.output.js 38 bytes [rendered]
[used exports unknown]
import() context element ./foo ./templates/ lazy ^\.\/.*$ namespace object ./foo
import() context element ./foo.js ./templates/ lazy ^\.\/.*$ namespace object ./foo.js
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
```
asset output.js 2.44 KiB [emitted] [minimized] (name: main)
asset output.js 2.43 KiB [emitted] [minimized] (name: main)
asset 398.output.js 130 bytes [emitted] [minimized]
asset 544.output.js 130 bytes [emitted] [minimized]
asset 718.output.js 130 bytes [emitted] [minimized]
@ -432,5 +431,5 @@ chunk (runtime: main) 718.output.js 38 bytes [rendered]
[exports: default]
import() context element ./foo ./templates/ lazy ^\.\/.*$ namespace object ./foo
import() context element ./foo.js ./templates/ lazy ^\.\/.*$ namespace object ./foo.js
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -196,7 +196,6 @@ module.exports = webpackAsyncContext;
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -300,7 +299,7 @@ module.exports = webpackAsyncContext;
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
@ -331,7 +330,7 @@ __webpack_require__.e(/*! import() | chunk-foo */ 930).then(__webpack_require__.
__webpack_require__.e(/*! require.ensure | chunk-foo1 */ 930).then((function(require) {
var foo = __webpack_require__(/*! ./templates/foo */ 2);
console.log('foo:', foo);
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}).bind(null, __webpack_require__))['catch'](__webpack_require__.oe);
var createContextVar = "r";
__webpack_require__(1)("./ba" + createContextVar).then(function(bar) {
@ -386,7 +385,7 @@ chunk (runtime: main) 930.output.js (chunk-foo) 38 bytes [rendered]
[used exports unknown]
import() ./templates/foo ./example.js 1:0-62
cjs require ./templates/foo ./example.js 6:11-37
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -424,5 +423,5 @@ chunk (runtime: main) 930.output.js (chunk-foo) 38 bytes [rendered]
[exports: default]
import() ./templates/foo ./example.js 1:0-62
cjs require ./templates/foo ./example.js 6:11-37
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -162,7 +162,6 @@ require.ensure(["c"], function(require) {
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -255,7 +254,7 @@ require.ensure(["c"], function(require) {
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
@ -282,9 +281,9 @@ var __webpack_exports__ = {};
var a = __webpack_require__(/*! a */ 1);
var b = __webpack_require__(/*! b */ 2);
__webpack_require__.e(/*! require.ensure */ 796).then((function(require) {
__webpack_require__(/*! b */ 2).xyz();
(__webpack_require__(/*! b */ 2).xyz)();
var d = __webpack_require__(/*! d */ 4);
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}).bind(null, __webpack_require__))['catch'](__webpack_require__.oe);
})();
/******/ })()
@ -334,11 +333,11 @@ Minimized
## Unoptimized
```
asset output.js 9.49 KiB [emitted] (name: main)
asset output.js 9.47 KiB [emitted] (name: main)
asset 796.output.js 528 bytes [emitted]
chunk (runtime: main) output.js (main) 161 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 161 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
dependent modules 22 bytes [dependent] 2 modules
./example.js 139 bytes [built] [code generated]
[used exports unknown]
@ -351,7 +350,7 @@ chunk (runtime: main) 796.output.js 22 bytes [rendered]
./node_modules/d.js 11 bytes [built] [code generated]
[used exports unknown]
cjs require d ./example.js 5:12-24
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -359,9 +358,9 @@ webpack 5.51.1 compiled successfully
```
asset output.js 1.74 KiB [emitted] [minimized] (name: main)
asset 796.output.js 80 bytes [emitted] [minimized]
chunk (runtime: main) output.js (main) 161 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 161 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
dependent modules 22 bytes [dependent] 2 modules
./example.js 139 bytes [built] [code generated]
[no exports used]
@ -374,5 +373,5 @@ chunk (runtime: main) 796.output.js 22 bytes [rendered]
./node_modules/d.js 11 bytes [built] [code generated]
[used exports unknown]
cjs require d ./example.js 5:12-24
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -125,7 +125,7 @@ chunk (runtime: main) output.js (main) 206 bytes [entry] [rendered]
./example.js 31 bytes [built] [code generated]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -138,5 +138,5 @@ chunk (runtime: main) output.js (main) 206 bytes [entry] [rendered]
./example.js 31 bytes [built] [code generated]
[no exports used]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -1,5 +1,5 @@
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
module: {
rules: [
{

View File

@ -296,7 +296,7 @@ module.exports = "utility1";
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ return __webpack_require__.O(result);
/******/ }
@ -462,7 +462,7 @@ module.exports = "pageB";
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ return __webpack_require__.O(result);
/******/ }
@ -626,7 +626,7 @@ module.exports = "pageC";
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ return __webpack_require__.O(result);
/******/ }
@ -661,11 +661,11 @@ module.exports = "pageC";
assets by chunk 768 bytes (id hint: commons)
asset commons-utility2_js.js 384 bytes [emitted] (id hint: commons)
asset commons-utility3_js.js 384 bytes [emitted] (id hint: commons)
asset pageA.js 6.08 KiB [emitted] (name: pageA)
asset pageA.js 6.07 KiB [emitted] (name: pageA)
asset pageB.js 5.8 KiB [emitted] (name: pageB)
asset pageC.js 5.74 KiB [emitted] (name: pageC)
asset vendor.js 737 bytes [emitted] (name: vendor) (id hint: vendor)
Entrypoint pageA 7.17 KiB = vendor.js 737 bytes commons-utility2_js.js 384 bytes pageA.js 6.08 KiB
Entrypoint pageA 7.17 KiB = vendor.js 737 bytes commons-utility2_js.js 384 bytes pageA.js 6.07 KiB
Entrypoint pageB 7.27 KiB = vendor.js 737 bytes commons-utility2_js.js 384 bytes commons-utility3_js.js 384 bytes pageB.js 5.8 KiB
Entrypoint pageC 6.49 KiB = commons-utility2_js.js 384 bytes commons-utility3_js.js 384 bytes pageC.js 5.74 KiB
chunk (runtime: pageA, pageB, pageC) commons-utility2_js.js (id hint: commons) 28 bytes [initial] [rendered] split chunk (cache group: commons)
@ -719,7 +719,7 @@ chunk (runtime: pageA, pageB) vendor.js (vendor) (id hint: vendor) 54 bytes [ini
[used exports unknown]
cjs self exports reference ./node_modules/vendor2.js 1:0-14
cjs require vendor2 ./pageB.js 1:14-32
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -728,12 +728,12 @@ webpack 5.51.1 compiled successfully
assets by chunk 212 bytes (id hint: commons)
asset commons-utility2_js.js 106 bytes [emitted] [minimized] (id hint: commons)
asset commons-utility3_js.js 106 bytes [emitted] [minimized] (id hint: commons)
asset pageA.js 1.01 KiB [emitted] [minimized] (name: pageA)
asset pageB.js 1 KiB [emitted] [minimized] (name: pageB)
asset pageA.js 1 KiB [emitted] [minimized] (name: pageA)
asset pageB.js 1020 bytes [emitted] [minimized] (name: pageB)
asset pageC.js 1010 bytes [emitted] [minimized] (name: pageC)
asset vendor.js 121 bytes [emitted] [minimized] (name: vendor) (id hint: vendor)
Entrypoint pageA 1.23 KiB = vendor.js 121 bytes commons-utility2_js.js 106 bytes pageA.js 1.01 KiB
Entrypoint pageB 1.33 KiB = vendor.js 121 bytes commons-utility2_js.js 106 bytes commons-utility3_js.js 106 bytes pageB.js 1 KiB
Entrypoint pageA 1.23 KiB = vendor.js 121 bytes commons-utility2_js.js 106 bytes pageA.js 1 KiB
Entrypoint pageB 1.32 KiB = vendor.js 121 bytes commons-utility2_js.js 106 bytes commons-utility3_js.js 106 bytes pageB.js 1020 bytes
Entrypoint pageC 1.19 KiB = commons-utility2_js.js 106 bytes commons-utility3_js.js 106 bytes pageC.js 1010 bytes
chunk (runtime: pageA, pageB, pageC) commons-utility2_js.js (id hint: commons) 28 bytes [initial] [rendered] split chunk (cache group: commons)
> ./pageA pageA
@ -786,5 +786,5 @@ chunk (runtime: pageA, pageB) vendor.js (vendor) (id hint: vendor) 54 bytes [ini
[used exports unknown]
cjs self exports reference ./node_modules/vendor2.js 1:0-14
cjs require vendor2 ./pageB.js 1:14-32
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -86,7 +86,7 @@ module.exports = function() {
const path = require("path");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
entry: {
main: ["./example.js"]
},
@ -207,7 +207,6 @@ module.exports = {
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -300,7 +299,7 @@ module.exports = {
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
@ -327,11 +326,11 @@ var main = function() {
Promise.all(/*! require.ensure */[__webpack_require__.e(421), __webpack_require__.e(366)]).then((() => {
const page = __webpack_require__(/*! ./pageA */ 1);
page();
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}).bind(null, __webpack_require__))['catch'](__webpack_require__.oe);
__webpack_require__.e(/*! require.ensure */ 588).then((() => {
const page = __webpack_require__(/*! ./pageB */ 3);
page();
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}).bind(null, __webpack_require__))['catch'](__webpack_require__.oe);
};
main();
@ -385,7 +384,7 @@ module.exports = function() {
Promise.all(/*! require.ensure */[__webpack_require__.e(421), __webpack_require__.e(145)]).then((()=>{
const page = __webpack_require__(/*! ./pageC */ 4);
page();
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}).bind(null, __webpack_require__))['catch'](__webpack_require__.oe);
};
@ -450,8 +449,8 @@ module.exports = function() {
## Unoptimized
```
asset output.js 9.11 KiB [emitted] (name: main)
asset 588.output.js 736 bytes [emitted]
asset output.js 9.09 KiB [emitted] (name: main)
asset 588.output.js 739 bytes [emitted]
asset 366.output.js 558 bytes [emitted]
asset 145.output.js 552 bytes [emitted]
asset 421.output.js 434 bytes [emitted]
@ -461,9 +460,9 @@ chunk (runtime: main) 145.output.js 136 bytes [rendered]
[used exports unknown]
cjs require ./pageC ./pageB.js 4:15-33
cjs self exports reference ./pageC.js 3:0-14
chunk (runtime: main) output.js (main) 220 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 220 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./example.js 220 bytes [built] [code generated]
[used exports unknown]
entry ./example.js main
@ -487,13 +486,13 @@ chunk (runtime: main) 588.output.js 133 bytes [rendered]
[used exports unknown]
cjs require ./pageB ./example.js 8:15-33
cjs self exports reference ./pageB.js 1:0-14
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
```
asset output.js 1.8 KiB [emitted] [minimized] (name: main)
asset output.js 1.79 KiB [emitted] [minimized] (name: main)
asset 588.output.js 198 bytes [emitted] [minimized]
asset 145.output.js 134 bytes [emitted] [minimized]
asset 366.output.js 134 bytes [emitted] [minimized]
@ -504,9 +503,9 @@ chunk (runtime: main) 145.output.js 136 bytes [rendered]
[used exports unknown]
cjs require ./pageC ./pageB.js 4:15-33
cjs self exports reference ./pageC.js 3:0-14
chunk (runtime: main) output.js (main) 220 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 220 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./example.js 220 bytes [built] [code generated]
[no exports used]
entry ./example.js main
@ -530,5 +529,5 @@ chunk (runtime: main) 588.output.js 133 bytes [rendered]
[used exports unknown]
cjs require ./pageB ./example.js 8:15-33
cjs self exports reference ./pageB.js 1:0-14
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -2,7 +2,7 @@
const path = require("path");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
entry: {
main: ["./example.js"]
},

View File

@ -51,7 +51,7 @@ exports.add = function() {
/*! runtime requirements: __webpack_require__, __webpack_exports__ */
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
const add = __webpack_require__(/*! ./math */ 2).add;
const add = (__webpack_require__(/*! ./math */ 2).add);
exports.increment = function(val) {
return add(val, 1);
};
@ -122,7 +122,7 @@ var __webpack_exports__ = {};
\********************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: __webpack_require__ */
const inc = __webpack_require__(/*! ./increment */ 1).increment;
const inc = (__webpack_require__(/*! ./increment */ 1).increment);
const a = 1;
inc(a); // 2
@ -137,14 +137,14 @@ inc(a); // 2
## Unoptimized
```
asset output.js 2.51 KiB [emitted] (name: main)
asset output.js 2.52 KiB [emitted] (name: main)
chunk (runtime: main) output.js (main) 326 bytes [entry] [rendered]
> ./example.js main
dependent modules 254 bytes [dependent] 2 modules
./example.js 72 bytes [built] [code generated]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -157,5 +157,5 @@ chunk (runtime: main) output.js (main) 326 bytes [entry] [rendered]
./example.js 72 bytes [built] [code generated]
[no exports used]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

559
examples/css/README.md Normal file
View File

@ -0,0 +1,559 @@
# example.js
```javascript
import "./style.css";
import "./style2.css";
import { main } from "./style.module.css";
import("./lazy-style.css");
document.getElementsByTagName("main")[0].className = main;
```
# style.css
```javascript
@import "style-imported.css";
@import "https://fonts.googleapis.com/css?family=Open+Sans";
body {
background: green;
font-family: "Open Sans";
}
```
# dist/output.js
```javascript
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ 3:
/*!*************************!*\
!*** ./images/file.png ***!
\*************************/
/*! default exports */
/*! exports [not provided] [no usage info] */
/*! runtime requirements: __webpack_require__.p, module, __webpack_require__.* */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = __webpack_require__.p + "89a353e9c515885abd8e.png";
/***/ })
/******/ });
```
<details><summary><code>/* webpack runtime code */</code></summary>
``` js
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/************************************************************************/
/******/ /* webpack/runtime/ensure chunk */
/******/ (() => {
/******/ __webpack_require__.f = {};
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = (chunkId) => {
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
/******/ __webpack_require__.f[key](chunkId, promises);
/******/ return promises;
/******/ }, []));
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/get css chunk filename */
/******/ (() => {
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.k = (chunkId) => {
/******/ // return url for filenames based on template
/******/ return "" + chunkId + ".output.css";
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/get javascript chunk filename */
/******/ (() => {
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // return url for filenames based on template
/******/ return "" + chunkId + ".output.js";
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/load script */
/******/ (() => {
/******/ var inProgress = {};
/******/ var dataWebpackPrefix = "app:";
/******/ // loadScript function to load a script via script tag
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
/******/ var script, needAttach;
/******/ if(key !== undefined) {
/******/ var scripts = document.getElementsByTagName("script");
/******/ for(var i = 0; i < scripts.length; i++) {
/******/ var s = scripts[i];
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
/******/ }
/******/ }
/******/ if(!script) {
/******/ needAttach = true;
/******/ script = document.createElement('script');
/******/
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120;
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
/******/ script.src = url;
/******/ }
/******/ inProgress[url] = [done];
/******/ var onScriptComplete = (prev, event) => {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var doneFns = inProgress[url];
/******/ delete inProgress[url];
/******/ script.parentNode && script.parentNode.removeChild(script);
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
/******/ needAttach && document.head.appendChild(script);
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/publicPath */
/******/ (() => {
/******/ __webpack_require__.p = "dist/";
/******/ })();
/******/
/******/ /* webpack/runtime/css loading */
/******/ (() => {
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {};
/******/
/******/ var uniqueName = "app";
/******/ var loadCssChunkData = (target, link, chunkId) => {
/******/ var data, token = "", token2, exports = {}, exportsWithId = [], exportsWithDashes = [], i = 0, cc = 1;
/******/ try { if(!link) link = loadStylesheet(chunkId); data = link.sheet.cssRules; data = data[data.length - 1].style; } catch(e) { data = getComputedStyle(document.head); }
/******/ data = data.getPropertyValue("--webpack-" + uniqueName + "-" + chunkId);
/******/ if(!data) return [];
/******/ for(; cc; i++) {
/******/ cc = data.charCodeAt(i);
/******/ if(cc == 40) { token2 = token; token = ""; }
/******/ else if(cc == 41) { exports[token2.replace(/^_/, "")] = token.replace(/^_/, ""); token = ""; }
/******/ else if(cc == 47 || cc == 37) { token = token.replace(/^_/, ""); exports[token] = token; exportsWithId.push(token); if(cc == 37) exportsWithDashes.push(token); token = ""; }
/******/ else if(!cc || cc == 44) { token = token.replace(/^_/, ""); exportsWithId.forEach((x) => (exports[x] = uniqueName + "-" + token + "-" + exports[x])); exportsWithDashes.forEach((x) => (exports[x] = "--" + exports[x])); __webpack_require__.r(exports); target[token] = ((exports, module) => {
/******/ module.exports = exports;
/******/ }).bind(null, exports); token = ""; exports = {}; exportsWithId.length = 0; }
/******/ else if(cc == 92) { token += data[++i] }
/******/ else { token += data[i]; }
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/
/******/ }
/******/ var loadingAttribute = "data-webpack-loading";
/******/ var loadStylesheet = (chunkId, url, done) => {
/******/ var link, needAttach, key = "chunk-" + chunkId;
/******/
/******/ var links = document.getElementsByTagName("link");
/******/ for(var i = 0; i < links.length; i++) {
/******/ var l = links[i];
/******/ if(l.rel == "stylesheet" && (l.href == url || l.getAttribute("href") == url || l.getAttribute("data-webpack") == uniqueName + ":" + key)) { link = l; break; }
/******/ }
/******/ if(!done) return link;
/******/
/******/ if(!link) {
/******/ needAttach = true;
/******/ link = document.createElement('link');
/******/ link.setAttribute("data-webpack", uniqueName + ":" + key);
/******/ link.setAttribute(loadingAttribute, 1);
/******/ link.rel = "stylesheet";
/******/ link.href = url;
/******/ }
/******/ var onLinkComplete = (prev, event) => {
/******/ link.onerror = link.onload = null;
/******/ link.removeAttribute(loadingAttribute);
/******/ clearTimeout(timeout);
/******/ if(event && event.type != "load") link.parentNode.removeChild(link)
/******/ done(event);
/******/ if(prev) return prev(event);
/******/ };
/******/ if(link.getAttribute(loadingAttribute)) {
/******/ var timeout = setTimeout(onLinkComplete.bind(null, undefined, { type: 'timeout', target: link }), 120000);
/******/ link.onerror = onLinkComplete.bind(null, link.onerror);
/******/ link.onload = onLinkComplete.bind(null, link.onload);
/******/ } else onLinkComplete(undefined, { type: 'load', target: link });
/******/
/******/ needAttach && document.head.appendChild(link);
/******/ return link;
/******/ };
/******/ loadCssChunkData(__webpack_require__.m, 0, 0);
/******/
/******/ __webpack_require__.f.css = (chunkId, promises) => {
/******/ // css chunk loading
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
/******/
/******/ // a Promise means "currently loading".
/******/ if(installedChunkData) {
/******/ promises.push(installedChunkData[2]);
/******/ } else {
/******/ if(true) { // all chunks have CSS
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
/******/ promises.push(installedChunkData[2] = promise);
/******/
/******/ // start chunk loading
/******/ var url = __webpack_require__.p + __webpack_require__.k(chunkId);
/******/ // create error before stack unwound to get useful stacktrace later
/******/ var error = new Error();
/******/ var loadingEnded = (event) => {
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
/******/ installedChunkData = installedChunks[chunkId];
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
/******/ if(installedChunkData) {
/******/ if(event.type !== "load") {
/******/ var errorType = event && event.type;
/******/ var realSrc = event && event.target && event.target.src;
/******/ error.message = 'Loading css chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
/******/ error.name = 'ChunkLoadError';
/******/ error.type = errorType;
/******/ error.request = realSrc;
/******/ installedChunkData[1](error);
/******/ } else {
/******/ loadCssChunkData(__webpack_require__.m, link, chunkId);
/******/ installedChunkData[0]();
/******/ }
/******/ }
/******/ }
/******/ };
/******/ var link = loadStylesheet(chunkId, url, loadingEnded);
/******/ } else installedChunks[chunkId] = 0;
/******/ }
/******/ }
/******/ };
/******/
/******/ // no hmr
/******/ })();
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ (() => {
/******/ // no baseURI
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ 0: 0
/******/ };
/******/
/******/ __webpack_require__.f.j = (chunkId, promises) => {
/******/ // JSONP chunk loading for javascript
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
/******/
/******/ // a Promise means "currently loading".
/******/ if(installedChunkData) {
/******/ promises.push(installedChunkData[2]);
/******/ } else {
/******/ if(0 == chunkId) {
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
/******/ promises.push(installedChunkData[2] = promise);
/******/
/******/ // start chunk loading
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
/******/ // create error before stack unwound to get useful stacktrace later
/******/ var error = new Error();
/******/ var loadingEnded = (event) => {
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
/******/ installedChunkData = installedChunks[chunkId];
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
/******/ if(installedChunkData) {
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ var realSrc = event && event.target && event.target.src;
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
/******/ error.name = 'ChunkLoadError';
/******/ error.type = errorType;
/******/ error.request = realSrc;
/******/ installedChunkData[1](error);
/******/ }
/******/ }
/******/ };
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
/******/ } else installedChunks[chunkId] = 0;
/******/ }
/******/ }
/******/ };
/******/
/******/ // no prefetching
/******/
/******/ // no preloaded
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
/******/ // no on chunks loaded
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var [chunkIds, moreModules, runtime] = data;
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0;
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
/******/ for(moduleId in moreModules) {
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(runtime) var result = runtime(__webpack_require__);
/******/ }
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
/******/
/******/ var chunkLoadingGlobal = self["webpackChunkapp"] = self["webpackChunkapp"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ })();
/******/
/************************************************************************/
```
</details>
``` js
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
/*!********************!*\
!*** ./example.js ***!
\********************/
/*! namespace exports */
/*! exports [not provided] [no usage info] */
/*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.e, __webpack_require__.* */
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _style_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./style.css */ 1);
/* harmony import */ var _style2_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style2.css */ 5);
/* harmony import */ var _style_module_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.module.css */ 6);
__webpack_require__.e(/*! import() */ 1).then(__webpack_require__.bind(__webpack_require__, /*! ./lazy-style.css */ 7));
document.getElementsByTagName("main")[0].className = _style_module_css__WEBPACK_IMPORTED_MODULE_2__.main;
})();
/******/ })()
;
```
# dist/output.css
```javascript
@import url("https://fonts.googleapis.com/css?family=Open+Sans");
.img {
width: 150px;
height: 150px;
background: url(89a353e9c515885abd8e.png);
}
body {
background: green;
font-family: "Open Sans";
}
body {
background: red;
}
:root {
--app-6-large: 72px;
}
.app-6-main {
font-size: var(--app-6-large);
color: darkblue;
}
@media (min-width: 1024px) {
.app-6-main {
color: green;
}
}
@supports (display: grid) {
.app-6-main {
display: grid
}
}
head{--webpack-app-0:_4,_2,_1,_5,large%main/_6;}
```
## production
```javascript
@import url("https://fonts.googleapis.com/css?family=Open+Sans");
.img {
width: 150px;
height: 150px;
background: url(89a353e9c515885abd8e.png);
}
body {
background: green;
font-family: "Open Sans";
}
body {
background: red;
}
:root {
--app-491-b: 72px;
}
.app-491-D {
font-size: var(--app-491-b);
color: darkblue;
}
@media (min-width: 1024px) {
.app-491-D {
color: green;
}
}
@supports (display: grid) {
.app-491-D {
display: grid
}
}
head{--webpack-app-179:_548,_431,_258,_268,b%D/_491;}
```
# dist/1.output.css
```javascript
body {
color: blue;
}
head{--webpack-app-1:_7;}
```
# Info
## Unoptimized
```
assets by chunk 17 KiB (name: main)
asset output.js 16.5 KiB [emitted] (name: main)
asset output.css 516 bytes [emitted] (name: main)
asset 89a353e9c515885abd8e.png 14.6 KiB [emitted] [immutable] [from: images/file.png] (auxiliary name: main)
asset 1.output.css 49 bytes [emitted]
Entrypoint main 17 KiB (14.6 KiB) = output.js 16.5 KiB output.css 516 bytes 1 auxiliary asset
chunk (runtime: main) output.js, output.css (main) 218 bytes (javascript) 454 bytes (css) 14.6 KiB (asset) 42 bytes (css-import) 10 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 10 KiB 9 modules
dependent modules 42 bytes (javascript) 14.6 KiB (asset) 454 bytes (css) 42 bytes (css-import) [dependent] 6 modules
./example.js 176 bytes [built] [code generated]
[no exports]
[used exports unknown]
entry ./example.js main
chunk (runtime: main) 1.output.css 23 bytes
> ./lazy-style.css ./example.js 4:0-26
./lazy-style.css 23 bytes [built] [code generated]
[no exports]
[used exports unknown]
import() ./lazy-style.css ./example.js 4:0-26
webpack 5.78.0 compiled successfully
```
## Production mode
```
assets by chunk 4.38 KiB (name: main)
asset output.js 3.88 KiB [emitted] [minimized] (name: main)
asset output.css 514 bytes [emitted] (name: main)
asset 89a353e9c515885abd8e.png 14.6 KiB [emitted] [immutable] [from: images/file.png] (auxiliary name: main)
asset 159.output.css 53 bytes [emitted]
Entrypoint main 4.38 KiB (14.6 KiB) = output.js 3.88 KiB output.css 514 bytes 1 auxiliary asset
chunk (runtime: main) 159.output.css 23 bytes
> ./lazy-style.css ./example.js 4:0-26
./lazy-style.css 23 bytes [built] [code generated]
[no exports]
import() ./lazy-style.css ./example.js 4:0-26
chunk (runtime: main) output.js, output.css (main) 218 bytes (javascript) 454 bytes (css) 14.6 KiB (asset) 42 bytes (css-import) 10 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 10 KiB 9 modules
dependent modules 42 bytes (javascript) 14.6 KiB (asset) 454 bytes (css) 42 bytes (css-import) [dependent] 6 modules
./example.js 176 bytes [built] [code generated]
[no exports]
[no exports used]
entry ./example.js main
webpack 5.78.0 compiled successfully
```

1
examples/css/build.js Normal file
View File

@ -0,0 +1 @@
require("../build-common");

6
examples/css/example.js Normal file
View File

@ -0,0 +1,6 @@
import "./style.css";
import "./style2.css";
import { main } from "./style.module.css";
import("./lazy-style.css");
document.getElementsByTagName("main")[0].className = main;

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

10
examples/css/index.html Normal file
View File

@ -0,0 +1,10 @@
<html>
<head>
<link rel="stylesheet" href="dist/output.css" data-webpack="app:chunk-0" />
</head>
<body>
<main>Hello World</main>
<p class="img"></p>
<script src="dist/output.js"></script>
</body>
</html>

View File

@ -0,0 +1,3 @@
body {
color: blue;
}

View File

@ -0,0 +1,5 @@
.img {
width: 150px;
height: 150px;
background: url("./images/file.png");
}

7
examples/css/style.css Normal file
View File

@ -0,0 +1,7 @@
@import "style-imported.css";
@import "https://fonts.googleapis.com/css?family=Open+Sans";
body {
background: green;
font-family: "Open Sans";
}

View File

@ -0,0 +1,20 @@
:root {
--large: 72px;
}
.main {
font-size: var(--large);
color: darkblue;
}
@media (min-width: 1024px) {
.main {
color: green;
}
}
@supports (display: grid) {
.main {
display: grid
}
}

3
examples/css/style2.css Normal file
View File

@ -0,0 +1,3 @@
body {
background: red;
}

49
examples/css/template.md Normal file
View File

@ -0,0 +1,49 @@
# example.js
```javascript
_{{example.js}}_
```
# style.css
```javascript
_{{style.css}}_
```
# dist/output.js
```javascript
_{{dist/output.js}}_
```
# dist/output.css
```javascript
_{{dist/output.css}}_
```
## production
```javascript
_{{production:dist/output.css}}_
```
# dist/1.output.css
```javascript
_{{dist/1.output.css}}_
```
# Info
## Unoptimized
```
_{{stdout}}_
```
## Production mode
```
_{{production:stdout}}_
```

View File

@ -0,0 +1,8 @@
module.exports = {
output: {
uniqueName: "app"
},
experiments: {
css: true
}
};

View File

@ -255,5 +255,5 @@ chunk (runtime: main) output.js (main) 919 bytes (javascript) 274 bytes (runtime
[no exports]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -13,7 +13,7 @@ var path = require("path");
var webpack = require("../../../");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
context: __dirname,
entry: ["example-vendor"],
output: {
@ -41,7 +41,7 @@ export function square(n) {
# dist/vendor.js
```javascript
var vendor_lib_51062e5e93ee3a0507e7;
var vendor_lib_bef1463383efb1c65306;
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ([
/* 0 */
@ -147,7 +147,7 @@ function square(n) {
/******/ // Load entry module and return exports
/******/ // This entry module doesn't tell about it's top-level declarations so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(0);
/******/ vendor_lib_51062e5e93ee3a0507e7 = __webpack_exports__;
/******/ vendor_lib_bef1463383efb1c65306 = __webpack_exports__;
/******/
/******/ })()
;
@ -156,7 +156,7 @@ function square(n) {
# dist/vendor-manifest.json
```javascript
{"name":"vendor_lib_51062e5e93ee3a0507e7","content":{"../node_modules/example-vendor.js":{"id":1,"buildMeta":{"exportsType":"namespace"},"exports":["square"]}}}
{"name":"vendor_lib_bef1463383efb1c65306","content":{"../node_modules/example-vendor.js":{"id":1,"buildMeta":{"exportsType":"namespace"},"exports":["square"]}}}
```
# Info
@ -173,7 +173,7 @@ chunk (runtime: main) vendor.js (main) 57 bytes (javascript) 670 bytes (runtime)
[used exports unknown]
dll entry
used as library export
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -187,5 +187,5 @@ chunk (runtime: main) vendor.js (main) 57 bytes (javascript) 670 bytes (runtime)
dll main 12 bytes [built] [code generated]
dll entry
used as library export
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -2,7 +2,7 @@ var path = require("path");
var webpack = require("../../../");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
context: __dirname,
entry: ["example-vendor"],
output: {

View File

@ -53,7 +53,7 @@ console.log(new square(7));
/* 0 */,
/* 1 */
/*!******************************************************************************************************!*\
!*** delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_51062e5e93ee3a0507e7 ***!
!*** delegated ../node_modules/example-vendor.js from dll-reference vendor_lib_bef1463383efb1c65306 ***!
\******************************************************************************************************/
/*! namespace exports */
/*! export square [provided] [no usage info] [provision prevents renaming (no use info)] */
@ -61,12 +61,12 @@ console.log(new square(7));
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = (__webpack_require__(/*! dll-reference vendor_lib_51062e5e93ee3a0507e7 */ 2))(1);
module.exports = (__webpack_require__(/*! dll-reference vendor_lib_bef1463383efb1c65306 */ 2))(1);
/***/ }),
/* 2 */
/*!**************************************************!*\
!*** external "vendor_lib_51062e5e93ee3a0507e7" ***!
!*** external "vendor_lib_bef1463383efb1c65306" ***!
\**************************************************/
/*! dynamic exports */
/*! exports [maybe provided (runtime-defined)] [no usage info] */
@ -74,7 +74,7 @@ module.exports = (__webpack_require__(/*! dll-reference vendor_lib_51062e5e93ee3
/***/ ((module) => {
"use strict";
module.exports = vendor_lib_51062e5e93ee3a0507e7;
module.exports = vendor_lib_bef1463383efb1c65306;
/***/ })
/******/ ]);
@ -163,7 +163,7 @@ chunk (runtime: main) app.js (main) 178 bytes (javascript) 274 bytes (runtime) [
[no exports]
[used exports unknown]
entry ./example-app main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -177,7 +177,7 @@ chunk (runtime: main) app.js (main) 178 bytes [entry] [rendered]
[no exports]
[no exports used]
entry ./example-app main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
<!-- @TODO:

View File

@ -63,7 +63,7 @@ module.exports = {
# dist/dll.js
```javascript
var dll_c76e18f6e067cdcb6208;
var dll_3f097cf91db05865c656;
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ([
/* 0 */
@ -208,7 +208,7 @@ exports.c = "c";
/******/ // Load entry module and return exports
/******/ // This entry module doesn't tell about it's top-level declarations so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(0);
/******/ dll_c76e18f6e067cdcb6208 = __webpack_exports__;
/******/ dll_3f097cf91db05865c656 = __webpack_exports__;
/******/
/******/ })()
;
@ -217,7 +217,7 @@ exports.c = "c";
# dist/dll-manifest.json
```javascript
{"name":"dll_c76e18f6e067cdcb6208","content":{"./example.js":{"id":1,"buildMeta":{"exportsType":"namespace"},"exports":["a","b","c"]}}}
{"name":"dll_3f097cf91db05865c656","content":{"./example.js":{"id":1,"buildMeta":{"exportsType":"namespace"},"exports":["a","b","c"]}}}
```
# Info
@ -234,7 +234,7 @@ chunk (runtime: dll) dll.js (dll) 211 bytes (javascript) 670 bytes (runtime) [en
[used exports unknown]
dll entry
used as library export
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -248,5 +248,5 @@ chunk (runtime: dll) dll.js (dll) 211 bytes (javascript) 670 bytes (runtime) [en
dll dll 12 bytes [built] [code generated]
dll entry
used as library export
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -10,7 +10,7 @@ This is the _user_ bundle, which uses the manifest from [dll-reference example](
var path = require("path");
var webpack = require("../../");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
plugins: [
new webpack.DllReferencePlugin({
context: path.join(__dirname, "..", "dll"),
@ -46,18 +46,18 @@ console.log(require("module"));
/* 0 */,
/* 1 */
/*!**************************************************************************!*\
!*** delegated ./alpha.js from dll-reference alpha_32ae439e7568b31a353c ***!
!*** delegated ./alpha.js from dll-reference alpha_a53f6ab3ecd4de18316c ***!
\**************************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = (__webpack_require__(/*! dll-reference alpha_32ae439e7568b31a353c */ 2))(1);
module.exports = (__webpack_require__(/*! dll-reference alpha_a53f6ab3ecd4de18316c */ 2))(1);
/***/ }),
/* 2 */
/*!*********************************************!*\
!*** external "alpha_32ae439e7568b31a353c" ***!
!*** external "alpha_a53f6ab3ecd4de18316c" ***!
\*********************************************/
/*! dynamic exports */
/*! exports [maybe provided (runtime-defined)] [no usage info] */
@ -65,34 +65,34 @@ module.exports = (__webpack_require__(/*! dll-reference alpha_32ae439e7568b31a35
/***/ ((module) => {
"use strict";
module.exports = alpha_32ae439e7568b31a353c;
module.exports = alpha_a53f6ab3ecd4de18316c;
/***/ }),
/* 3 */
/*!**********************************************************************!*\
!*** delegated ./a.js from dll-reference alpha_32ae439e7568b31a353c ***!
!*** delegated ./a.js from dll-reference alpha_a53f6ab3ecd4de18316c ***!
\**********************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = (__webpack_require__(/*! dll-reference alpha_32ae439e7568b31a353c */ 2))(2);
module.exports = (__webpack_require__(/*! dll-reference alpha_a53f6ab3ecd4de18316c */ 2))(2);
/***/ }),
/* 4 */
/*!************************************************************************!*\
!*** delegated ./beta.js from dll-reference beta_32ae439e7568b31a353c ***!
!*** delegated ./beta.js from dll-reference beta_a53f6ab3ecd4de18316c ***!
\************************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = (__webpack_require__(/*! dll-reference beta_32ae439e7568b31a353c */ 5))(5);
module.exports = (__webpack_require__(/*! dll-reference beta_a53f6ab3ecd4de18316c */ 5))(5);
/***/ }),
/* 5 */
/*!********************************************!*\
!*** external "beta_32ae439e7568b31a353c" ***!
!*** external "beta_a53f6ab3ecd4de18316c" ***!
\********************************************/
/*! dynamic exports */
/*! exports [maybe provided (runtime-defined)] [no usage info] */
@ -100,40 +100,40 @@ module.exports = (__webpack_require__(/*! dll-reference beta_32ae439e7568b31a353
/***/ ((module) => {
"use strict";
module.exports = beta_32ae439e7568b31a353c;
module.exports = beta_a53f6ab3ecd4de18316c;
/***/ }),
/* 6 */
/*!*********************************************************************!*\
!*** delegated ./b.js from dll-reference beta_32ae439e7568b31a353c ***!
!*** delegated ./b.js from dll-reference beta_a53f6ab3ecd4de18316c ***!
\*********************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = (__webpack_require__(/*! dll-reference beta_32ae439e7568b31a353c */ 5))(6);
module.exports = (__webpack_require__(/*! dll-reference beta_a53f6ab3ecd4de18316c */ 5))(6);
/***/ }),
/* 7 */
/*!**********************************************************************!*\
!*** delegated ./c.jsx from dll-reference beta_32ae439e7568b31a353c ***!
!*** delegated ./c.jsx from dll-reference beta_a53f6ab3ecd4de18316c ***!
\**********************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = (__webpack_require__(/*! dll-reference beta_32ae439e7568b31a353c */ 5))(7);
module.exports = (__webpack_require__(/*! dll-reference beta_a53f6ab3ecd4de18316c */ 5))(7);
/***/ }),
/* 8 */
/*!*****************************************************************************************!*\
!*** delegated ../node_modules/module.js from dll-reference alpha_32ae439e7568b31a353c ***!
!*** delegated ../node_modules/module.js from dll-reference alpha_a53f6ab3ecd4de18316c ***!
\*****************************************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = (__webpack_require__(/*! dll-reference alpha_32ae439e7568b31a353c */ 2))(3);
module.exports = (__webpack_require__(/*! dll-reference alpha_a53f6ab3ecd4de18316c */ 2))(3);
/***/ })
/******/ ]);
@ -208,7 +208,7 @@ chunk (runtime: main) output.js (main) 541 bytes [entry] [rendered]
./example.js 205 bytes [built] [code generated]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -221,5 +221,5 @@ chunk (runtime: main) output.js (main) 541 bytes [entry] [rendered]
./example.js 205 bytes [built] [code generated]
[no exports used]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -1,7 +1,7 @@
var path = require("path");
var webpack = require("../../");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
plugins: [
new webpack.DllReferencePlugin({
context: path.join(__dirname, "..", "dll"),

View File

@ -10,7 +10,7 @@ This is the _reference_ bundle (with the manifests) for [dll user example](https
var path = require("path");
var webpack = require("../../");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
resolve: {
extensions: [".js", ".jsx"]
},
@ -35,7 +35,7 @@ module.exports = {
# dist/MyDll.alpha.js
```javascript
var alpha_32ae439e7568b31a353c;
var alpha_a53f6ab3ecd4de18316c;
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ([
/* 0 */
@ -127,7 +127,7 @@ module.exports = "module";
/******/ // Load entry module and return exports
/******/ // This entry module doesn't tell about it's top-level declarations so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(0);
/******/ alpha_32ae439e7568b31a353c = __webpack_exports__;
/******/ alpha_a53f6ab3ecd4de18316c = __webpack_exports__;
/******/
/******/ })()
;
@ -136,7 +136,7 @@ module.exports = "module";
# dist/alpha-manifest.json
```javascript
{"name":"alpha_32ae439e7568b31a353c","content":{"./alpha.js":{"id":1,"buildMeta":{}},"./a.js":{"id":2,"buildMeta":{}},"../node_modules/module.js":{"id":3,"buildMeta":{}}}}
{"name":"alpha_a53f6ab3ecd4de18316c","content":{"./alpha.js":{"id":1,"buildMeta":{}},"./a.js":{"id":2,"buildMeta":{}},"../node_modules/module.js":{"id":3,"buildMeta":{}}}}
```
# Info
@ -160,7 +160,7 @@ chunk (runtime: beta) MyDll.beta.js (beta) 80 bytes [entry] [rendered]
[used exports unknown]
dll entry
used as library export
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -180,5 +180,5 @@ chunk (runtime: beta) MyDll.beta.js (beta) 80 bytes [entry] [rendered]
dll beta 12 bytes [built] [code generated]
dll entry
used as library export
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -1,7 +1,7 @@
var path = require("path");
var webpack = require("../../");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
resolve: {
extensions: [".js", ".jsx"]
},

View File

@ -6,7 +6,7 @@ var webpack = require("../../");
module.exports = [
{
name: "vendor",
// mode: "development || "production",
// mode: "development" || "production",
entry: ["./vendor", "./vendor2"],
output: {
path: path.resolve(__dirname, "dist"),
@ -23,7 +23,7 @@ module.exports = [
{
name: "app",
// mode: "development || "production",
// mode: "development" || "production",
dependencies: ["vendor"],
entry: {
pageA: "./pageA",
@ -46,7 +46,7 @@ module.exports = [
# dist/vendor.js
```javascript
var vendor_5993716ff0c3ad2aef3c;
var vendor_3fdea2c5a4937b737605;
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ([
/* 0 */
@ -126,7 +126,7 @@ module.exports = "Vendor2";
/******/ // Load entry module and return exports
/******/ // This entry module doesn't tell about it's top-level declarations so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__(0);
/******/ vendor_5993716ff0c3ad2aef3c = __webpack_exports__;
/******/ vendor_3fdea2c5a4937b737605 = __webpack_exports__;
/******/
/******/ })()
;
@ -152,18 +152,18 @@ module.exports = "pageA";
/***/ }),
/* 1 */
/*!****************************************************************************!*\
!*** delegated ./vendor.js from dll-reference vendor_5993716ff0c3ad2aef3c ***!
!*** delegated ./vendor.js from dll-reference vendor_3fdea2c5a4937b737605 ***!
\****************************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = (__webpack_require__(/*! dll-reference vendor_5993716ff0c3ad2aef3c */ 2))(1);
module.exports = (__webpack_require__(/*! dll-reference vendor_3fdea2c5a4937b737605 */ 2))(1);
/***/ }),
/* 2 */
/*!**********************************************!*\
!*** external "vendor_5993716ff0c3ad2aef3c" ***!
!*** external "vendor_3fdea2c5a4937b737605" ***!
\**********************************************/
/*! dynamic exports */
/*! exports [maybe provided (runtime-defined)] [no usage info] */
@ -171,7 +171,7 @@ module.exports = (__webpack_require__(/*! dll-reference vendor_5993716ff0c3ad2ae
/***/ ((module) => {
"use strict";
module.exports = vendor_5993716ff0c3ad2aef3c;
module.exports = vendor_3fdea2c5a4937b737605;
/***/ })
/******/ ]);
@ -235,7 +235,7 @@ vendor:
[used exports unknown]
dll entry
used as library export
vendor (webpack 5.51.1) compiled successfully
vendor (webpack 5.78.0) compiled successfully
app:
asset pageB.js 2.63 KiB [emitted] (name: pageB)
@ -261,7 +261,7 @@ app:
[used exports unknown]
cjs self exports reference ./pageC.js 1:0-14
entry ./pageC pageC
app (webpack 5.51.1) compiled successfully
app (webpack 5.78.0) compiled successfully
```
## Production mode
@ -275,7 +275,7 @@ vendor:
dll main 12 bytes [built] [code generated]
dll entry
used as library export
vendor (webpack 5.51.1) compiled successfully
vendor (webpack 5.78.0) compiled successfully
app:
asset pageA.js 297 bytes [emitted] [minimized] (name: pageA)
@ -301,5 +301,5 @@ app:
[used exports unknown]
cjs self exports reference ./pageA.js 2:0-14
entry ./pageA pageA
app (webpack 5.51.1) compiled successfully
app (webpack 5.78.0) compiled successfully
```

View File

@ -3,7 +3,7 @@ var webpack = require("../../");
module.exports = [
{
name: "vendor",
// mode: "development || "production",
// mode: "development" || "production",
entry: ["./vendor", "./vendor2"],
output: {
path: path.resolve(__dirname, "dist"),
@ -20,7 +20,7 @@ module.exports = [
{
name: "app",
// mode: "development || "production",
// mode: "development" || "production",
dependencies: ["vendor"],
entry: {
pageA: "./pageA",

View File

@ -28,7 +28,7 @@ exports.exampleValue = subtract(add(42, 2), 2);
```javascript
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
output: {
libraryTarget: "umd"
},
@ -58,7 +58,7 @@ module.exports = {
var a = typeof exports === 'object' ? factory(require("add"), require("./math")["subtract"]) : factory(root["add"], root["subtract"]);
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})(self, function(__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__) {
})(self, (__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__) => {
return /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ([
/* 0 */,
@ -153,7 +153,7 @@ exports.exampleValue = subtract(add(42, 2), 2);
## Unoptimized
```
asset output.js 3.28 KiB [emitted] (name: main)
asset output.js 3.27 KiB [emitted] (name: main)
chunk (runtime: main) output.js (main) 194 bytes [entry] [rendered]
> ./example.js main
dependent modules 84 bytes [dependent] 2 modules
@ -162,13 +162,13 @@ chunk (runtime: main) output.js (main) 194 bytes [entry] [rendered]
[used exports unknown]
entry ./example.js main
used as library export
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
```
asset output.js 679 bytes [emitted] [minimized] (name: main)
asset output.js 665 bytes [emitted] [minimized] (name: main)
chunk (runtime: main) output.js (main) 194 bytes [entry] [rendered]
> ./example.js main
dependent modules 84 bytes [dependent] 2 modules
@ -176,5 +176,5 @@ chunk (runtime: main) output.js (main) 194 bytes [entry] [rendered]
[exports: exampleValue]
entry ./example.js main
used as library export
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -1,5 +1,5 @@
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
output: {
libraryTarget: "umd"
},

View File

@ -23,7 +23,7 @@ require.ensure(["./a", "./e"], function(require) {
```javascript
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
optimization: {
splitChunks: {
minSize: 0 // This example is too small
@ -137,7 +137,6 @@ module.exports = {
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -230,7 +229,7 @@ module.exports = {
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
@ -252,22 +251,22 @@ var __webpack_exports__ = {};
\********************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: __webpack_require__, __webpack_require__.e, __webpack_require__.oe, __webpack_require__.* */
Promise.all(/*! AMD require */[__webpack_require__.e(996), __webpack_require__.e(847), __webpack_require__.e(460)]).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(/*! ./a */ 1), __webpack_require__(/*! ./b */ 2), __webpack_require__(/*! ./c */ 3)]; (function(a, b, c) {}).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__);}).catch(__webpack_require__.oe);
Promise.all(/*! AMD require */[__webpack_require__.e(996), __webpack_require__.e(847), __webpack_require__.e(460)]).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(/*! ./a */ 1), __webpack_require__(/*! ./b */ 2), __webpack_require__(/*! ./c */ 3)]; (function(a, b, c) {}).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__);})['catch'](__webpack_require__.oe);
Promise.all(/*! require.ensure */[__webpack_require__.e(996), __webpack_require__.e(847), __webpack_require__.e(767)]).then((function(require) {
__webpack_require__(/*! ./b */ 2);
__webpack_require__(/*! ./d */ 4);
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}).bind(null, __webpack_require__))['catch'](__webpack_require__.oe);
Promise.all(/*! require.ensure */[__webpack_require__.e(847), __webpack_require__.e(390)]).then((function(require) {
__webpack_require__(/*! ./a */ 1);
Promise.all(/*! require.ensure */[__webpack_require__.e(996), __webpack_require__.e(568)]).then((function(require) {
__webpack_require__(/*! ./f */ 6);
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}).bind(null, __webpack_require__))['catch'](__webpack_require__.oe);
Promise.all(/*! require.ensure */[__webpack_require__.e(996), __webpack_require__.e(785)]).then((function(require) {
__webpack_require__(/*! ./g */ 7);
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}).bind(null, __webpack_require__))['catch'](__webpack_require__.oe);
}).bind(null, __webpack_require__))['catch'](__webpack_require__.oe);
/******/ })()
;
@ -286,9 +285,9 @@ asset 568.output.js 338 bytes [emitted]
asset 767.output.js 338 bytes [emitted]
asset 785.output.js 338 bytes [emitted]
asset 996.output.js 338 bytes [emitted]
chunk (runtime: main) output.js (main) 346 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 346 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./example.js 346 bytes [built] [code generated]
[used exports unknown]
entry ./example.js main
@ -345,13 +344,13 @@ chunk (runtime: main) 996.output.js 21 bytes [rendered] split chunk (cache group
cjs require ./b ./example.js 4:1-15
require.ensure item ./b ./example.js 10:1-12:3
require.ensure item ./b ./example.js 13:1-15:3
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
```
asset output.js 2.12 KiB [emitted] [minimized] (name: main)
asset output.js 2.11 KiB [emitted] [minimized] (name: main)
asset 390.output.js 81 bytes [emitted] [minimized]
asset 460.output.js 81 bytes [emitted] [minimized]
asset 568.output.js 81 bytes [emitted] [minimized]
@ -359,9 +358,9 @@ asset 767.output.js 81 bytes [emitted] [minimized]
asset 785.output.js 81 bytes [emitted] [minimized]
asset 847.output.js 81 bytes [emitted] [minimized]
asset 996.output.js 81 bytes [emitted] [minimized]
chunk (runtime: main) output.js (main) 346 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 346 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./example.js 346 bytes [built] [code generated]
[no exports used]
entry ./example.js main
@ -418,5 +417,5 @@ chunk (runtime: main) 996.output.js 21 bytes [rendered] split chunk (cache group
cjs require ./b ./example.js 4:1-15
require.ensure item ./b ./example.js 10:1-12:3
require.ensure item ./b ./example.js 13:1-15:3
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -1,5 +1,5 @@
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
optimization: {
splitChunks: {
minSize: 0 // This example is too small

View File

@ -148,7 +148,6 @@ require.ensure(["./a"], function(require) {
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -241,7 +240,7 @@ require.ensure(["./a"], function(require) {
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
@ -264,13 +263,13 @@ var __webpack_exports__ = {};
/*! unknown exports (runtime-defined) */
/*! runtime requirements: __webpack_require__, __webpack_require__.e, __webpack_require__.oe, __webpack_require__.* */
// a chunks with a, b, c
Promise.all(/*! AMD require */[__webpack_require__.e(394), __webpack_require__.e(460)]).then(function() {[__webpack_require__(/*! ./a */ 1), __webpack_require__(/*! ./b */ 2), __webpack_require__(/*! ./c */ 3)];}).catch(__webpack_require__.oe);
Promise.all(/*! AMD require */[__webpack_require__.e(394), __webpack_require__.e(460)]).then(function() {[__webpack_require__(/*! ./a */ 1), __webpack_require__(/*! ./b */ 2), __webpack_require__(/*! ./c */ 3)];})['catch'](__webpack_require__.oe);
// a chunk with a, b, d
Promise.all(/*! require.ensure */[__webpack_require__.e(394), __webpack_require__.e(767)]).then((function(require) {
__webpack_require__(/*! ./b */ 2);
__webpack_require__(/*! ./d */ 4);
}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);
}).bind(null, __webpack_require__))['catch'](__webpack_require__.oe);
/******/ })()
;
@ -355,13 +354,13 @@ module.exports = "d";
## Unoptimized
```
asset output.js 9.18 KiB [emitted] (name: main)
asset output.js 9.17 KiB [emitted] (name: main)
asset 394.output.js 610 bytes [emitted]
asset 460.output.js 338 bytes [emitted]
asset 767.output.js 338 bytes [emitted]
chunk (runtime: main) output.js (main) 164 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 164 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./example.js 164 bytes [built] [code generated]
[used exports unknown]
entry ./example.js main
@ -390,7 +389,7 @@ chunk (runtime: main) 767.output.js 21 bytes [rendered]
[used exports unknown]
cjs self exports reference ./d.js 1:0-14
cjs require ./d ./example.js 7:1-15
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -400,9 +399,9 @@ asset output.js 1.81 KiB [emitted] [minimized] (name: main)
asset 394.output.js 104 bytes [emitted] [minimized]
asset 460.output.js 81 bytes [emitted] [minimized]
asset 767.output.js 81 bytes [emitted] [minimized]
chunk (runtime: main) output.js (main) 164 bytes (javascript) 4.98 KiB (runtime) [entry] [rendered]
chunk (runtime: main) output.js (main) 164 bytes (javascript) 4.97 KiB (runtime) [entry] [rendered]
> ./example.js main
runtime modules 4.98 KiB 6 modules
runtime modules 4.97 KiB 6 modules
./example.js 164 bytes [built] [code generated]
[no exports used]
entry ./example.js main
@ -431,5 +430,5 @@ chunk (runtime: main) 767.output.js 21 bytes [rendered]
[used exports unknown]
cjs self exports reference ./d.js 1:0-14
cjs require ./d ./example.js 7:1-15
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -1,5 +1,5 @@
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
optimization: {
splitChunks: {
minSize: 0 // This example is too small

View File

@ -286,7 +286,7 @@ chunk (runtime: main) output.js (main) 1.13 KiB (javascript) 937 bytes (runtime)
[no exports]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -301,5 +301,5 @@ chunk (runtime: main) output.js (main) 1.13 KiB (javascript) 670 bytes (runtime)
[no exports]
[no exports used]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -3,7 +3,7 @@
```javascript
var path = require("path");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
entry: "./example",
output: {
path: path.join(__dirname, "dist"),
@ -26,7 +26,7 @@ module.exports = {
exports["MyLibrary"] = factory();
else
root["MyLibrary"] = factory();
})(self, function() {
})(self, () => {
return /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
@ -84,9 +84,9 @@ var __webpack_exports__ = {};
/*! runtime requirements: __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "value": () => (/* binding */ value),
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */ "increment": () => (/* binding */ increment),
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ "value": () => (/* binding */ value)
/* harmony export */ });
var value = 0;
function increment() {
@ -105,7 +105,7 @@ function increment() {
## Unoptimized
```
asset MyLibrary.umd.js 2.89 KiB [emitted] (name: main)
asset MyLibrary.umd.js 2.88 KiB [emitted] (name: main)
chunk (runtime: main) MyLibrary.umd.js (main) 92 bytes (javascript) 670 bytes (runtime) [entry] [rendered]
> ./example main
runtime modules 670 bytes 3 modules
@ -114,13 +114,13 @@ chunk (runtime: main) MyLibrary.umd.js (main) 92 bytes (javascript) 670 bytes (r
[used exports unknown]
entry ./example main
used as library export
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
```
asset MyLibrary.umd.js 688 bytes [emitted] [minimized] (name: main)
asset MyLibrary.umd.js 674 bytes [emitted] [minimized] (name: main)
chunk (runtime: main) MyLibrary.umd.js (main) 92 bytes (javascript) 670 bytes (runtime) [entry] [rendered]
> ./example main
runtime modules 670 bytes 3 modules
@ -128,5 +128,5 @@ chunk (runtime: main) MyLibrary.umd.js (main) 92 bytes (javascript) 670 bytes (r
[exports: default, increment, value]
entry ./example main
used as library export
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -1,6 +1,6 @@
var path = require("path");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
entry: "./example",
output: {
path: path.join(__dirname, "dist"),

View File

@ -69,8 +69,8 @@ export { add as reexportedAdd, multiply as reexportedMultiply } from "./math";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "add": () => (/* binding */ add),
/* harmony export */ "multiply": () => (/* binding */ multiply),
/* harmony export */ "list": () => (/* binding */ list)
/* harmony export */ "list": () => (/* binding */ list),
/* harmony export */ "multiply": () => (/* binding */ multiply)
/* harmony export */ });
function add() {
var sum = 0, i = 0, args = arguments, l = args.length;
@ -256,7 +256,7 @@ chunk (runtime: main) output.js (main) 698 bytes (javascript) 670 bytes (runtime
[no exports]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -271,5 +271,5 @@ chunk (runtime: main) output.js (main) 461 bytes (javascript) 396 bytes (runtime
[no exports]
[no exports used]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -1,5 +1,5 @@
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
optimization: {
concatenateModules: false
}

View File

@ -185,7 +185,6 @@ function add() {
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -289,7 +288,7 @@ function add() {
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
@ -352,13 +351,13 @@ chunk (runtime: main) output.js (main) 400 bytes (javascript) 5.54 KiB (runtime)
[no exports]
[used exports unknown]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
```
asset output.js 2.04 KiB [emitted] [minimized] (name: main)
asset output.js 2.03 KiB [emitted] [minimized] (name: main)
asset 35.output.js 122 bytes [emitted] [minimized]
chunk (runtime: main) 35.output.js 24 bytes [rendered]
> ./async-loaded ./example.js 6:0-24
@ -372,5 +371,5 @@ chunk (runtime: main) output.js (main) 400 bytes (javascript) 5.54 KiB (runtime)
[no exports]
[no exports used]
entry ./example.js main
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

View File

@ -20,7 +20,7 @@ The backward compatibility (non-HTTP2 client) improves with bigger `maxSize`, as
var path = require("path");
var webpack = require("../../");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
cache: true, // better performance for the AggressiveSplittingPlugin
entry: "./example",
output: {
@ -46,45 +46,45 @@ module.exports = {
## Unoptimized
```
asset f2fe25321765cafe1394.js 119 KiB [emitted] [immutable] (id hint: vendors)
asset 69c04fd86d28ad70ad54.js 25.7 KiB [emitted] [immutable] (name: main)
asset d55c486284db715b4167.js 15.3 KiB [emitted] [immutable]
chunk (runtime: main) 69c04fd86d28ad70ad54.js (main) 8.58 KiB (javascript) 5.02 KiB (runtime) [entry] [rendered]
asset 4fb93bdcf707906b4096.js 130 KiB [emitted] [immutable] (id hint: vendors)
asset 946bfb099aeb10733813.js 25.5 KiB [emitted] [immutable] (name: main)
asset fc12108f1066403ead6b.js 14.6 KiB [emitted] [immutable]
chunk (runtime: main) 946bfb099aeb10733813.js (main) 6.98 KiB (javascript) 5.02 KiB (runtime) [entry] [rendered]
> ./example main
runtime modules 5.02 KiB 6 modules
dependent modules 8.54 KiB [dependent] 3 modules
dependent modules 6.94 KiB [dependent] 2 modules
./example.js 42 bytes [built] [code generated]
chunk (runtime: main) d55c486284db715b4167.js 6.24 KiB [rendered]
chunk (runtime: main) fc12108f1066403ead6b.js 5.66 KiB [rendered]
> react-dom ./example.js 2:0-22
dependent modules 4.72 KiB [dependent] 1 module
dependent modules 4.14 KiB [dependent] 1 module
../../node_modules/react-dom/index.js 1.33 KiB [built] [code generated]
../../node_modules/scheduler/index.js 198 bytes [built] [code generated]
chunk (runtime: main) f2fe25321765cafe1394.js (id hint: vendors) 118 KiB [rendered] [recorded] aggressive splitted, reused as split chunk (cache group: defaultVendors)
chunk (runtime: main) 4fb93bdcf707906b4096.js (id hint: vendors) 129 KiB [rendered] [recorded] aggressive splitted, reused as split chunk (cache group: defaultVendors)
> react-dom ./example.js 2:0-22
../../node_modules/react-dom/cjs/react-dom.production.min.js 118 KiB [built] [code generated]
webpack 5.51.1 compiled successfully
../../node_modules/react-dom/cjs/react-dom.production.min.js 129 KiB [built] [code generated]
webpack 5.78.0 compiled successfully
```
## Production mode
```
asset c8fa933d7a3ad24388bb.js 115 KiB [emitted] [immutable] [minimized] (id hint: vendors) 1 related asset
asset 0db29d54b9bbcbe2b30c.js 8.6 KiB [emitted] [immutable] [minimized] (name: main) 1 related asset
asset 2dda43f08b24e3f1b2bf.js 4.68 KiB [emitted] [immutable] [minimized] 1 related asset
chunk (runtime: main) 0db29d54b9bbcbe2b30c.js (main) 8.58 KiB (javascript) 5.03 KiB (runtime) [entry] [rendered]
asset 8d87087aa75c47be9b05.js 126 KiB [emitted] [immutable] [minimized] (id hint: vendors) 1 related asset
asset 9d09362c80c0b4708c7a.js 8.14 KiB [emitted] [immutable] [minimized] (name: main) 1 related asset
asset b9e0b2d00d17329af7b7.js 4.12 KiB [emitted] [immutable] [minimized] 1 related asset
chunk (runtime: main) 9d09362c80c0b4708c7a.js (main) 6.98 KiB (javascript) 5.02 KiB (runtime) [entry] [rendered]
> ./example main
runtime modules 5.03 KiB 6 modules
dependent modules 8.54 KiB [dependent] 3 modules
runtime modules 5.02 KiB 6 modules
dependent modules 6.94 KiB [dependent] 2 modules
./example.js 42 bytes [built] [code generated]
chunk (runtime: main) 2dda43f08b24e3f1b2bf.js 6.24 KiB [rendered]
chunk (runtime: main) b9e0b2d00d17329af7b7.js 5.66 KiB [rendered]
> react-dom ./example.js 2:0-22
dependent modules 4.72 KiB [dependent] 1 module
dependent modules 4.14 KiB [dependent] 1 module
../../node_modules/react-dom/index.js 1.33 KiB [built] [code generated]
../../node_modules/scheduler/index.js 198 bytes [built] [code generated]
chunk (runtime: main) c8fa933d7a3ad24388bb.js (id hint: vendors) 118 KiB [rendered] [recorded] aggressive splitted, reused as split chunk (cache group: defaultVendors)
chunk (runtime: main) 8d87087aa75c47be9b05.js (id hint: vendors) 129 KiB [rendered] [recorded] aggressive splitted, reused as split chunk (cache group: defaultVendors)
> react-dom ./example.js 2:0-22
../../node_modules/react-dom/cjs/react-dom.production.min.js 118 KiB [built] [code generated]
webpack 5.51.1 compiled successfully
../../node_modules/react-dom/cjs/react-dom.production.min.js 129 KiB [built] [code generated]
webpack 5.78.0 compiled successfully
```
## Records
@ -93,12 +93,12 @@ webpack 5.51.1 compiled successfully
{
"aggressiveSplits": [
{
"hash": "f2fe25321765cafe1394b09fbb9aa0cb",
"hash": "4fb93bdcf707906b4096f918339c66ef",
"id": 2,
"modules": [
"../../node_modules/react-dom/cjs/react-dom.production.min.js"
],
"size": 120688
"size": 131737
}
],
"chunks": {
@ -118,13 +118,12 @@ webpack 5.51.1 compiled successfully
},
"modules": {
"byIdentifier": {
"../../node_modules/object-assign/index.js": 3,
"../../node_modules/react-dom/cjs/react-dom.production.min.js": 5,
"../../node_modules/react-dom/index.js": 4,
"../../node_modules/react-dom/cjs/react-dom.production.min.js": 4,
"../../node_modules/react-dom/index.js": 3,
"../../node_modules/react/cjs/react.production.min.js": 2,
"../../node_modules/react/index.js": 1,
"../../node_modules/scheduler/cjs/scheduler.production.min.js": 7,
"../../node_modules/scheduler/index.js": 6,
"../../node_modules/scheduler/cjs/scheduler.production.min.js": 6,
"../../node_modules/scheduler/index.js": 5,
"./example.js": 0
},
"usedIds": [
@ -134,8 +133,7 @@ webpack 5.51.1 compiled successfully
3,
4,
5,
6,
7
6
]
}
}

View File

@ -1,7 +1,7 @@
var path = require("path");
var webpack = require("../../");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
cache: true, // better performance for the AggressiveSplittingPlugin
entry: "./example",
output: {

View File

@ -3,7 +3,7 @@
```javascript
var path = require("path");
module.exports = {
// mode: "development || "production",
// mode: "development" || "production",
entry: {
// The entry points for the pages
// They also contains router
@ -366,7 +366,6 @@ render(__webpack_require__(/*! ./aPage */ 2));
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ ;
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
@ -470,7 +469,7 @@ render(__webpack_require__(/*! ./aPage */ 2));
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkIds[i]] = 0;
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ return __webpack_require__.O(result);
/******/ }
@ -531,8 +530,8 @@ asset pageA.bundle.js 13 KiB [emitted] (name: pageA)
asset router_js.bundle.js 2.45 KiB [emitted]
asset aPage.bundle.js 392 bytes [emitted] (name: aPage)
asset bPage.bundle.js 392 bytes [emitted] (name: bPage)
Entrypoint pageA 15.9 KiB = router_js.bundle.js 2.45 KiB aPage.bundle.js 392 bytes pageA.bundle.js 13 KiB
Entrypoint pageB 15.9 KiB = router_js.bundle.js 2.45 KiB bPage.bundle.js 392 bytes pageB.bundle.js 13 KiB
Entrypoint pageA 15.8 KiB = router_js.bundle.js 2.45 KiB aPage.bundle.js 392 bytes pageA.bundle.js 13 KiB
Entrypoint pageB 15.8 KiB = router_js.bundle.js 2.45 KiB bPage.bundle.js 392 bytes pageB.bundle.js 13 KiB
chunk (runtime: pageA, pageB) aPage.bundle.js (aPage) 59 bytes [initial] [rendered] reused as split chunk (cache group: default)
> ./aPage ././ lazy ^\.\/.*Page$ chunkName: [request] namespace object ./aPage
> ./aEntry pageA
@ -575,7 +574,7 @@ chunk (runtime: pageA, pageB) router_js.bundle.js 951 bytes [initial] [rendered]
[used exports unknown]
entry ./router pageA
entry ./router pageB
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```
## Production mode
@ -630,5 +629,5 @@ chunk (runtime: pageA, pageB) router_js.bundle.js 951 bytes [initial] [rendered]
[no exports used]
entry ./router pageA
entry ./router pageB
webpack 5.51.1 compiled successfully
webpack 5.78.0 compiled successfully
```

Some files were not shown because too many files have changed in this diff Show More