mirror of https://github.com/webpack/webpack.git
all: typo fixes
This commit is contained in:
parent
499cb3cec2
commit
271b77d45f
|
@ -27,7 +27,7 @@ yarn link webpack
|
||||||
yarn test
|
yarn test
|
||||||
```
|
```
|
||||||
|
|
||||||
### To run only intergration tests use
|
### To run only integration tests use
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn test:integration
|
yarn test:integration
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Info
|
# Info
|
||||||
|
|
||||||
This example illustrates webpack's algorthim for automatic deduplication using `optimization.splitChunks`.
|
This example illustrates webpack's algorithm for automatic deduplication using `optimization.splitChunks`.
|
||||||
|
|
||||||
This example application contains 7 pages, each of them importing 1-3 modules from the `node_modules` folder (vendor libs) and 0-3 modules from the `stuff` folder (application modules). In reallity an application is probably more complex, but the same mechanisms apply.
|
This example application contains 7 pages, each of them importing 1-3 modules from the `node_modules` folder (vendor libs) and 0-3 modules from the `stuff` folder (application modules). In reallity an application is probably more complex, but the same mechanisms apply.
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ module.exports = {
|
||||||
chunks: "all",
|
chunks: "all",
|
||||||
maxInitialRequests: 20, // for HTTP2
|
maxInitialRequests: 20, // for HTTP2
|
||||||
maxAsyncRequests: 20, // for HTTP2
|
maxAsyncRequests: 20, // for HTTP2
|
||||||
minSize: 40 // for example only: choosen to match 2 modules
|
minSize: 40 // for example only: chosen to match 2 modules
|
||||||
// omit minSize in real use case to use the default of 30kb
|
// omit minSize in real use case to use the default of 30kb
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Info
|
# Info
|
||||||
|
|
||||||
This example illustrates webpack's algorthim for automatic deduplication using `optimization.splitChunks`.
|
This example illustrates webpack's algorithm for automatic deduplication using `optimization.splitChunks`.
|
||||||
|
|
||||||
This example application contains 7 pages, each of them importing 1-3 modules from the `node_modules` folder (vendor libs) and 0-3 modules from the `stuff` folder (application modules). In reallity an application is probably more complex, but the same mechanisms apply.
|
This example application contains 7 pages, each of them importing 1-3 modules from the `node_modules` folder (vendor libs) and 0-3 modules from the `stuff` folder (application modules). In reallity an application is probably more complex, but the same mechanisms apply.
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ module.exports = {
|
||||||
chunks: "all",
|
chunks: "all",
|
||||||
maxInitialRequests: 20, // for HTTP2
|
maxInitialRequests: 20, // for HTTP2
|
||||||
maxAsyncRequests: 20, // for HTTP2
|
maxAsyncRequests: 20, // for HTTP2
|
||||||
minSize: 40 // for example only: choosen to match 2 modules
|
minSize: 40 // for example only: chosen to match 2 modules
|
||||||
// omit minSize in real use case to use the default of 30kb
|
// omit minSize in real use case to use the default of 30kb
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -628,7 +628,7 @@ class Chunk {
|
||||||
list.sort((a, b) => {
|
list.sort((a, b) => {
|
||||||
const cmp = b.order - a.order;
|
const cmp = b.order - a.order;
|
||||||
if (cmp !== 0) return cmp;
|
if (cmp !== 0) return cmp;
|
||||||
// TOOD webpack 5 remove this check of compareTo
|
// TODO webpack 5 remove this check of compareTo
|
||||||
if (a.group.compareTo) {
|
if (a.group.compareTo) {
|
||||||
return a.group.compareTo(b.group);
|
return a.group.compareTo(b.group);
|
||||||
}
|
}
|
||||||
|
|
|
@ -442,7 +442,7 @@ class ChunkGroup {
|
||||||
list.sort((a, b) => {
|
list.sort((a, b) => {
|
||||||
const cmp = b.order - a.order;
|
const cmp = b.order - a.order;
|
||||||
if (cmp !== 0) return cmp;
|
if (cmp !== 0) return cmp;
|
||||||
// TOOD webpack 5 remove this check of compareTo
|
// TODO webpack 5 remove this check of compareTo
|
||||||
if (a.group.compareTo) {
|
if (a.group.compareTo) {
|
||||||
return a.group.compareTo(b.group);
|
return a.group.compareTo(b.group);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1453,7 +1453,7 @@ class Compilation extends Tapable {
|
||||||
* @returns {DependencyReference} a reference for the dependency
|
* @returns {DependencyReference} a reference for the dependency
|
||||||
*/
|
*/
|
||||||
getDependencyReference(module, dependency) {
|
getDependencyReference(module, dependency) {
|
||||||
// TODO remove dep.getReference existance check in webpack 5
|
// TODO remove dep.getReference existence check in webpack 5
|
||||||
if (typeof dependency.getReference !== "function") return null;
|
if (typeof dependency.getReference !== "function") return null;
|
||||||
const ref = dependency.getReference();
|
const ref = dependency.getReference();
|
||||||
if (!ref) return null;
|
if (!ref) return null;
|
||||||
|
@ -2113,7 +2113,7 @@ class Compilation extends Tapable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to sort errors and warnings in compilation. this.warnings, and
|
* Used to sort errors and warnings in compilation. this.warnings, and
|
||||||
* this.errors contribute to the compilation hash and therefore shoudl be
|
* this.errors contribute to the compilation hash and therefore should be
|
||||||
* updated whenever other references (having a chunk id) are sorted. This preserves the hash
|
* updated whenever other references (having a chunk id) are sorted. This preserves the hash
|
||||||
* integrity
|
* integrity
|
||||||
*
|
*
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Generator {
|
||||||
* @returns {Source} generated code
|
* @returns {Source} generated code
|
||||||
*/
|
*/
|
||||||
generate(module, dependencyTemplates, runtimeTemplate, type) {
|
generate(module, dependencyTemplates, runtimeTemplate, type) {
|
||||||
throw new Error("Generator.generate: must be overriden");
|
throw new Error("Generator.generate: must be overridden");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -645,7 +645,7 @@ module.exports = class SplitChunksPlugin {
|
||||||
isReused = true;
|
isReused = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check if maxRequests condition can be fullfilled
|
// Check if maxRequests condition can be fulfilled
|
||||||
|
|
||||||
const usedChunks = Array.from(item.chunks).filter(chunk => {
|
const usedChunks = Array.from(item.chunks).filter(chunk => {
|
||||||
// skip if we address ourself
|
// skip if we address ourself
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
const mergeCache = new WeakMap();
|
const mergeCache = new WeakMap();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merges two given objects and caches the result to avoid computation if same objects passed as arguements again.
|
* Merges two given objects and caches the result to avoid computation if same objects passed as arguments again.
|
||||||
* @example
|
* @example
|
||||||
* // performs Object.assign(first, second), stores the result in WeakMap and returns result
|
* // performs Object.assign(first, second), stores the result in WeakMap and returns result
|
||||||
* cachedMerge({a: 1}, {a: 2})
|
* cachedMerge({a: 1}, {a: 2})
|
||||||
|
|
|
@ -186,7 +186,7 @@ module.exports = ({ maxSize, minSize, items, getSize, getKey }) => {
|
||||||
if (left <= right) {
|
if (left <= right) {
|
||||||
// when there is a area between left and right
|
// when there is a area between left and right
|
||||||
// we look for best split point
|
// we look for best split point
|
||||||
// we split at the minimum similiarity
|
// we split at the minimum similarity
|
||||||
// here key space is separated the most
|
// here key space is separated the most
|
||||||
let best = left - 1;
|
let best = left - 1;
|
||||||
let bestSimilarity = group.similarities[best];
|
let bestSimilarity = group.similarities[best];
|
||||||
|
|
Loading…
Reference in New Issue