webpack 5.106.2 → 5.107.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/APIPlugin.js +1 -1
- package/lib/Cache.js +3 -6
- package/lib/CompatibilityPlugin.js +8 -7
- package/lib/Compilation.js +34 -26
- package/lib/Compiler.js +4 -13
- package/lib/ContextModule.js +2 -2
- package/lib/DefinePlugin.js +2 -2
- package/lib/Dependency.js +22 -1
- package/lib/DependencyTemplate.js +2 -1
- package/lib/EnvironmentPlugin.js +1 -1
- package/lib/EvalSourceMapDevToolPlugin.js +8 -9
- package/lib/ExternalModule.js +76 -15
- package/lib/ExternalModuleFactoryPlugin.js +5 -0
- package/lib/FileSystemInfo.js +187 -72
- package/lib/Generator.js +3 -3
- package/lib/HotModuleReplacementPlugin.js +26 -8
- package/lib/IgnorePlugin.js +2 -1
- package/lib/Module.js +19 -18
- package/lib/ModuleFactory.js +1 -1
- package/lib/ModuleSourceTypeConstants.js +31 -1
- package/lib/ModuleTypeConstants.js +12 -3
- package/lib/MultiCompiler.js +2 -2
- package/lib/NodeStuffPlugin.js +1 -1
- package/lib/NormalModule.js +13 -31
- package/lib/NormalModuleFactory.js +10 -2
- package/lib/Parser.js +1 -1
- package/lib/ProgressPlugin.js +129 -56
- package/lib/RuntimeGlobals.js +5 -5
- package/lib/RuntimeModule.js +9 -7
- package/lib/RuntimePlugin.js +11 -0
- package/lib/WarnCaseSensitiveModulesPlugin.js +70 -2
- package/lib/WarnDeprecatedOptionPlugin.js +1 -1
- package/lib/WarnNoModeSetPlugin.js +16 -1
- package/lib/Watching.js +2 -3
- package/lib/WebpackError.js +3 -77
- package/lib/WebpackIsIncludedPlugin.js +1 -1
- package/lib/WebpackOptionsApply.js +13 -1
- package/lib/asset/AssetBytesGenerator.js +6 -2
- package/lib/asset/AssetGenerator.js +22 -8
- package/lib/asset/AssetModulesPlugin.js +3 -1
- package/lib/asset/AssetSourceGenerator.js +6 -2
- package/lib/buildChunkGraph.js +4 -6
- package/lib/cache/PackFileCacheStrategy.js +4 -4
- package/lib/cli.js +3 -1
- package/lib/config/defaults.js +197 -10
- package/lib/config/normalization.js +3 -1
- package/lib/css/CssGenerator.js +320 -105
- package/lib/css/CssInjectStyleRuntimeModule.js +44 -42
- package/lib/css/CssLoadingRuntimeModule.js +22 -4
- package/lib/{CssModule.js → css/CssModule.js} +15 -15
- package/lib/css/CssModulesPlugin.js +166 -86
- package/lib/css/CssParser.js +566 -269
- package/lib/css/walkCssTokens.js +148 -2
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +1 -1
- package/lib/dependencies/CommonJsDependencyHelpers.js +63 -0
- package/lib/dependencies/CommonJsExportRequireDependency.js +54 -10
- package/lib/dependencies/CommonJsExportsParserPlugin.js +1 -1
- package/lib/dependencies/CommonJsFullRequireDependency.js +32 -9
- package/lib/dependencies/CommonJsImportsParserPlugin.js +4 -3
- package/lib/dependencies/CommonJsRequireDependency.js +67 -4
- package/lib/dependencies/ContextDependency.js +1 -1
- package/lib/dependencies/ContextDependencyHelpers.js +1 -1
- package/lib/dependencies/CreateRequireParserPlugin.js +1 -1
- package/lib/dependencies/CriticalDependencyWarning.js +1 -1
- package/lib/dependencies/CssIcssExportDependency.js +332 -67
- package/lib/dependencies/CssIcssImportDependency.js +49 -7
- package/lib/dependencies/CssIcssSymbolDependency.js +11 -3
- package/lib/dependencies/CssImportDependency.js +8 -0
- package/lib/dependencies/CssUrlDependency.js +25 -0
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +1 -1
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +8 -7
- package/lib/dependencies/HarmonyExportExpressionDependency.js +22 -14
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +110 -3
- package/lib/dependencies/HarmonyImportDependency.js +10 -2
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +22 -1
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +1 -1
- package/lib/{HarmonyLinkingError.js → dependencies/HarmonyLinkingError.js} +5 -3
- package/lib/dependencies/HtmlInlineScriptDependency.js +133 -0
- package/lib/dependencies/HtmlInlineStyleDependency.js +101 -0
- package/lib/dependencies/HtmlScriptSrcDependency.js +318 -0
- package/lib/dependencies/HtmlSourceDependency.js +127 -0
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +1 -1
- package/lib/dependencies/ImportParserPlugin.js +2 -2
- package/lib/dependencies/ImportPhase.js +1 -1
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +1 -1
- package/lib/{RequireJsStuffPlugin.js → dependencies/RequireJsStuffPlugin.js} +7 -7
- package/lib/dependencies/SystemPlugin.js +1 -1
- package/lib/dependencies/WebAssemblyImportDependency.js +1 -1
- package/lib/dependencies/WorkerPlugin.js +2 -2
- package/lib/{DelegatedModule.js → dll/DelegatedModule.js} +31 -31
- package/lib/{DelegatedModuleFactoryPlugin.js → dll/DelegatedModuleFactoryPlugin.js} +4 -4
- package/lib/{DelegatedPlugin.js → dll/DelegatedPlugin.js} +2 -2
- package/lib/{DllEntryPlugin.js → dll/DllEntryPlugin.js} +4 -4
- package/lib/{DllModule.js → dll/DllModule.js} +24 -24
- package/lib/{DllModuleFactory.js → dll/DllModuleFactory.js} +4 -4
- package/lib/{DllPlugin.js → dll/DllPlugin.js} +6 -5
- package/lib/{DllReferencePlugin.js → dll/DllReferencePlugin.js} +14 -14
- package/lib/{LibManifestPlugin.js → dll/LibManifestPlugin.js} +9 -9
- package/lib/{AsyncDependencyToInitialChunkError.js → errors/AsyncDependencyToInitialChunkError.js} +2 -2
- package/lib/errors/BuildCycleError.js +1 -1
- package/lib/{ChunkRenderError.js → errors/ChunkRenderError.js} +1 -1
- package/lib/{CodeGenerationError.js → errors/CodeGenerationError.js} +1 -1
- package/lib/{CommentCompilationWarning.js → errors/CommentCompilationWarning.js} +3 -3
- package/lib/{ConcurrentCompilationError.js → errors/ConcurrentCompilationError.js} +4 -2
- package/lib/{EnvironmentNotSupportAsyncWarning.js → errors/EnvironmentNotSupportAsyncWarning.js} +4 -4
- package/lib/{HookWebpackError.js → errors/HookWebpackError.js} +5 -5
- package/lib/{IgnoreErrorModuleFactory.js → errors/IgnoreErrorModuleFactory.js} +4 -4
- package/lib/{InvalidDependenciesModuleWarning.js → errors/InvalidDependenciesModuleWarning.js} +3 -3
- package/lib/errors/JSONParseError.js +114 -0
- package/lib/{ModuleBuildError.js → errors/ModuleBuildError.js} +5 -5
- package/lib/{ModuleDependencyError.js → errors/ModuleDependencyError.js} +2 -2
- package/lib/{ModuleDependencyWarning.js → errors/ModuleDependencyWarning.js} +4 -4
- package/lib/{ModuleError.js → errors/ModuleError.js} +5 -5
- package/lib/{ModuleHashingError.js → errors/ModuleHashingError.js} +1 -1
- package/lib/{ModuleNotFoundError.js → errors/ModuleNotFoundError.js} +2 -2
- package/lib/{ModuleParseError.js → errors/ModuleParseError.js} +8 -6
- package/lib/{ModuleRestoreError.js → errors/ModuleRestoreError.js} +1 -1
- package/lib/{ModuleStoreError.js → errors/ModuleStoreError.js} +1 -1
- package/lib/{ModuleWarning.js → errors/ModuleWarning.js} +5 -5
- package/lib/{NodeStuffInWebError.js → errors/NodeStuffInWebError.js} +4 -4
- package/lib/errors/NonErrorEmittedError.js +28 -0
- package/lib/{UnhandledSchemeError.js → errors/UnhandledSchemeError.js} +2 -2
- package/lib/{UnsupportedFeatureWarning.js → errors/UnsupportedFeatureWarning.js} +3 -3
- package/lib/errors/WebpackError.js +84 -0
- package/lib/html/HtmlGenerator.js +379 -0
- package/lib/html/HtmlModulesPlugin.js +433 -0
- package/lib/html/HtmlParser.js +1489 -0
- package/lib/html/walkHtmlTokens.js +2733 -0
- package/lib/ids/IdHelpers.js +2 -1
- package/lib/index.js +34 -15
- package/lib/javascript/JavascriptModulesPlugin.js +89 -8
- package/lib/javascript/JavascriptParser.js +197 -16
- package/lib/javascript/JavascriptParserHelpers.js +1 -1
- package/lib/json/JsonParser.js +7 -16
- package/lib/library/AbstractLibraryPlugin.js +1 -1
- package/lib/library/EnableLibraryPlugin.js +1 -1
- package/lib/{FalseIIFEUmdWarning.js → library/FalseIIFEUmdWarning.js} +1 -1
- package/lib/library/ModuleLibraryPlugin.js +74 -0
- package/lib/node/NodeEnvironmentPlugin.js +4 -2
- package/lib/node/nodeConsole.js +113 -64
- package/lib/optimize/ConcatenatedModule.js +51 -6
- package/lib/optimize/InnerGraph.js +1 -1
- package/lib/optimize/InnerGraphPlugin.js +11 -1
- package/lib/optimize/MinMaxSizeWarning.js +4 -4
- package/lib/optimize/ModuleConcatenationPlugin.js +15 -7
- package/lib/optimize/RealContentHashPlugin.js +89 -26
- package/lib/optimize/SideEffectsFlagPlugin.js +111 -3
- package/lib/optimize/SplitChunksPlugin.js +1 -1
- package/lib/performance/AssetsOverSizeLimitWarning.js +2 -2
- package/lib/performance/EntrypointsOverSizeLimitWarning.js +2 -2
- package/lib/performance/NoAsyncChunksWarning.js +5 -3
- package/lib/performance/SizeLimitsPlugin.js +1 -1
- package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +4 -1
- package/lib/rules/UseEffectRulePlugin.js +4 -3
- package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +119 -13
- package/lib/runtime/SetAnonymousDefaultNameRuntimeModule.js +35 -0
- package/lib/schemes/DataUriPlugin.js +13 -1
- package/lib/schemes/VirtualUrlPlugin.js +1 -1
- package/lib/serialization/SerializerMiddleware.js +2 -2
- package/lib/sharing/ConsumeSharedPlugin.js +2 -2
- package/lib/sharing/ConsumeSharedRuntimeModule.js +8 -4
- package/lib/sharing/ProvideSharedModule.js +1 -1
- package/lib/sharing/ProvideSharedPlugin.js +1 -1
- package/lib/sharing/resolveMatchedConfigs.js +1 -1
- package/lib/stats/DefaultStatsFactoryPlugin.js +2 -2
- package/lib/stats/DefaultStatsPresetPlugin.js +1 -1
- package/lib/stats/DefaultStatsPrinterPlugin.js +1 -1
- package/lib/stats/StatsFactory.js +1 -1
- package/lib/typescript/TypeScriptPlugin.js +210 -0
- package/lib/url/URLParserPlugin.js +2 -2
- package/lib/util/AsyncQueue.js +2 -2
- package/lib/util/Hash.js +2 -2
- package/lib/util/LocConverter.js +53 -0
- package/lib/util/SortableSet.js +1 -1
- package/lib/util/cleverMerge.js +2 -2
- package/lib/util/comparators.js +3 -3
- package/lib/util/concatenate.js +3 -3
- package/lib/util/conventions.js +42 -1
- package/lib/util/createMappings.js +118 -0
- package/lib/{formatLocation.js → util/formatLocation.js} +2 -2
- package/lib/{SizeFormatHelpers.js → util/formatSize.js} +3 -1
- package/lib/util/fs.js +8 -8
- package/lib/util/hash/md4.js +1 -1
- package/lib/util/hash/xxhash64.js +1 -1
- package/lib/util/identifier.js +48 -0
- package/lib/util/internalSerializables.js +35 -19
- package/lib/util/magicComment.js +10 -7
- package/lib/util/parseJson.js +2 -73
- package/lib/util/source.js +21 -0
- package/lib/util/topologicalSort.js +69 -0
- package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +2 -2
- package/lib/wasm-async/AsyncWebAssemblyParser.js +1 -1
- package/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js +5 -3
- package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +1 -1
- package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +5 -3
- package/lib/webpack.js +3 -1
- package/package.json +22 -20
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +118 -3
- package/schemas/plugins/{DllPlugin.check.d.ts → HtmlGeneratorOptions.check.d.ts} +1 -1
- package/schemas/plugins/HtmlGeneratorOptions.check.js +6 -0
- package/schemas/plugins/HtmlGeneratorOptions.json +3 -0
- package/schemas/plugins/ProgressPlugin.check.js +1 -1
- package/schemas/plugins/ProgressPlugin.json +22 -0
- package/schemas/plugins/{DllReferencePlugin.check.d.ts → css/CssAutoOrModuleParserOptions.check.d.ts} +1 -1
- package/schemas/plugins/css/CssAutoOrModuleParserOptions.check.js +6 -0
- package/schemas/plugins/css/CssAutoOrModuleParserOptions.json +3 -0
- package/schemas/plugins/dll/DllPlugin.check.d.ts +7 -0
- package/schemas/plugins/dll/DllReferencePlugin.check.d.ts +7 -0
- package/types.d.ts +810 -101
- package/lib/CaseSensitiveModulesWarning.js +0 -80
- package/lib/GraphHelpers.js +0 -49
- package/lib/NoModeWarning.js +0 -23
- package/lib/css/CssMergeStyleSheetsRuntimeModule.js +0 -57
- /package/lib/{AbstractMethodError.js → errors/AbstractMethodError.js} +0 -0
- /package/schemas/plugins/{DllPlugin.check.js → dll/DllPlugin.check.js} +0 -0
- /package/schemas/plugins/{DllPlugin.json → dll/DllPlugin.json} +0 -0
- /package/schemas/plugins/{DllReferencePlugin.check.js → dll/DllReferencePlugin.check.js} +0 -0
- /package/schemas/plugins/{DllReferencePlugin.json → dll/DllReferencePlugin.json} +0 -0
package/lib/ProgressPlugin.js
CHANGED
|
@@ -9,6 +9,17 @@ const Compiler = require("./Compiler");
|
|
|
9
9
|
const MultiCompiler = require("./MultiCompiler");
|
|
10
10
|
const NormalModule = require("./NormalModule");
|
|
11
11
|
const { contextify } = require("./util/identifier");
|
|
12
|
+
const memoize = require("./util/memoize");
|
|
13
|
+
|
|
14
|
+
const getColors = memoize(() => {
|
|
15
|
+
const cli = require("./cli");
|
|
16
|
+
|
|
17
|
+
return cli.createColors({ useColor: cli.isColorSupported() });
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const BAR_LENGTH = 25;
|
|
21
|
+
const BLOCK_CHAR = "━";
|
|
22
|
+
const BULLET_ICON = "●";
|
|
12
23
|
|
|
13
24
|
/** @typedef {import("tapable").Tap} Tap */
|
|
14
25
|
/**
|
|
@@ -24,6 +35,7 @@ const { contextify } = require("./util/identifier");
|
|
|
24
35
|
/** @typedef {import("./Module")} Module */
|
|
25
36
|
/** @typedef {import("./ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */
|
|
26
37
|
/** @typedef {import("./logging/Logger").Logger} Logger */
|
|
38
|
+
/** @typedef {import("./cli").Colors} Colors */
|
|
27
39
|
|
|
28
40
|
/**
|
|
29
41
|
* Defines the async queue type used by this module.
|
|
@@ -49,74 +61,127 @@ const median3 = (a, b, c) => a + b + c - Math.max(a, b, c) - Math.min(a, b, c);
|
|
|
49
61
|
|
|
50
62
|
/** @typedef {(percentage: number, msg: string, ...args: string[]) => void} HandlerFn */
|
|
51
63
|
|
|
64
|
+
/**
|
|
65
|
+
* @param {Logger} logger logger
|
|
66
|
+
* @param {{ value: string | undefined, time: number }[]} lastStateInfo mutable state
|
|
67
|
+
* @param {number} percentage percentage
|
|
68
|
+
* @param {string} msg msg
|
|
69
|
+
* @param {string[]} args args
|
|
70
|
+
*/
|
|
71
|
+
const reportProfile = (logger, lastStateInfo, percentage, msg, args) => {
|
|
72
|
+
if (percentage === 0) {
|
|
73
|
+
lastStateInfo.length = 0;
|
|
74
|
+
}
|
|
75
|
+
const fullState = [msg, ...args];
|
|
76
|
+
const state = fullState.map((s) => s.replace(/\d+\/\d+ /g, ""));
|
|
77
|
+
const now = Date.now();
|
|
78
|
+
const len = Math.max(state.length, lastStateInfo.length);
|
|
79
|
+
for (let i = len; i >= 0; i--) {
|
|
80
|
+
const stateItem = i < state.length ? state[i] : undefined;
|
|
81
|
+
const lastStateItem =
|
|
82
|
+
i < lastStateInfo.length ? lastStateInfo[i] : undefined;
|
|
83
|
+
if (lastStateItem) {
|
|
84
|
+
if (stateItem !== lastStateItem.value) {
|
|
85
|
+
const diff = now - lastStateItem.time;
|
|
86
|
+
if (lastStateItem.value) {
|
|
87
|
+
let reportState = lastStateItem.value;
|
|
88
|
+
if (i > 0) {
|
|
89
|
+
reportState = `${lastStateInfo[i - 1].value} > ${reportState}`;
|
|
90
|
+
}
|
|
91
|
+
const stateMsg = `${" | ".repeat(i)}${diff} ms ${reportState}`;
|
|
92
|
+
const d = diff;
|
|
93
|
+
// This depends on timing so we ignore it for coverage
|
|
94
|
+
/* eslint-disable no-lone-blocks */
|
|
95
|
+
/* istanbul ignore next */
|
|
96
|
+
{
|
|
97
|
+
if (d > 10000) {
|
|
98
|
+
logger.error(stateMsg);
|
|
99
|
+
} else if (d > 1000) {
|
|
100
|
+
logger.warn(stateMsg);
|
|
101
|
+
} else if (d > 10) {
|
|
102
|
+
logger.info(stateMsg);
|
|
103
|
+
} else if (d > 5) {
|
|
104
|
+
logger.log(stateMsg);
|
|
105
|
+
} else {
|
|
106
|
+
logger.debug(stateMsg);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/* eslint-enable no-lone-blocks */
|
|
110
|
+
}
|
|
111
|
+
if (stateItem === undefined) {
|
|
112
|
+
lastStateInfo.length = i;
|
|
113
|
+
} else {
|
|
114
|
+
lastStateItem.value = stateItem;
|
|
115
|
+
lastStateItem.time = now;
|
|
116
|
+
lastStateInfo.length = i + 1;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
lastStateInfo[i] = {
|
|
121
|
+
value: stateItem,
|
|
122
|
+
time: now
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @param {string} name progress bar name
|
|
130
|
+
* @param {string} color progress bar color
|
|
131
|
+
* @returns {(percentage: number) => string} bar renderer
|
|
132
|
+
*/
|
|
133
|
+
const createReportBar = (name, color) => {
|
|
134
|
+
const c = getColors();
|
|
135
|
+
|
|
136
|
+
return (percentage) => {
|
|
137
|
+
const w = Math.round(percentage * BAR_LENGTH);
|
|
138
|
+
const filled = BLOCK_CHAR.repeat(w);
|
|
139
|
+
const empty = BLOCK_CHAR.repeat(BAR_LENGTH - w);
|
|
140
|
+
const colorFn =
|
|
141
|
+
color in c ? c[/** @type {keyof Colors} */ (color)] : c.green;
|
|
142
|
+
|
|
143
|
+
return `${[BULLET_ICON, name, filled].map(colorFn).join(" ")}${c.white(empty)}`;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/** @typedef {Required<Exclude<NonNullable<ProgressPluginOptions["progressBar"]>, boolean>>} ProgressBarOptions */
|
|
148
|
+
|
|
52
149
|
/**
|
|
53
150
|
* Creates a default handler.
|
|
54
151
|
* @param {boolean | null | undefined} profile need profile
|
|
55
152
|
* @param {Logger} logger logger
|
|
153
|
+
* @param {ProgressBarOptions | false} progressBar render bar
|
|
56
154
|
* @returns {HandlerFn} default handler
|
|
57
155
|
*/
|
|
58
|
-
const createDefaultHandler = (profile, logger) => {
|
|
156
|
+
const createDefaultHandler = (profile, logger, progressBar) => {
|
|
59
157
|
/** @type {{ value: string | undefined, time: number }[]} */
|
|
60
158
|
const lastStateInfo = [];
|
|
61
159
|
|
|
62
160
|
/** @type {HandlerFn} */
|
|
63
161
|
const defaultHandler = (percentage, msg, ...args) => {
|
|
64
162
|
if (profile) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
const stateMsg = `${" | ".repeat(i)}${diff} ms ${reportState}`;
|
|
85
|
-
const d = diff;
|
|
86
|
-
// This depends on timing so we ignore it for coverage
|
|
87
|
-
/* eslint-disable no-lone-blocks */
|
|
88
|
-
/* istanbul ignore next */
|
|
89
|
-
{
|
|
90
|
-
if (d > 10000) {
|
|
91
|
-
logger.error(stateMsg);
|
|
92
|
-
} else if (d > 1000) {
|
|
93
|
-
logger.warn(stateMsg);
|
|
94
|
-
} else if (d > 10) {
|
|
95
|
-
logger.info(stateMsg);
|
|
96
|
-
} else if (d > 5) {
|
|
97
|
-
logger.log(stateMsg);
|
|
98
|
-
} else {
|
|
99
|
-
logger.debug(stateMsg);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
/* eslint-enable no-lone-blocks */
|
|
103
|
-
}
|
|
104
|
-
if (stateItem === undefined) {
|
|
105
|
-
lastStateInfo.length = i;
|
|
106
|
-
} else {
|
|
107
|
-
lastStateItem.value = stateItem;
|
|
108
|
-
lastStateItem.time = now;
|
|
109
|
-
lastStateInfo.length = i + 1;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
} else {
|
|
113
|
-
lastStateInfo[i] = {
|
|
114
|
-
value: stateItem,
|
|
115
|
-
time: now
|
|
116
|
-
};
|
|
117
|
-
}
|
|
163
|
+
reportProfile(logger, lastStateInfo, percentage, msg, args);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (progressBar) {
|
|
167
|
+
const reportBar = createReportBar(progressBar.name, progressBar.color);
|
|
168
|
+
const c = getColors();
|
|
169
|
+
/** @type {string} */
|
|
170
|
+
const currentBar = reportBar(percentage);
|
|
171
|
+
|
|
172
|
+
if (percentage === 1) {
|
|
173
|
+
logger.status();
|
|
174
|
+
} else if (msg) {
|
|
175
|
+
logger.status(
|
|
176
|
+
`${currentBar} (${Math.floor(percentage * 100)}%)`,
|
|
177
|
+
`\n${[msg, ...args].map(c.gray).join(" ")}`
|
|
178
|
+
);
|
|
179
|
+
} else {
|
|
180
|
+
logger.status(`${currentBar} (${Math.floor(percentage * 100)}%)`);
|
|
118
181
|
}
|
|
182
|
+
return;
|
|
119
183
|
}
|
|
184
|
+
|
|
120
185
|
logger.status(`${Math.floor(percentage * 100)}%`, msg, ...args);
|
|
121
186
|
if (percentage === 1 || (!msg && args.length === 0)) logger.status();
|
|
122
187
|
};
|
|
@@ -148,7 +213,8 @@ const DEFAULT_OPTIONS = {
|
|
|
148
213
|
dependencies: true,
|
|
149
214
|
activeModules: false,
|
|
150
215
|
entries: true,
|
|
151
|
-
percentBy: null
|
|
216
|
+
percentBy: null,
|
|
217
|
+
progressBar: false
|
|
152
218
|
};
|
|
153
219
|
|
|
154
220
|
class ProgressPlugin {
|
|
@@ -185,6 +251,12 @@ class ProgressPlugin {
|
|
|
185
251
|
this.showDependencies = merged.dependencies;
|
|
186
252
|
this.showActiveModules = merged.activeModules;
|
|
187
253
|
this.percentBy = merged.percentBy;
|
|
254
|
+
|
|
255
|
+
const progressBar = merged.progressBar === true ? {} : merged.progressBar;
|
|
256
|
+
/** @type {ProgressBarOptions | false} */
|
|
257
|
+
this.progressBar = progressBar
|
|
258
|
+
? { name: "Build", color: "green", ...progressBar }
|
|
259
|
+
: false;
|
|
188
260
|
}
|
|
189
261
|
|
|
190
262
|
/**
|
|
@@ -197,7 +269,8 @@ class ProgressPlugin {
|
|
|
197
269
|
this.handler ||
|
|
198
270
|
createDefaultHandler(
|
|
199
271
|
this.profile,
|
|
200
|
-
compiler.getInfrastructureLogger("webpack.Progress")
|
|
272
|
+
compiler.getInfrastructureLogger("webpack.Progress"),
|
|
273
|
+
this.progressBar
|
|
201
274
|
);
|
|
202
275
|
if (compiler instanceof MultiCompiler) {
|
|
203
276
|
this._applyOnMultiCompiler(compiler, handler);
|
package/lib/RuntimeGlobals.js
CHANGED
|
@@ -83,12 +83,7 @@ module.exports.createScript = "__webpack_require__.ts";
|
|
|
83
83
|
*/
|
|
84
84
|
module.exports.createScriptUrl = "__webpack_require__.tu";
|
|
85
85
|
|
|
86
|
-
/**
|
|
87
|
-
* merge multiple CSS stylesheets (CSSStyleSheet or string) into one CSS text string
|
|
88
|
-
* Arguments: (sheets: Array<CSSStyleSheet | string> | CSSStyleSheet | string) => string
|
|
89
|
-
*/
|
|
90
86
|
module.exports.cssInjectStyle = "__webpack_require__.is";
|
|
91
|
-
module.exports.cssMergeStyleSheets = "__webpack_require__.mcs";
|
|
92
87
|
|
|
93
88
|
/**
|
|
94
89
|
* The current scope when getting a module from a remote
|
|
@@ -391,6 +386,11 @@ module.exports.runtimeId = "__webpack_require__.j";
|
|
|
391
386
|
*/
|
|
392
387
|
module.exports.scriptNonce = "__webpack_require__.nc";
|
|
393
388
|
|
|
389
|
+
/**
|
|
390
|
+
* set .name to "default" for anonymous default exports per ES spec
|
|
391
|
+
*/
|
|
392
|
+
module.exports.setAnonymousDefaultName = "__webpack_require__.dn";
|
|
393
|
+
|
|
394
394
|
/**
|
|
395
395
|
* an object with all share scopes
|
|
396
396
|
*/
|
package/lib/RuntimeModule.js
CHANGED
|
@@ -129,12 +129,14 @@ class RuntimeModule extends Module {
|
|
|
129
129
|
hash.update(this.name);
|
|
130
130
|
hash.update(`${this.stage}`);
|
|
131
131
|
try {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
const code =
|
|
133
|
+
this.fullHash || this.dependentHash
|
|
134
|
+
? // Do not use getGeneratedCode here, because i. e. compilation hash might be not
|
|
135
|
+
// ready at this point. We will cache it later instead.
|
|
136
|
+
this.generate()
|
|
137
|
+
: this.getGeneratedCode();
|
|
138
|
+
if (code !== null && code !== undefined) {
|
|
139
|
+
hash.update(code);
|
|
138
140
|
}
|
|
139
141
|
} catch (err) {
|
|
140
142
|
hash.update(/** @type {Error} */ (err).message);
|
|
@@ -207,7 +209,7 @@ class RuntimeModule extends Module {
|
|
|
207
209
|
* @returns {string | null} runtime code
|
|
208
210
|
*/
|
|
209
211
|
generate() {
|
|
210
|
-
const AbstractMethodError = require("./AbstractMethodError");
|
|
212
|
+
const AbstractMethodError = require("./errors/AbstractMethodError");
|
|
211
213
|
|
|
212
214
|
throw new AbstractMethodError();
|
|
213
215
|
}
|
package/lib/RuntimePlugin.js
CHANGED
|
@@ -34,6 +34,7 @@ const OnChunksLoadedRuntimeModule = require("./runtime/OnChunksLoadedRuntimeModu
|
|
|
34
34
|
const PublicPathRuntimeModule = require("./runtime/PublicPathRuntimeModule");
|
|
35
35
|
const RelativeUrlRuntimeModule = require("./runtime/RelativeUrlRuntimeModule");
|
|
36
36
|
const RuntimeIdRuntimeModule = require("./runtime/RuntimeIdRuntimeModule");
|
|
37
|
+
const SetAnonymousDefaultNameRuntimeModule = require("./runtime/SetAnonymousDefaultNameRuntimeModule");
|
|
37
38
|
const SystemContextRuntimeModule = require("./runtime/SystemContextRuntimeModule");
|
|
38
39
|
const ToBinaryRuntimeModule = require("./runtime/ToBinaryRuntimeModule");
|
|
39
40
|
const ShareRuntimeModule = require("./sharing/ShareRuntimeModule");
|
|
@@ -79,6 +80,7 @@ const GLOBALS_ON_REQUIRE = [
|
|
|
79
80
|
RuntimeGlobals.shareScopeMap,
|
|
80
81
|
RuntimeGlobals.initializeSharing,
|
|
81
82
|
RuntimeGlobals.loadScript,
|
|
83
|
+
RuntimeGlobals.setAnonymousDefaultName,
|
|
82
84
|
RuntimeGlobals.systemContext,
|
|
83
85
|
RuntimeGlobals.onChunksLoaded,
|
|
84
86
|
RuntimeGlobals.makeOptimizedDeferredNamespaceObject,
|
|
@@ -238,6 +240,15 @@ class RuntimePlugin {
|
|
|
238
240
|
);
|
|
239
241
|
return true;
|
|
240
242
|
});
|
|
243
|
+
compilation.hooks.runtimeRequirementInTree
|
|
244
|
+
.for(RuntimeGlobals.setAnonymousDefaultName)
|
|
245
|
+
.tap(PLUGIN_NAME, (chunk) => {
|
|
246
|
+
compilation.addRuntimeModule(
|
|
247
|
+
chunk,
|
|
248
|
+
new SetAnonymousDefaultNameRuntimeModule()
|
|
249
|
+
);
|
|
250
|
+
return true;
|
|
251
|
+
});
|
|
241
252
|
compilation.hooks.runtimeRequirementInTree
|
|
242
253
|
.for(RuntimeGlobals.runtimeId)
|
|
243
254
|
.tap(PLUGIN_NAME, (chunk) => {
|
|
@@ -5,12 +5,80 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
const CaseSensitiveModulesWarning = require("./CaseSensitiveModulesWarning");
|
|
9
|
-
|
|
10
8
|
/** @typedef {import("./Compiler")} Compiler */
|
|
11
9
|
/** @typedef {import("./Module")} Module */
|
|
10
|
+
/** @typedef {import("./ModuleGraph")} ModuleGraph */
|
|
12
11
|
/** @typedef {import("./NormalModule")} NormalModule */
|
|
13
12
|
|
|
13
|
+
const WebpackError = require("./errors/WebpackError");
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Sorts the conflicting modules by identifier to keep warning output stable.
|
|
17
|
+
* @param {Module[]} modules the modules to be sorted
|
|
18
|
+
* @returns {Module[]} sorted version of original modules
|
|
19
|
+
*/
|
|
20
|
+
const sortModules = (modules) =>
|
|
21
|
+
modules.sort((a, b) => {
|
|
22
|
+
const aIdent = a.identifier();
|
|
23
|
+
const bIdent = b.identifier();
|
|
24
|
+
/* istanbul ignore next */
|
|
25
|
+
if (aIdent < bIdent) return -1;
|
|
26
|
+
/* istanbul ignore next */
|
|
27
|
+
if (aIdent > bIdent) return 1;
|
|
28
|
+
/* istanbul ignore next */
|
|
29
|
+
return 0;
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Formats the conflicting modules and one representative incoming reason for
|
|
34
|
+
* each module into the warning body.
|
|
35
|
+
* @param {Module[]} modules each module from throw
|
|
36
|
+
* @param {ModuleGraph} moduleGraph the module graph
|
|
37
|
+
* @returns {string} each message from provided modules
|
|
38
|
+
*/
|
|
39
|
+
const createModulesListMessage = (modules, moduleGraph) =>
|
|
40
|
+
modules
|
|
41
|
+
.map((m) => {
|
|
42
|
+
let message = `* ${m.identifier()}`;
|
|
43
|
+
const validReasons = [
|
|
44
|
+
...moduleGraph.getIncomingConnectionsByOriginModule(m).keys()
|
|
45
|
+
].filter(Boolean);
|
|
46
|
+
|
|
47
|
+
if (validReasons.length > 0) {
|
|
48
|
+
message += `\n Used by ${validReasons.length} module(s), i. e.`;
|
|
49
|
+
message += `\n ${
|
|
50
|
+
/** @type {Module[]} */ (validReasons)[0].identifier()
|
|
51
|
+
}`;
|
|
52
|
+
}
|
|
53
|
+
return message;
|
|
54
|
+
})
|
|
55
|
+
.join("\n");
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Warning emitted when webpack finds modules whose identifiers differ only by
|
|
59
|
+
* letter casing, which can behave inconsistently across filesystems.
|
|
60
|
+
*/
|
|
61
|
+
class CaseSensitiveModulesWarning extends WebpackError {
|
|
62
|
+
/**
|
|
63
|
+
* Builds a warning message that lists the case-conflicting modules and
|
|
64
|
+
* representative importers that caused them to be included.
|
|
65
|
+
* @param {Iterable<Module>} modules modules that were detected
|
|
66
|
+
* @param {ModuleGraph} moduleGraph the module graph
|
|
67
|
+
*/
|
|
68
|
+
constructor(modules, moduleGraph) {
|
|
69
|
+
const sortedModules = sortModules([...modules]);
|
|
70
|
+
const modulesList = createModulesListMessage(sortedModules, moduleGraph);
|
|
71
|
+
super(`There are multiple modules with names that only differ in casing.
|
|
72
|
+
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
|
|
73
|
+
Use equal casing. Compare these module identifiers:
|
|
74
|
+
${modulesList}`);
|
|
75
|
+
|
|
76
|
+
/** @type {string} */
|
|
77
|
+
this.name = "CaseSensitiveModulesWarning";
|
|
78
|
+
this.module = sortedModules[0];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
14
82
|
const PLUGIN_NAME = "WarnCaseSensitiveModulesPlugin";
|
|
15
83
|
|
|
16
84
|
class WarnCaseSensitiveModulesPlugin {
|
|
@@ -5,7 +5,22 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const WebpackError = require("./errors/WebpackError");
|
|
9
|
+
|
|
10
|
+
class NoModeWarning extends WebpackError {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
|
|
14
|
+
/** @type {string} */
|
|
15
|
+
this.name = "NoModeWarning";
|
|
16
|
+
this.message =
|
|
17
|
+
"configuration\n" +
|
|
18
|
+
"The 'mode' option has not been set, webpack will fallback to 'production' for this value.\n" +
|
|
19
|
+
"Set 'mode' option to 'development' or 'production' to enable defaults for each environment.\n" +
|
|
20
|
+
"You can also set it to 'none' to disable any default behavior. " +
|
|
21
|
+
"Learn more: https://webpack.js.org/configuration/mode/";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
9
24
|
|
|
10
25
|
/** @typedef {import("./Compiler")} Compiler */
|
|
11
26
|
|
package/lib/Watching.js
CHANGED
|
@@ -11,7 +11,6 @@ const Stats = require("./Stats");
|
|
|
11
11
|
/** @typedef {import("./Compilation")} Compilation */
|
|
12
12
|
/** @typedef {import("./Compiler")} Compiler */
|
|
13
13
|
/** @typedef {import("./Compiler").ErrorCallback} ErrorCallback */
|
|
14
|
-
/** @typedef {import("./WebpackError")} WebpackError */
|
|
15
14
|
/** @typedef {import("./logging/Logger").Logger} Logger */
|
|
16
15
|
/** @typedef {import("./util/fs").TimeInfoEntries} TimeInfoEntries */
|
|
17
16
|
/** @typedef {import("./util/fs").WatchFileSystem} WatchFileSystem */
|
|
@@ -480,7 +479,7 @@ class Watching {
|
|
|
480
479
|
}
|
|
481
480
|
/**
|
|
482
481
|
* Processes the provided err.
|
|
483
|
-
* @param {
|
|
482
|
+
* @param {Error | null} err error if any
|
|
484
483
|
* @param {Compilation=} compilation compilation if any
|
|
485
484
|
*/
|
|
486
485
|
const finalCallback = (err, compilation) => {
|
|
@@ -495,7 +494,7 @@ class Watching {
|
|
|
495
494
|
this.compiler.fsStartTime = undefined;
|
|
496
495
|
/**
|
|
497
496
|
* Processes the provided err.
|
|
498
|
-
* @param {
|
|
497
|
+
* @param {Error | null} err error if any
|
|
499
498
|
*/
|
|
500
499
|
const shutdown = (err) => {
|
|
501
500
|
this.compiler.hooks.watchClose.call();
|
package/lib/WebpackError.js
CHANGED
|
@@ -5,80 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/** @typedef {import("./Chunk")} Chunk */
|
|
12
|
-
/** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */
|
|
13
|
-
/** @typedef {import("./Module")} Module */
|
|
14
|
-
/** @typedef {import("./serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
|
15
|
-
/** @typedef {import("./serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
|
|
16
|
-
|
|
17
|
-
class WebpackError extends Error {
|
|
18
|
-
/**
|
|
19
|
-
* Creates an instance of WebpackError.
|
|
20
|
-
* @param {string=} message error message
|
|
21
|
-
* @param {{ cause?: unknown }} options error options
|
|
22
|
-
*/
|
|
23
|
-
constructor(message, options = {}) {
|
|
24
|
-
super(message, options);
|
|
25
|
-
|
|
26
|
-
/** @type {string=} */
|
|
27
|
-
this.details = undefined;
|
|
28
|
-
/** @type {(Module | null)=} */
|
|
29
|
-
this.module = undefined;
|
|
30
|
-
/** @type {DependencyLocation=} */
|
|
31
|
-
this.loc = undefined;
|
|
32
|
-
/** @type {boolean=} */
|
|
33
|
-
this.hideStack = undefined;
|
|
34
|
-
/** @type {Chunk=} */
|
|
35
|
-
this.chunk = undefined;
|
|
36
|
-
/** @type {string=} */
|
|
37
|
-
this.file = undefined;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Returns inspect message.
|
|
42
|
-
* @returns {string} inspect message
|
|
43
|
-
*/
|
|
44
|
-
[inspect]() {
|
|
45
|
-
return (
|
|
46
|
-
this.stack +
|
|
47
|
-
(this.details ? `\n${this.details}` : "") +
|
|
48
|
-
(this.cause ? `\n${this.cause}` : "")
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Serializes this instance into the provided serializer context.
|
|
54
|
-
* @param {ObjectSerializerContext} context context
|
|
55
|
-
*/
|
|
56
|
-
serialize({ write }) {
|
|
57
|
-
write(this.name);
|
|
58
|
-
write(this.message);
|
|
59
|
-
write(this.stack);
|
|
60
|
-
write(this.cause);
|
|
61
|
-
write(this.details);
|
|
62
|
-
write(this.loc);
|
|
63
|
-
write(this.hideStack);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Restores this instance from the provided deserializer context.
|
|
68
|
-
* @param {ObjectDeserializerContext} context context
|
|
69
|
-
*/
|
|
70
|
-
deserialize({ read }) {
|
|
71
|
-
this.name = read();
|
|
72
|
-
this.message = read();
|
|
73
|
-
this.stack = read();
|
|
74
|
-
this.cause = read();
|
|
75
|
-
this.details = read();
|
|
76
|
-
this.loc = read();
|
|
77
|
-
this.hideStack = read();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
makeSerializable(WebpackError, "webpack/lib/WebpackError");
|
|
82
|
-
|
|
83
|
-
/** @type {typeof WebpackError} */
|
|
84
|
-
module.exports = WebpackError;
|
|
8
|
+
// TODO remove in webpack 6
|
|
9
|
+
// Some old plugins use `require("webpack/lib/WebpackError")`, in webpack@6 developer should migrate to `compiler.webpack.WebpackError`
|
|
10
|
+
module.exports = require("./errors/WebpackError");
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
const IgnoreErrorModuleFactory = require("./IgnoreErrorModuleFactory");
|
|
9
8
|
const {
|
|
10
9
|
JAVASCRIPT_MODULE_TYPE_AUTO,
|
|
11
10
|
JAVASCRIPT_MODULE_TYPE_DYNAMIC,
|
|
12
11
|
JAVASCRIPT_MODULE_TYPE_ESM
|
|
13
12
|
} = require("./ModuleTypeConstants");
|
|
14
13
|
const WebpackIsIncludedDependency = require("./dependencies/WebpackIsIncludedDependency");
|
|
14
|
+
const IgnoreErrorModuleFactory = require("./errors/IgnoreErrorModuleFactory");
|
|
15
15
|
const {
|
|
16
16
|
toConstantDependency
|
|
17
17
|
} = require("./javascript/JavascriptParserHelpers");
|
|
@@ -425,6 +425,18 @@ class WebpackOptionsApply extends OptionsApply {
|
|
|
425
425
|
new CssModulesPlugin().apply(compiler);
|
|
426
426
|
}
|
|
427
427
|
|
|
428
|
+
if (options.experiments.html) {
|
|
429
|
+
const HtmlModulesPlugin = require("./html/HtmlModulesPlugin");
|
|
430
|
+
|
|
431
|
+
new HtmlModulesPlugin().apply(compiler);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
if (options.experiments.typescript) {
|
|
435
|
+
const TypeScriptPlugin = require("./typescript/TypeScriptPlugin");
|
|
436
|
+
|
|
437
|
+
new TypeScriptPlugin().apply(compiler);
|
|
438
|
+
}
|
|
439
|
+
|
|
428
440
|
if (options.experiments.lazyCompilation) {
|
|
429
441
|
const LazyCompilationPlugin = require("./hmr/LazyCompilationPlugin");
|
|
430
442
|
|
|
@@ -517,7 +529,7 @@ class WebpackOptionsApply extends OptionsApply {
|
|
|
517
529
|
}).apply(compiler);
|
|
518
530
|
if (options.amd !== false) {
|
|
519
531
|
const AMDPlugin = require("./dependencies/AMDPlugin");
|
|
520
|
-
const RequireJsStuffPlugin = require("./RequireJsStuffPlugin");
|
|
532
|
+
const RequireJsStuffPlugin = require("./dependencies/RequireJsStuffPlugin");
|
|
521
533
|
|
|
522
534
|
new AMDPlugin(options.amd || {}).apply(compiler);
|
|
523
535
|
new RequireJsStuffPlugin().apply(compiler);
|
|
@@ -12,6 +12,7 @@ const {
|
|
|
12
12
|
CSS_TYPE,
|
|
13
13
|
CSS_URL_TYPE,
|
|
14
14
|
CSS_URL_TYPES,
|
|
15
|
+
HTML_TYPE,
|
|
15
16
|
JAVASCRIPT_AND_CSS_URL_TYPES,
|
|
16
17
|
JAVASCRIPT_TYPE,
|
|
17
18
|
JAVASCRIPT_TYPES,
|
|
@@ -146,9 +147,12 @@ class AssetSourceGenerator extends Generator {
|
|
|
146
147
|
}
|
|
147
148
|
|
|
148
149
|
if (sourceTypes.size > 0) {
|
|
149
|
-
if (
|
|
150
|
+
if (
|
|
151
|
+
sourceTypes.has(JAVASCRIPT_TYPE) &&
|
|
152
|
+
(sourceTypes.has(CSS_TYPE) || sourceTypes.has(HTML_TYPE))
|
|
153
|
+
) {
|
|
150
154
|
return JAVASCRIPT_AND_CSS_URL_TYPES;
|
|
151
|
-
} else if (sourceTypes.has(CSS_TYPE)) {
|
|
155
|
+
} else if (sourceTypes.has(CSS_TYPE) || sourceTypes.has(HTML_TYPE)) {
|
|
152
156
|
return CSS_URL_TYPES;
|
|
153
157
|
}
|
|
154
158
|
return JAVASCRIPT_TYPES;
|