Skip to content

Commit

Permalink
Merge pull request #13660 from chenxsan/bugfix/update-webpack-options
Browse files Browse the repository at this point in the history
update webpack options
  • Loading branch information
sokra committed Jun 29, 2021
2 parents c9b310b + b0850fc commit 3863b42
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 41 deletions.
28 changes: 15 additions & 13 deletions declarations/WebpackOptions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export type EntryStatic = EntryObject | EntryUnnamed;
*/
export type EntryItem = string[] | string;
/**
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
* 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).
*/
export type ChunkLoading = false | ChunkLoadingType;
/**
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
* 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).
*/
export type ChunkLoadingType =
| ("jsonp" | "import-scripts" | "require" | "async-node")
| ("jsonp" | "import-scripts" | "require" | "async-node" | "import")
| string;
/**
* Specifies the filename of the output file 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.
Expand Down Expand Up @@ -413,9 +413,11 @@ export type Charset = boolean;
*/
export type ChunkFilename = FilenameTemplate;
/**
* The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
* The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
*/
export type ChunkFormat = ("array-push" | "commonjs" | false) | string;
export type ChunkFormat =
| ("array-push" | "commonjs" | "module" | false)
| string;
/**
* Number of milliseconds before chunk request expires.
*/
Expand Down Expand Up @@ -984,7 +986,7 @@ export interface EntryObject {
*/
export interface EntryDescription {
/**
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
* 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).
*/
chunkLoading?: ChunkLoading;
/**
Expand Down Expand Up @@ -1950,15 +1952,15 @@ export interface Output {
*/
chunkFilename?: ChunkFilename;
/**
* The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
* The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
*/
chunkFormat?: ChunkFormat;
/**
* Number of milliseconds before chunk request expires.
*/
chunkLoadTimeout?: ChunkLoadTimeout;
/**
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
* 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).
*/
chunkLoading?: ChunkLoading;
/**
Expand Down Expand Up @@ -2122,7 +2124,7 @@ export interface Output {
*/
webassemblyModuleFilename?: WebassemblyModuleFilename;
/**
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
* 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;
/**
Expand Down Expand Up @@ -2690,7 +2692,7 @@ export interface EmptyParserOptions {}
*/
export interface EntryDescriptionNormalized {
/**
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
* 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).
*/
chunkLoading?: ChunkLoading;
/**
Expand Down Expand Up @@ -2928,15 +2930,15 @@ export interface OutputNormalized {
*/
chunkFilename?: ChunkFilename;
/**
* The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
* The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
*/
chunkFormat?: ChunkFormat;
/**
* Number of milliseconds before chunk request expires.
*/
chunkLoadTimeout?: ChunkLoadTimeout;
/**
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
* 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).
*/
chunkLoading?: ChunkLoading;
/**
Expand Down Expand Up @@ -3088,7 +3090,7 @@ export interface OutputNormalized {
*/
webassemblyModuleFilename?: WebassemblyModuleFilename;
/**
* The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
* 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;
/**
Expand Down
2 changes: 1 addition & 1 deletion schemas/WebpackOptions.check.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions schemas/WebpackOptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@
]
},
"ChunkFormat": {
"description": "The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).",
"description": "The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).",
"anyOf": [
{
"enum": ["array-push", "commonjs", false]
"enum": ["array-push", "commonjs", "module", false]
},
{
"type": "string"
Expand All @@ -258,7 +258,7 @@
"type": "number"
},
"ChunkLoading": {
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"anyOf": [
{
"enum": [false]
Expand All @@ -273,10 +273,10 @@
"type": "string"
},
"ChunkLoadingType": {
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"anyOf": [
{
"enum": ["jsonp", "import-scripts", "require", "async-node"]
"enum": ["jsonp", "import-scripts", "require", "async-node", "import"]
},
{
"type": "string"
Expand Down
32 changes: 18 additions & 14 deletions test/__snapshots__/Cli.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4477,24 +4477,25 @@ Object {
"output-chunk-format": Object {
"configs": Array [
Object {
"description": "The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).",
"description": "The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).",
"multiple": false,
"path": "output.chunkFormat",
"type": "enum",
"values": Array [
"array-push",
"commonjs",
"module",
false,
],
},
Object {
"description": "The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).",
"description": "The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).",
"multiple": false,
"path": "output.chunkFormat",
"type": "string",
},
],
"description": "The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).",
"description": "The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).",
"multiple": false,
"simpleType": "string",
},
Expand All @@ -4514,7 +4515,7 @@ Object {
"output-chunk-loading": Object {
"configs": Array [
Object {
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"multiple": false,
"path": "output.chunkLoading",
"type": "enum",
Expand All @@ -4523,7 +4524,7 @@ Object {
],
},
Object {
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"multiple": false,
"path": "output.chunkLoading",
"type": "enum",
Expand All @@ -4532,16 +4533,17 @@ Object {
"import-scripts",
"require",
"async-node",
"import",
],
},
Object {
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"multiple": false,
"path": "output.chunkLoading",
"type": "string",
},
],
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"multiple": false,
"simpleType": "string",
},
Expand Down Expand Up @@ -4676,7 +4678,7 @@ Object {
"output-enabled-chunk-loading-types": Object {
"configs": Array [
Object {
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"multiple": true,
"path": "output.enabledChunkLoadingTypes[]",
"type": "enum",
Expand All @@ -4685,16 +4687,17 @@ Object {
"import-scripts",
"require",
"async-node",
"import",
],
},
Object {
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"multiple": true,
"path": "output.enabledChunkLoadingTypes[]",
"type": "string",
},
],
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"multiple": true,
"simpleType": "string",
},
Expand Down Expand Up @@ -5581,7 +5584,7 @@ Object {
"output-worker-chunk-loading": Object {
"configs": Array [
Object {
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"multiple": false,
"path": "output.workerChunkLoading",
"type": "enum",
Expand All @@ -5590,7 +5593,7 @@ Object {
],
},
Object {
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"multiple": false,
"path": "output.workerChunkLoading",
"type": "enum",
Expand All @@ -5599,16 +5602,17 @@ Object {
"import-scripts",
"require",
"async-node",
"import",
],
},
Object {
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"multiple": false,
"path": "output.workerChunkLoading",
"type": "string",
},
],
"description": "The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).",
"description": "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).",
"multiple": false,
"simpleType": "string",
},
Expand Down
Loading

0 comments on commit 3863b42

Please sign in to comment.