修改bug

This commit is contained in:
2025-09-19 14:53:16 +08:00
parent 61764be51e
commit 3cf3c9268c
25 changed files with 2221 additions and 20 deletions

4
node_modules/style-loader/dist/cjs.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
"use strict";
const loader = require("./index");
module.exports = loader.default;

151
node_modules/style-loader/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,151 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _path = _interopRequireDefault(require("path"));
var _utils = require("./utils");
var _options = _interopRequireDefault(require("./options.json"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// eslint-disable-next-line consistent-return
const loader = function loader(content) {
if (this._compiler && this._compiler.options && this._compiler.options.experiments && this._compiler.options.experiments.css && this._module && (this._module.type === "css" || this._module.type === "css/global" || this._module.type === "css/module" || this._module.type === "css/auto")) {
return content;
}
};
loader.pitch = function pitch(request) {
if (this._compiler && this._compiler.options && this._compiler.options.experiments && this._compiler.options.experiments.css && this._module && (this._module.type === "css" || this._module.type === "css/global" || this._module.type === "css/module" || this._module.type === "css/auto")) {
this.emitWarning(new Error('You can\'t use `experiments.css` (`experiments.futureDefaults` enable built-in CSS support by default) and `style-loader` together, please set `experiments.css` to `false` or set `{ type: "javascript/auto" }` for rules with `style-loader` in your webpack config (now `style-loader` does nothing).'));
return;
}
const options = this.getOptions(_options.default);
const injectType = options.injectType || "styleTag";
const esModule = typeof options.esModule !== "undefined" ? options.esModule : true;
const runtimeOptions = {};
if (options.attributes) {
runtimeOptions.attributes = options.attributes;
}
if (options.base) {
runtimeOptions.base = options.base;
}
const insertType = options.insert && _path.default.isAbsolute(options.insert) ? "module-path" : "selector";
switch (injectType) {
case "linkTag":
{
const hmrCode = this.hot ? (0, _utils.getLinkHmrCode)(esModule, this, request) : "";
// eslint-disable-next-line consistent-return
return `
${(0, _utils.getImportLinkAPICode)(esModule, this)}
${(0, _utils.getImportInsertBySelectorCode)(esModule, this, insertType, options)}
${(0, _utils.getImportLinkContentCode)(esModule, this, request)}
${esModule ? "" : `content = content.__esModule ? content.default : content;`}
var options = ${JSON.stringify(runtimeOptions)};
${(0, _utils.getInsertOptionCode)(insertType, options)}
var update = API(content, options);
${hmrCode}
${esModule ? "export default {}" : ""}`;
}
case "lazyStyleTag":
case "lazyAutoStyleTag":
case "lazySingletonStyleTag":
{
const isSingleton = injectType === "lazySingletonStyleTag";
const isAuto = injectType === "lazyAutoStyleTag";
const hmrCode = this.hot ? (0, _utils.getStyleHmrCode)(esModule, this, request, true) : "";
// eslint-disable-next-line consistent-return
return `
var exported = {};
${(0, _utils.getImportStyleAPICode)(esModule, this)}
${(0, _utils.getImportStyleDomAPICode)(esModule, this, isSingleton, isAuto)}
${(0, _utils.getImportInsertBySelectorCode)(esModule, this, insertType, options)}
${(0, _utils.getSetAttributesCode)(esModule, this, options)}
${(0, _utils.getImportInsertStyleElementCode)(esModule, this)}
${(0, _utils.getStyleTagTransformFnCode)(esModule, this, options, isSingleton)}
${(0, _utils.getImportStyleContentCode)(esModule, this, request)}
${isAuto ? (0, _utils.getImportIsOldIECode)(esModule, this) : ""}
${esModule ? `if (content && content.locals) {
exported.locals = content.locals;
}
` : `content = content.__esModule ? content.default : content;
exported.locals = content.locals || {};`}
var refs = 0;
var update;
var options = ${JSON.stringify(runtimeOptions)};
${(0, _utils.getStyleTagTransformFn)(options, isSingleton)};
options.setAttributes = setAttributes;
${(0, _utils.getInsertOptionCode)(insertType, options)}
options.domAPI = ${(0, _utils.getdomAPI)(isAuto)};
options.insertStyleElement = insertStyleElement;
exported.use = function(insertOptions) {
options.options = insertOptions || {};
if (!(refs++)) {
update = API(content, options);
}
return exported;
};
exported.unuse = function() {
if (refs > 0 && !--refs) {
update();
update = null;
}
};
${hmrCode}
${(0, _utils.getExportLazyStyleCode)(esModule, this, request)}
`;
}
case "styleTag":
case "autoStyleTag":
case "singletonStyleTag":
default:
{
const isSingleton = injectType === "singletonStyleTag";
const isAuto = injectType === "autoStyleTag";
const hmrCode = this.hot ? (0, _utils.getStyleHmrCode)(esModule, this, request, false) : "";
// eslint-disable-next-line consistent-return
return `
${(0, _utils.getImportStyleAPICode)(esModule, this)}
${(0, _utils.getImportStyleDomAPICode)(esModule, this, isSingleton, isAuto)}
${(0, _utils.getImportInsertBySelectorCode)(esModule, this, insertType, options)}
${(0, _utils.getSetAttributesCode)(esModule, this, options)}
${(0, _utils.getImportInsertStyleElementCode)(esModule, this)}
${(0, _utils.getStyleTagTransformFnCode)(esModule, this, options, isSingleton)}
${(0, _utils.getImportStyleContentCode)(esModule, this, request)}
${isAuto ? (0, _utils.getImportIsOldIECode)(esModule, this) : ""}
${esModule ? "" : `content = content.__esModule ? content.default : content;`}
var options = ${JSON.stringify(runtimeOptions)};
${(0, _utils.getStyleTagTransformFn)(options, isSingleton)};
options.setAttributes = setAttributes;
${(0, _utils.getInsertOptionCode)(insertType, options)}
options.domAPI = ${(0, _utils.getdomAPI)(isAuto)};
options.insertStyleElement = insertStyleElement;
var update = API(content, options);
${hmrCode}
${(0, _utils.getExportStyleCode)(esModule, this, request)}
`;
}
}
};
var _default = exports.default = loader;

45
node_modules/style-loader/dist/options.json generated vendored Normal file
View File

@@ -0,0 +1,45 @@
{
"title": "Style Loader options",
"type": "object",
"properties": {
"injectType": {
"description": "Allows to setup how styles will be injected into DOM.",
"link": "https://github.com/webpack-contrib/style-loader#injecttype",
"enum": [
"styleTag",
"singletonStyleTag",
"autoStyleTag",
"lazyStyleTag",
"lazySingletonStyleTag",
"lazyAutoStyleTag",
"linkTag"
]
},
"attributes": {
"description": "Adds custom attributes to tag.",
"link": "https://github.com/webpack-contrib/style-loader#attributes",
"type": "object"
},
"insert": {
"description": "Inserts `<style>`/`<link>` at the given position.",
"link": "https://github.com/webpack-contrib/style-loader#insert",
"type": "string"
},
"base": {
"description": "Sets module ID base for DLLPlugin.",
"link": "https://github.com/webpack-contrib/style-loader#base",
"type": "number"
},
"esModule": {
"description": "Use the ES modules syntax.",
"link": "https://github.com/webpack-contrib/css-loader#esmodule",
"type": "boolean"
},
"styleTagTransform": {
"description": "Transform tag and css when insert 'style' tag into the DOM",
"link": "https://github.com/webpack-contrib/style-loader#styleTagTransform",
"type": "string"
}
},
"additionalProperties": false
}

View File

@@ -0,0 +1,29 @@
"use strict";
module.exports = function (url, options) {
if (typeof document === "undefined") {
return function () {};
}
options = options || {};
options.attributes = typeof options.attributes === "object" ? options.attributes : {};
if (typeof options.attributes.nonce === "undefined") {
var nonce = typeof __webpack_nonce__ !== "undefined" ? __webpack_nonce__ : null;
if (nonce) {
options.attributes.nonce = nonce;
}
}
var linkElement = document.createElement("link");
linkElement.rel = "stylesheet";
linkElement.href = url;
Object.keys(options.attributes).forEach(function (key) {
linkElement.setAttribute(key, options.attributes[key]);
});
options.insert(linkElement);
return function (newUrl) {
if (typeof newUrl === "string") {
linkElement.href = newUrl;
} else {
linkElement.parentNode.removeChild(linkElement);
}
};
};

View File

@@ -0,0 +1,84 @@
"use strict";
var stylesInDOM = [];
function getIndexByIdentifier(identifier) {
var result = -1;
for (var i = 0; i < stylesInDOM.length; i++) {
if (stylesInDOM[i].identifier === identifier) {
result = i;
break;
}
}
return result;
}
function modulesToDom(list, options) {
var idCountMap = {};
var identifiers = [];
for (var i = 0; i < list.length; i++) {
var item = list[i];
var id = options.base ? item[0] + options.base : item[0];
var count = idCountMap[id] || 0;
var identifier = "".concat(id, " ").concat(count);
idCountMap[id] = count + 1;
var indexByIdentifier = getIndexByIdentifier(identifier);
var obj = {
css: item[1],
media: item[2],
sourceMap: item[3],
supports: item[4],
layer: item[5]
};
if (indexByIdentifier !== -1) {
stylesInDOM[indexByIdentifier].references++;
stylesInDOM[indexByIdentifier].updater(obj);
} else {
var updater = addElementStyle(obj, options);
options.byIndex = i;
stylesInDOM.splice(i, 0, {
identifier: identifier,
updater: updater,
references: 1
});
}
identifiers.push(identifier);
}
return identifiers;
}
function addElementStyle(obj, options) {
var api = options.domAPI(options);
api.update(obj);
var updater = function updater(newObj) {
if (newObj) {
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
return;
}
api.update(obj = newObj);
} else {
api.remove();
}
};
return updater;
}
module.exports = function (list, options) {
options = options || {};
list = list || [];
var lastIdentifiers = modulesToDom(list, options);
return function update(newList) {
newList = newList || [];
for (var i = 0; i < lastIdentifiers.length; i++) {
var identifier = lastIdentifiers[i];
var index = getIndexByIdentifier(identifier);
stylesInDOM[index].references--;
}
var newLastIdentifiers = modulesToDom(newList, options);
for (var _i = 0; _i < lastIdentifiers.length; _i++) {
var _identifier = lastIdentifiers[_i];
var _index = getIndexByIdentifier(_identifier);
if (stylesInDOM[_index].references === 0) {
stylesInDOM[_index].updater();
stylesInDOM.splice(_index, 1);
}
}
lastIdentifiers = newLastIdentifiers;
};
};

View File

@@ -0,0 +1,34 @@
"use strict";
var memo = {};
/* istanbul ignore next */
function getTarget(target) {
if (typeof memo[target] === "undefined") {
var styleTarget = document.querySelector(target);
// Special case to return head of iframe instead of iframe itself
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
try {
// This will throw an exception if access to iframe is blocked
// due to cross-origin restrictions
styleTarget = styleTarget.contentDocument.head;
} catch (e) {
// istanbul ignore next
styleTarget = null;
}
}
memo[target] = styleTarget;
}
return memo[target];
}
/* istanbul ignore next */
function insertBySelector(insert, style) {
var target = getTarget(insert);
if (!target) {
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
}
target.appendChild(style);
}
module.exports = insertBySelector;

