Update npm packages (73 packages including @jqhtml 2.3.36)
Update npm registry domain from privatenpm.hanson.xyz to npm.internal.hanson.xyz 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
96
node_modules/webpack/lib/config/normalization.js
generated
vendored
96
node_modules/webpack/lib/config/normalization.js
generated
vendored
@@ -24,6 +24,11 @@ const util = require("util");
|
||||
/** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptionsNormalized */
|
||||
/** @typedef {import("../WebpackError")} WebpackError */
|
||||
|
||||
/**
|
||||
* @typedef {object} WebpackOptionsInterception
|
||||
* @property {WebpackOptionsNormalized["devtool"]=} devtool
|
||||
*/
|
||||
|
||||
const handledDeprecatedNoEmitOnErrors = util.deprecate(
|
||||
/**
|
||||
* @param {boolean} noEmitOnErrors no emit on errors
|
||||
@@ -582,4 +587,95 @@ const getNormalizedOptimizationRuntimeChunk = (runtimeChunk) => {
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {WebpackOptionsNormalized} options options to be intercepted
|
||||
* @returns {{ options: WebpackOptionsNormalized, interception?: WebpackOptionsInterception }} options and interception
|
||||
*/
|
||||
const applyWebpackOptionsInterception = (options) => {
|
||||
// Return origin options when backCompat is disabled
|
||||
if (options.experiments.futureDefaults) {
|
||||
return {
|
||||
options
|
||||
};
|
||||
}
|
||||
|
||||
// TODO webpack6 - remove compatibility logic and move `devtools` fully into `devtool` with multi-type support
|
||||
let _devtool = options.devtool;
|
||||
/** @type {WebpackOptionsNormalized["devtool"]} */
|
||||
let cached;
|
||||
|
||||
const devtoolBackCompat = () => {
|
||||
if (Array.isArray(_devtool)) {
|
||||
if (cached) return cached;
|
||||
// Prefer `all`, then `javascript`, then `css`
|
||||
const match = ["all", "javascript", "css"]
|
||||
.map((type) =>
|
||||
/** @type {Extract<WebpackOptionsNormalized["devtool"], EXPECTED_ANY[]>} */ (
|
||||
_devtool
|
||||
).find((item) => item.type === type)
|
||||
)
|
||||
.find(Boolean);
|
||||
|
||||
// If `devtool: []` is specified, return `false` here
|
||||
return (cached = match ? match.use : false);
|
||||
}
|
||||
return _devtool;
|
||||
};
|
||||
|
||||
/** @type {ProxyHandler<WebpackOptionsNormalized>} */
|
||||
const handler = Object.create(null);
|
||||
handler.get = (target, prop, receiver) => {
|
||||
if (prop === "devtool") {
|
||||
return devtoolBackCompat();
|
||||
}
|
||||
return Reflect.get(target, prop, receiver);
|
||||
};
|
||||
handler.set = (target, prop, value, receiver) => {
|
||||
if (prop === "devtool") {
|
||||
_devtool = value;
|
||||
cached = undefined;
|
||||
return true;
|
||||
}
|
||||
return Reflect.set(target, prop, value, receiver);
|
||||
};
|
||||
handler.deleteProperty = (target, prop) => {
|
||||
if (prop === "devtool") {
|
||||
_devtool = undefined;
|
||||
cached = undefined;
|
||||
return true;
|
||||
}
|
||||
return Reflect.deleteProperty(target, prop);
|
||||
};
|
||||
handler.defineProperty = (target, prop, descriptor) => {
|
||||
if (prop === "devtool") {
|
||||
_devtool = descriptor.value;
|
||||
cached = undefined;
|
||||
return true;
|
||||
}
|
||||
return Reflect.defineProperty(target, prop, descriptor);
|
||||
};
|
||||
handler.getOwnPropertyDescriptor = (target, prop) => {
|
||||
if (prop === "devtool") {
|
||||
return {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value: devtoolBackCompat(),
|
||||
writable: true
|
||||
};
|
||||
}
|
||||
return Reflect.getOwnPropertyDescriptor(target, prop);
|
||||
};
|
||||
|
||||
return {
|
||||
options: new Proxy(options, handler),
|
||||
interception: {
|
||||
get devtool() {
|
||||
return _devtool;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
module.exports.applyWebpackOptionsInterception =
|
||||
applyWebpackOptionsInterception;
|
||||
module.exports.getNormalizedWebpackOptions = getNormalizedWebpackOptions;
|
||||
|
||||
Reference in New Issue
Block a user