Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default defineConfig([
"!test/helpers/*.*",
"!test/benchmarkCases/**/*.mjs",
"!test/_helpers/**/*.mjs",
"!test/runner/*.js",
"test/js/**/*.*",

// TODO fix me
Expand Down Expand Up @@ -83,12 +84,6 @@ export default defineConfig([
}
],
// TODO enable me in future
"unicorn/prefer-regexp-test": "off",
"unicorn/prefer-string-slice": "off",
// TODO false positive, need to fix in upstream
"n/prefer-node-protocol": "off",
"n/prefer-global/url": "off",
// TODO enable me in future
"prefer-destructuring": "off"
}
},
Expand Down Expand Up @@ -159,6 +154,9 @@ export default defineConfig([
// TODO enable me
strict: "off",

// Some our tests contain `package.json` without `engines`, but tests should work on Node.js@10, so let's disable it
"n/prefer-node-protocol": "off",

// No need here, we have custom test logic, so except can be placed in different places
"jest/no-standalone-expect": "off",

Expand Down
2 changes: 2 additions & 0 deletions examples/aggressive-merging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ a big file...
# webpack.config.js

```javascript
"use strict";

const path = require("path");
const { AggressiveMergingPlugin } = require("../..").optimize;

Expand Down
2 changes: 2 additions & 0 deletions examples/asset-advanced/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ function createImageElement(title, src) {
# webpack.config.js

```javascript
"use strict";

const svgToMiniDataURI = require("mini-svg-data-uri");

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions examples/asset-simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ function createImageElement(title, src) {
# webpack.config.js

```javascript
"use strict";

module.exports = {
output: {
assetModuleFilename: "images/[hash][ext]"
Expand Down
2 changes: 2 additions & 0 deletions examples/build-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ console.log(pMap4);
# webpack.config.js

```javascript
"use strict";

module.exports = {
// enable debug logging to see network requests!
// stats: {
Expand Down
2 changes: 2 additions & 0 deletions examples/chunkhash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import("./async2");
# webpack.config.js

```javascript
"use strict";

const path = require("path");

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions examples/code-splitting-depend-on-advanced/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ This example shows how to use Code Splitting with entrypoint dependOn
# webpack.config.js

```javascript
"use strict";

module.exports = {
entry: {
app: { import: "./app.js", dependOn: ["other-vendors"] },
Expand Down
2 changes: 2 additions & 0 deletions examples/code-splitting-depend-on-simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ This example shows how to use Code Splitting with entrypoint dependOn
# webpack.config.js

```javascript
"use strict";

module.exports = {
entry: {
app: { import: "./app.js", dependOn: ["react-vendors"] },
Expand Down
2 changes: 2 additions & 0 deletions examples/common-chunk-and-vendor-chunk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ With this bundle configuration, you would load your third party libraries, then
# webpack.config.js

```javascript
"use strict";

const path = require("path");

module.exports = {
Expand Down
1 change: 1 addition & 0 deletions examples/common-chunk-grandchildren/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ module.exports = function() {

```javascript
"use strict";

const path = require("path");

module.exports = {
Expand Down
4 changes: 3 additions & 1 deletion examples/custom-json-modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ document.querySelector('#app').innerHTML = [toml, yaml, json].map(data => `
# webpack.config.js

```javascript
const toml = require("toml");
"use strict";

const json5 = require("json5");
const toml = require("toml");
const yaml = require("yamljs");

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions examples/dll-entry-only/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export { c } from "./cjs";
# webpack.config.js

```javascript
"use strict";

const path = require("path");
const webpack = require("../../");

Expand Down
34 changes: 18 additions & 16 deletions examples/dll-user/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This is the _user_ bundle, which uses the manifest from [dll-reference example](
# webpack.config.js

```javascript
"use strict";

const path = require("path");
const webpack = require("../../");

Expand Down Expand Up @@ -47,94 +49,94 @@ console.log(require("module"));
/* 0 */,
/* 1 */
/*!**************************************************************************!*\
!*** delegated ./alpha.js from dll-reference alpha_2239422b902ff2ef1cc1 ***!
!*** delegated ./alpha.js from dll-reference alpha_a1d5c7116e082d77ec3e ***!
\**************************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

module.exports = (__webpack_require__(/*! dll-reference alpha_2239422b902ff2ef1cc1 */ 2))(1);
module.exports = (__webpack_require__(/*! dll-reference alpha_a1d5c7116e082d77ec3e */ 2))(1);

/***/ }),
/* 2 */
/*!*********************************************!*\
!*** external "alpha_2239422b902ff2ef1cc1" ***!
!*** external "alpha_a1d5c7116e082d77ec3e" ***!
\*********************************************/
/*! dynamic exports */
/*! exports [maybe provided (runtime-defined)] [no usage info] */
/*! runtime requirements: module */
/***/ ((module) => {

"use strict";
module.exports = alpha_2239422b902ff2ef1cc1;
module.exports = alpha_a1d5c7116e082d77ec3e;

/***/ }),
/* 3 */
/*!**********************************************************************!*\
!*** delegated ./a.js from dll-reference alpha_2239422b902ff2ef1cc1 ***!
!*** delegated ./a.js from dll-reference alpha_a1d5c7116e082d77ec3e ***!
\**********************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

module.exports = (__webpack_require__(/*! dll-reference alpha_2239422b902ff2ef1cc1 */ 2))(2);
module.exports = (__webpack_require__(/*! dll-reference alpha_a1d5c7116e082d77ec3e */ 2))(2);

/***/ }),
/* 4 */
/*!************************************************************************!*\
!*** delegated ./beta.js from dll-reference beta_2239422b902ff2ef1cc1 ***!
!*** delegated ./beta.js from dll-reference beta_a1d5c7116e082d77ec3e ***!
\************************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

module.exports = (__webpack_require__(/*! dll-reference beta_2239422b902ff2ef1cc1 */ 5))(5);
module.exports = (__webpack_require__(/*! dll-reference beta_a1d5c7116e082d77ec3e */ 5))(5);

/***/ }),
/* 5 */
/*!********************************************!*\
!*** external "beta_2239422b902ff2ef1cc1" ***!
!*** external "beta_a1d5c7116e082d77ec3e" ***!
\********************************************/
/*! dynamic exports */
/*! exports [maybe provided (runtime-defined)] [no usage info] */
/*! runtime requirements: module */
/***/ ((module) => {

"use strict";
module.exports = beta_2239422b902ff2ef1cc1;
module.exports = beta_a1d5c7116e082d77ec3e;

/***/ }),
/* 6 */
/*!*********************************************************************!*\
!*** delegated ./b.js from dll-reference beta_2239422b902ff2ef1cc1 ***!
!*** delegated ./b.js from dll-reference beta_a1d5c7116e082d77ec3e ***!
\*********************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

module.exports = (__webpack_require__(/*! dll-reference beta_2239422b902ff2ef1cc1 */ 5))(6);
module.exports = (__webpack_require__(/*! dll-reference beta_a1d5c7116e082d77ec3e */ 5))(6);

/***/ }),
/* 7 */
/*!**********************************************************************!*\
!*** delegated ./c.jsx from dll-reference beta_2239422b902ff2ef1cc1 ***!
!*** delegated ./c.jsx from dll-reference beta_a1d5c7116e082d77ec3e ***!
\**********************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

module.exports = (__webpack_require__(/*! dll-reference beta_2239422b902ff2ef1cc1 */ 5))(7);
module.exports = (__webpack_require__(/*! dll-reference beta_a1d5c7116e082d77ec3e */ 5))(7);

/***/ }),
/* 8 */
/*!*****************************************************************************************!*\
!*** delegated ../node_modules/module.js from dll-reference alpha_2239422b902ff2ef1cc1 ***!
!*** delegated ../node_modules/module.js from dll-reference alpha_a1d5c7116e082d77ec3e ***!
\*****************************************************************************************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: module, __webpack_require__ */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

module.exports = (__webpack_require__(/*! dll-reference alpha_2239422b902ff2ef1cc1 */ 2))(3);
module.exports = (__webpack_require__(/*! dll-reference alpha_a1d5c7116e082d77ec3e */ 2))(3);

/***/ })
/******/ ]);
Expand Down
16 changes: 9 additions & 7 deletions examples/dll/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This is the _reference_ bundle (with the manifests) for [dll user example](https
# webpack.config.js

```javascript
"use strict";

const path = require("path");
const webpack = require("../../");

Expand Down Expand Up @@ -36,7 +38,7 @@ module.exports = {
# dist/MyDll.alpha.js

```javascript
var alpha_2239422b902ff2ef1cc1;
var alpha_a1d5c7116e082d77ec3e;
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ([
/* 0 */
Expand Down Expand Up @@ -129,7 +131,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_2239422b902ff2ef1cc1 = __webpack_exports__;
/******/ alpha_a1d5c7116e082d77ec3e = __webpack_exports__;
/******/
/******/ })()
;
Expand All @@ -138,7 +140,7 @@ module.exports = "module";
# dist/alpha-manifest.json

```javascript
{"name":"alpha_2239422b902ff2ef1cc1","content":{"./alpha.js":{"id":1,"buildMeta":{}},"./a.js":{"id":2,"buildMeta":{}},"../node_modules/module.js":{"id":3,"buildMeta":{}}}}
{"name":"alpha_a1d5c7116e082d77ec3e","content":{"./alpha.js":{"id":1,"buildMeta":{}},"./a.js":{"id":2,"buildMeta":{}},"../node_modules/module.js":{"id":3,"buildMeta":{}}}}
```

# Info
Expand All @@ -155,9 +157,9 @@ chunk (runtime: alpha) MyDll.alpha.js (alpha) 85 bytes [entry] [rendered]
[used exports unknown]
dll entry
used as library export
chunk (runtime: beta) MyDll.beta.js (beta) 80 bytes [entry] [rendered]
chunk (runtime: beta) MyDll.beta.js (beta) 81 bytes [entry] [rendered]
> beta
dependent modules 68 bytes [dependent] 3 modules
dependent modules 69 bytes [dependent] 3 modules
dll beta 12 bytes [built] [code generated]
[used exports unknown]
dll entry
Expand All @@ -170,9 +172,9 @@ webpack X.X.X compiled successfully
```
asset MyDll.alpha.js 313 bytes [emitted] [minimized] (name: alpha)
asset MyDll.beta.js 307 bytes [emitted] [minimized] (name: beta)
chunk (runtime: beta) MyDll.beta.js (beta) 80 bytes [entry] [rendered]
chunk (runtime: beta) MyDll.beta.js (beta) 81 bytes [entry] [rendered]
> beta
dependent modules 68 bytes [dependent] 3 modules
dependent modules 69 bytes [dependent] 3 modules
dll beta 12 bytes [built] [code generated]
dll entry
used as library export
Expand Down
2 changes: 2 additions & 0 deletions examples/explicit-vendor-chunk/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# webpack.config.js

```javascript
"use strict";

const path = require("path");
const webpack = require("../../");

Expand Down
2 changes: 2 additions & 0 deletions examples/externals/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ exports.exampleValue = subtract(add(42, 2), 2);
# webpack.config.js

```javascript
"use strict";

module.exports = {
// mode: "development" || "production",
output: {
Expand Down
2 changes: 2 additions & 0 deletions examples/extra-async-chunk-advanced/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ require.ensure(["./a", "./e"], function(require) {
# webpack.config.js

```javascript
"use strict";

module.exports = {
// mode: "development" || "production",
optimization: {
Expand Down
2 changes: 2 additions & 0 deletions examples/harmony-library/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# webpack.config.js

```javascript
"use strict";

const path = require("path");

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions examples/http2-aggressive-splitting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ The compression improves with bigger `maxSize`, as gzip works better for bigger
The backward compatibility (non-HTTP2 client) improves with bigger `maxSize`, as the number of requests decreases.

```js
"use strict";

const path = require("path");
const webpack = require("../../");

Expand Down
2 changes: 2 additions & 0 deletions examples/hybrid-routing/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# webpack.config.js

```javascript
"use strict";

const path = require("path");

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions examples/lazy-compilation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ document.body.appendChild(pre);
# webpack.config.js

```javascript
"use strict";

const { HotModuleReplacementPlugin } = require("../../");

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions examples/many-pages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Note: decreasing `maxInitial/AsyncRequest` will increase duplication further to
## webpack.config.js

```
"use strict";

module.exports = {
// mode: "development" || "production",
entry: {
Expand Down
Loading
Loading