View File

@@ -0,0 +1,10 @@
"use strict";
/* istanbul ignore next */
function insertStyleElement(options) {
var element = document.createElement("style");
options.setAttributes(element, options.attributes);
options.insert(element, options.options);
return element;
}
module.exports = insertStyleElement;

View File

@@ -0,0 +1,28 @@
"use strict";
function isEqualLocals(a, b, isNamedExport) {
if (!a && b || a && !b) {
return false;
}
var p;
for (p in a) {
if (isNamedExport && p === "default") {
// eslint-disable-next-line no-continue
continue;
}
if (a[p] !== b[p]) {
return false;
}
}
for (p in b) {
if (isNamedExport && p === "default") {
// eslint-disable-next-line no-continue
continue;
}
if (!a[p]) {
return false;
}
}
return true;
}
module.exports = isEqualLocals;

17
node_modules/style-loader/dist/runtime/isOldIE.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
"use strict";
var memo;
/* istanbul ignore next */
function isOldIE() {
if (typeof memo === "undefined") {
// Test for IE <= 9 as proposed by Browserhacks
// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
// Tests for existence of standard globals is to allow style-loader
// to operate correctly into non-standard environments
// @see https://github.com/webpack-contrib/style-loader/issues/177
memo = Boolean(typeof window !== "undefined" && typeof document !== "undefined" && document.all && !window.atob);
}
return memo;
}
module.exports = isOldIE;

View File

@@ -0,0 +1,13 @@
"use strict";
/* istanbul ignore next */
function setAttributesWithoutAttributes(styleElement, attributes) {
var nonce = typeof __webpack_nonce__ !== "undefined" ? __webpack_nonce__ : null;
if (nonce) {
attributes.nonce = nonce;
}
Object.keys(attributes).forEach(function (key) {
styleElement.setAttribute(key, attributes[key]);
});
}
module.exports = setAttributesWithoutAttributes;

View File

@@ -0,0 +1,9 @@
"use strict";
/* istanbul ignore next */
function setAttributesWithoutAttributes(styleElement, attributes) {
Object.keys(attributes).forEach(function (key) {
styleElement.setAttribute(key, attributes[key]);
});
}
module.exports = setAttributesWithoutAttributes;

View File

@@ -0,0 +1,10 @@
"use strict";
/* istanbul ignore next */
function setAttributesWithoutAttributes(styleElement) {
var nonce = typeof __webpack_nonce__ !== "undefined" ? __webpack_nonce__ : null;
if (nonce) {
styleElement.setAttribute("nonce", nonce);
}
}
module.exports = setAttributesWithoutAttributes;

View File

@@ -0,0 +1,86 @@
"use strict";
/* istanbul ignore next */
var replaceText = function replaceText() {
var textStore = [];
return function replace(index, replacement) {
textStore[index] = replacement;
return textStore.filter(Boolean).join("\n");
};
}();
/* istanbul ignore next */
function apply(styleElement, index, remove, obj) {
var css;
if (remove) {
css = "";
} else {
css = "";
if (obj.supports) {
css += "@supports (".concat(obj.supports, ") {");
}
if (obj.media) {
css += "@media ".concat(obj.media, " {");
}
var needLayer = typeof obj.layer !== "undefined";
if (needLayer) {
css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
}
css += obj.css;
if (needLayer) {
css += "}";
}
if (obj.media) {
css += "}";
}
if (obj.supports) {
css += "}";
}
}
// For old IE
/* istanbul ignore if */
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = replaceText(index, css);
} else {
var cssNode = document.createTextNode(css);
var childNodes = styleElement.childNodes;
if (childNodes[index]) {
styleElement.removeChild(childNodes[index]);
}
if (childNodes.length) {
styleElement.insertBefore(cssNode, childNodes[index]);
} else {
styleElement.appendChild(cssNode);
}
}
}
var singletonData = {
singleton: null,
singletonCounter: 0
};
/* istanbul ignore next */
function domAPI(options) {
if (typeof document === "undefined") return {
update: function update() {},
remove: function remove() {}
};
// eslint-disable-next-line no-undef,no-use-before-define
var styleIndex = singletonData.singletonCounter++;
var styleElement =
// eslint-disable-next-line no-undef,no-use-before-define
singletonData.singleton || (
// eslint-disable-next-line no-undef,no-use-before-define
singletonData.singleton = options.insertStyleElement(options));
return {
update: function update(obj) {
apply(styleElement, styleIndex, false, obj);
},
remove: function remove(obj) {
apply(styleElement, styleIndex, true, obj);
}
};
}
module.exports = domAPI;

61
node_modules/style-loader/dist/runtime/styleDomAPI.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
"use strict";
/* istanbul ignore next */
function apply(styleElement, options, obj) {
var css = "";
if (obj.supports) {
css += "@supports (".concat(obj.supports, ") {");
}
if (obj.media) {
css += "@media ".concat(obj.media, " {");
}
var needLayer = typeof obj.layer !== "undefined";
if (needLayer) {
css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
}
css += obj.css;
if (needLayer) {
css += "}";
}
if (obj.media) {
css += "}";
}
if (obj.supports) {
css += "}";
}
var sourceMap = obj.sourceMap;
if (sourceMap && typeof btoa !== "undefined") {
css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
}
// For old IE
/* istanbul ignore if */
options.styleTagTransform(css, styleElement, options.options);
}
function removeStyleElement(styleElement) {
// istanbul ignore if
if (styleElement.parentNode === null) {
return false;
}
styleElement.parentNode.removeChild(styleElement);
}
/* istanbul ignore next */
function domAPI(options) {
if (typeof document === "undefined") {
return {
update: function update() {},
remove: function remove() {}
};
}
var styleElement = options.insertStyleElement(options);
return {
update: function update(obj) {
apply(styleElement, options, obj);
},
remove: function remove() {
removeStyleElement(styleElement);
}
};
}
module.exports = domAPI;

View File

@@ -0,0 +1,14 @@
"use strict";
/* istanbul ignore next */
function styleTagTransform(css, styleElement) {
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = css;
} else {
while (styleElement.firstChild) {
styleElement.removeChild(styleElement.firstChild);
}
styleElement.appendChild(document.createTextNode(css));
}
}
module.exports = styleTagTransform;

191
node_modules/style-loader/dist/utils.js generated vendored Normal file
View File

@@ -0,0 +1,191 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getExportLazyStyleCode = getExportLazyStyleCode;
exports.getExportStyleCode = getExportStyleCode;
exports.getImportInsertBySelectorCode = getImportInsertBySelectorCode;
exports.getImportInsertStyleElementCode = getImportInsertStyleElementCode;
exports.getImportIsOldIECode = getImportIsOldIECode;
exports.getImportLinkAPICode = getImportLinkAPICode;
exports.getImportLinkContentCode = getImportLinkContentCode;
exports.getImportStyleAPICode = getImportStyleAPICode;
exports.getImportStyleContentCode = getImportStyleContentCode;
exports.getImportStyleDomAPICode = getImportStyleDomAPICode;
exports.getInsertOptionCode = getInsertOptionCode;
exports.getLinkHmrCode = getLinkHmrCode;
exports.getSetAttributesCode = getSetAttributesCode;
exports.getStyleHmrCode = getStyleHmrCode;
exports.getStyleTagTransformFn = getStyleTagTransformFn;
exports.getStyleTagTransformFnCode = getStyleTagTransformFnCode;
exports.getdomAPI = getdomAPI;
exports.stringifyRequest = stringifyRequest;
var _path = _interopRequireDefault(require("path"));
var _isEqualLocals = _interopRequireDefault(require("./runtime/isEqualLocals"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function stringifyRequest(loaderContext, request) {
return JSON.stringify(loaderContext.utils.contextify(loaderContext.context, request));
}
function getImportLinkAPICode(esModule, loaderContext) {
const modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/injectStylesIntoLinkTag.js")}`);
return esModule ? `import API from ${modulePath};` : `var API = require(${modulePath});`;
}
function getImportLinkContentCode(esModule, loaderContext, request) {
const modulePath = stringifyRequest(loaderContext, `!!${request}`);
return esModule ? `import content from ${modulePath};` : `var content = require(${modulePath});`;
}
function getImportStyleAPICode(esModule, loaderContext) {
const modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/injectStylesIntoStyleTag.js")}`);
return esModule ? `import API from ${modulePath};` : `var API = require(${modulePath});`;
}
function getImportStyleDomAPICode(esModule, loaderContext, isSingleton, isAuto) {
const styleAPI = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/styleDomAPI.js")}`);
const singletonAPI = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/singletonStyleDomAPI.js")}`);
if (isAuto) {
return esModule ? `import domAPI from ${styleAPI};
import domAPISingleton from ${singletonAPI};` : `var domAPI = require(${styleAPI});
var domAPISingleton = require(${singletonAPI});`;
}
return esModule ? `import domAPI from ${isSingleton ? singletonAPI : styleAPI};` : `var domAPI = require(${isSingleton ? singletonAPI : styleAPI});`;
}
function getImportStyleContentCode(esModule, loaderContext, request) {
const modulePath = stringifyRequest(loaderContext, `!!${request}`);
return esModule ? `import content, * as namedExport from ${modulePath};` : `var content = require(${modulePath});`;
}
function getImportInsertBySelectorCode(esModule, loaderContext, insertType, options) {
if (insertType === "module-path") {
const modulePath = stringifyRequest(loaderContext, `${options.insert}`);
loaderContext.addBuildDependency(options.insert);
return esModule ? `import insertFn from ${modulePath};` : `var insertFn = require(${modulePath});`;
}
const modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/insertBySelector.js")}`);
return esModule ? `import insertFn from ${modulePath};` : `var insertFn = require(${modulePath});`;
}
function getInsertOptionCode(insertType, options) {
if (insertType === "module-path") {
return `options.insert = insertFn;`;
}
const insert = options.insert ? JSON.stringify(options.insert) : '"head"';
return `options.insert = insertFn.bind(null, ${insert});`;
}
function getImportInsertStyleElementCode(esModule, loaderContext) {
const modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/insertStyleElement.js")}`);
return esModule ? `import insertStyleElement from ${modulePath};` : `var insertStyleElement = require(${modulePath});`;
}
function getStyleHmrCode(esModule, loaderContext, request, lazy) {
const modulePath = stringifyRequest(loaderContext, `!!${request}`);
return `
if (module.hot) {
if (!content.locals || module.hot.invalidate) {
var isEqualLocals = ${_isEqualLocals.default.toString()};
var isNamedExport = ${esModule ? "!content.locals" : false};
var oldLocals = isNamedExport ? namedExport : content.locals;
module.hot.accept(
${modulePath},
function () {
${esModule ? `if (!isEqualLocals(oldLocals, isNamedExport ? namedExport : content.locals, isNamedExport)) {
module.hot.invalidate();
return;
}
oldLocals = isNamedExport ? namedExport : content.locals;
${lazy ? `if (update && refs > 0) {
update(content);
}` : `update(content);`}` : `content = require(${modulePath});
content = content.__esModule ? content.default : content;
${lazy ? "" : `if (typeof content === 'string') {
content = [[module.id, content, '']];
}`}
if (!isEqualLocals(oldLocals, content.locals)) {
module.hot.invalidate();
return;
}
oldLocals = content.locals;
${lazy ? `if (update && refs > 0) {
update(content);
}` : `update(content);`}`}
}
)
}
module.hot.dispose(function() {
${lazy ? `if (update) {
update();
}` : `update();`}
});
}
`;
}
function getLinkHmrCode(esModule, loaderContext, request) {
const modulePath = stringifyRequest(loaderContext, `!!${request}`);
return `
if (module.hot) {
module.hot.accept(
${modulePath},
function() {
${esModule ? "update(content);" : `content = require(${modulePath});
content = content.__esModule ? content.default : content;
update(content);`}
}
);
module.hot.dispose(function() {
update();
});
}`;
}
function getdomAPI(isAuto) {
return isAuto ? "isOldIE() ? domAPISingleton : domAPI" : "domAPI";
}
function getImportIsOldIECode(esModule, loaderContext) {
const modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/isOldIE.js")}`);
return esModule ? `import isOldIE from ${modulePath};` : `var isOldIE = require(${modulePath});`;
}
function getStyleTagTransformFnCode(esModule, loaderContext, options, isSingleton) {
if (isSingleton) {
return "";
}
if (typeof options.styleTagTransform !== "undefined") {
const modulePath = stringifyRequest(loaderContext, `${options.styleTagTransform}`);
loaderContext.addBuildDependency(options.styleTagTransform);
return esModule ? `import styleTagTransformFn from ${modulePath};` : `var styleTagTransformFn = require(${modulePath});`;
}
const modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/styleTagTransform.js")}`);
return esModule ? `import styleTagTransformFn from ${modulePath};` : `var styleTagTransformFn = require(${modulePath});`;
}
function getStyleTagTransformFn(options, isSingleton) {
return isSingleton ? "" : `options.styleTagTransform = styleTagTransformFn`;
}
function getExportStyleCode(esModule, loaderContext, request) {
const modulePath = stringifyRequest(loaderContext, `!!${request}`);
return esModule ? `export * from ${modulePath};
export default content && content.locals ? content.locals : undefined;` : "module.exports = content && content.locals || {};";
}
function getExportLazyStyleCode(esModule, loaderContext, request) {
const modulePath = stringifyRequest(loaderContext, `!!${request}`);
return esModule ? `export * from ${modulePath};
export default exported;` : "module.exports = exported;";
}
function getSetAttributesCode(esModule, loaderContext, options) {
let modulePath;
if (typeof options.attributes !== "undefined") {
modulePath = options.attributes.nonce !== "undefined" ? stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/setAttributesWithAttributesAndNonce.js")}`) : stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/setAttributesWithAttributes.js")}`);
} else {
modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/setAttributesWithoutAttributes.js")}`);
}
return esModule ? `import setAttributes from ${modulePath};` : `var setAttributes = require(${modulePath});`;
}
// eslint-disable-next-line import/prefer-default-export