@rsbuild/core 2.0.0-beta.6 → 2.0.0-beta.7
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/compiled/chokidar/index.d.ts +197 -29
- package/compiled/chokidar/package.json +1 -1
- package/compiled/connect/index.d.ts +90 -0
- package/compiled/connect/license +25 -0
- package/compiled/connect/package.json +1 -0
- package/compiled/cors/index.d.ts +56 -0
- package/compiled/cors/license +22 -0
- package/compiled/cors/package.json +1 -0
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/postcss/index.js +1 -1
- package/compiled/postcss/lib/at-rule.d.ts +1 -1
- package/compiled/postcss/lib/comment.d.ts +1 -1
- package/compiled/postcss/lib/container.d.ts +1 -1
- package/compiled/postcss/lib/css-syntax-error.d.ts +1 -1
- package/compiled/postcss/lib/declaration.d.ts +1 -1
- package/compiled/postcss/lib/document.d.ts +1 -1
- package/compiled/postcss/lib/input.d.ts +1 -1
- package/compiled/postcss/lib/lazy-result.d.ts +1 -1
- package/compiled/postcss/lib/no-work-result.d.ts +1 -1
- package/compiled/postcss/lib/node.d.ts +1 -1
- package/compiled/postcss/lib/previous-map.d.ts +1 -1
- package/compiled/postcss/lib/processor.d.ts +1 -1
- package/compiled/postcss/lib/result.d.ts +1 -1
- package/compiled/postcss/lib/root.d.ts +1 -1
- package/compiled/postcss/lib/rule.d.ts +1 -1
- package/compiled/postcss/lib/stringifier.d.ts +1 -1
- package/compiled/postcss/lib/warning.d.ts +1 -1
- package/compiled/postcss/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rspack-chain/package.json +1 -1
- package/compiled/rspack-chain/types/index.d.ts +0 -2
- package/compiled/rspack-manifest-plugin/index.d.ts +48 -0
- package/compiled/rspack-manifest-plugin/license +21 -0
- package/compiled/rspack-manifest-plugin/package.json +1 -0
- package/compiled/style-loader/index.js +37 -94
- package/compiled/style-loader/package.json +1 -1
- package/dist/131.js +851 -706
- package/dist/client/hmr.js +1 -1
- package/dist/connect.js +5 -1
- package/dist/launch-editor-middleware.js +11 -10
- package/dist/manifest-plugin.js +5 -5
- package/dist/memfs.js +45 -45
- package/dist/open.js +3 -4
- package/dist/tinyglobby.js +100 -55
- package/dist-types/types/config.d.ts +4 -4
- package/dist-types/types/thirdParty.d.ts +14 -5
- package/package.json +9 -9
- package/compiled/chokidar/handler.d.ts +0 -90
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"postcss","author":"Andrey Sitnik <andrey@sitnik.ru>","version":"8.5.
|
|
1
|
+
{"name":"postcss","author":"Andrey Sitnik <andrey@sitnik.ru>","version":"8.5.8","funding":[{"type":"opencollective","url":"https://opencollective.com/postcss/"},{"type":"tidelift","url":"https://tidelift.com/funding/github/npm/postcss"},{"type":"github","url":"https://github.com/sponsors/ai"}],"license":"MIT","types":"./lib/postcss.d.ts","type":"commonjs"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
343: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(889)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
889: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
8
8
|
var __webpack_unused_export__;
|
|
9
9
|
__webpack_unused_export__ = { value: true };
|
|
10
10
|
exports["default"] = loader;
|
|
11
11
|
var _nodePath = _interopRequireDefault(__nccwpck_require__(760));
|
|
12
|
-
var _utils = __nccwpck_require__(
|
|
12
|
+
var _utils = __nccwpck_require__(140);
|
|
13
13
|
function _interopRequireDefault(e) {
|
|
14
14
|
return e && e.__esModule ? e : { default: e };
|
|
15
15
|
}
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
callback(null, result.css, map, { ast });
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
|
-
|
|
182
|
+
140: (module, exports, __nccwpck_require__) => {
|
|
183
183
|
module = __nccwpck_require__.nmd(module);
|
|
184
184
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
185
185
|
exports.exec = exec;
|
|
@@ -716,6 +716,6 @@
|
|
|
716
716
|
})();
|
|
717
717
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
718
718
|
__nccwpck_require__.ab = __dirname + "/";
|
|
719
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
719
|
+
var __webpack_exports__ = __nccwpck_require__(343);
|
|
720
720
|
module.exports = __webpack_exports__;
|
|
721
721
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"rspack-chain","version":"2.0.0-
|
|
1
|
+
{"name":"rspack-chain","version":"2.0.0-beta.0","license":"MIT","types":"types/index.d.ts","type":"module"}
|
|
@@ -92,7 +92,6 @@ declare class Config extends __Config.ChainedMap<void> {
|
|
|
92
92
|
dependencies(value: RspackConfig['dependencies']): this;
|
|
93
93
|
ignoreWarnings(value: RspackConfig['ignoreWarnings']): this;
|
|
94
94
|
loader(value: RspackConfig['loader']): this;
|
|
95
|
-
profile(value: RspackConfig['profile']): this;
|
|
96
95
|
name(value: RspackConfig['name']): this;
|
|
97
96
|
infrastructureLogging(value: RspackConfig['infrastructureLogging']): this;
|
|
98
97
|
snapshot(value: RspackConfig['snapshot']): this;
|
|
@@ -180,7 +179,6 @@ declare namespace Config {
|
|
|
180
179
|
parser: ChainedMap<this>;
|
|
181
180
|
rule(name: string): Rule;
|
|
182
181
|
noParse(value: RspackModule['noParse']): this;
|
|
183
|
-
unsafeCache(value: RspackModule['unsafeCache']): this;
|
|
184
182
|
}
|
|
185
183
|
|
|
186
184
|
type RspackOutput = Required<NonNullable<Configuration['output']>>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Chunk, Compiler, Compilation, RspackPluginInstance } from '@rspack/core';
|
|
2
|
+
|
|
3
|
+
interface FileDescriptor {
|
|
4
|
+
chunk?: Chunk;
|
|
5
|
+
isAsset: boolean;
|
|
6
|
+
isChunk: boolean;
|
|
7
|
+
isInitial: boolean;
|
|
8
|
+
isModuleAsset: boolean;
|
|
9
|
+
name: string;
|
|
10
|
+
path: string;
|
|
11
|
+
integrity?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare const getCompilerHooks: (compiler: Compiler) => any;
|
|
15
|
+
|
|
16
|
+
type Manifest = Record<string, any>;
|
|
17
|
+
interface InternalOptions {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
assetHookStage: number;
|
|
20
|
+
basePath: string;
|
|
21
|
+
fileName: string;
|
|
22
|
+
filter: (file: FileDescriptor) => boolean;
|
|
23
|
+
generate: (seed: Record<any, any>, files: FileDescriptor[], entries: Record<string, string[]>, context: {
|
|
24
|
+
compilation: Compilation;
|
|
25
|
+
}) => Manifest;
|
|
26
|
+
map: (file: FileDescriptor) => FileDescriptor;
|
|
27
|
+
publicPath: string;
|
|
28
|
+
removeKeyHash: RegExp | false;
|
|
29
|
+
seed: Record<any, any>;
|
|
30
|
+
serialize: (manifest: Manifest) => string;
|
|
31
|
+
sort: (fileA: FileDescriptor, fileB: FileDescriptor) => Number;
|
|
32
|
+
transformExtensions: RegExp;
|
|
33
|
+
useEntryKeys: boolean;
|
|
34
|
+
useLegacyEmit: boolean;
|
|
35
|
+
writeToFileEmit: boolean;
|
|
36
|
+
}
|
|
37
|
+
type ManifestPluginOptions = Partial<InternalOptions>;
|
|
38
|
+
type EmitCountMap = Map<any, any>;
|
|
39
|
+
declare class WebpackManifestPlugin implements RspackPluginInstance {
|
|
40
|
+
private options;
|
|
41
|
+
constructor(opts: ManifestPluginOptions);
|
|
42
|
+
apply(compiler: Compiler): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare const RspackManifestPlugin: typeof WebpackManifestPlugin;
|
|
46
|
+
|
|
47
|
+
export { RspackManifestPlugin, WebpackManifestPlugin, getCompilerHooks };
|
|
48
|
+
export type { EmitCountMap, FileDescriptor, InternalOptions, Manifest, ManifestPluginOptions };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) Dane Thurber <dane.thurber@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"rspack-manifest-plugin","author":"Dane Thurber <dane.thurber@gmail.com>","version":"5.2.1","license":"MIT","types":"index.d.ts","type":"commonjs"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
const loader = __nccwpck_require__(
|
|
4
|
+
756: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
const loader = __nccwpck_require__(594);
|
|
6
6
|
module.exports = loader.default;
|
|
7
7
|
},
|
|
8
|
-
|
|
8
|
+
594: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
var _path = _interopRequireDefault(__nccwpck_require__(928));
|
|
12
|
-
var _utils = __nccwpck_require__(
|
|
13
|
-
var _options = _interopRequireDefault(__nccwpck_require__(
|
|
12
|
+
var _utils = __nccwpck_require__(187);
|
|
13
|
+
var _options = _interopRequireDefault(__nccwpck_require__(648));
|
|
14
14
|
function _interopRequireDefault(obj) {
|
|
15
15
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
16
16
|
}
|
|
@@ -60,18 +60,9 @@
|
|
|
60
60
|
runtimeOptions.base = options.base;
|
|
61
61
|
}
|
|
62
62
|
const insertType =
|
|
63
|
-
|
|
64
|
-
? "
|
|
65
|
-
:
|
|
66
|
-
? "module-path"
|
|
67
|
-
: "selector";
|
|
68
|
-
const styleTagTransformType =
|
|
69
|
-
typeof options.styleTagTransform === "function"
|
|
70
|
-
? "function"
|
|
71
|
-
: options.styleTagTransform &&
|
|
72
|
-
_path.default.isAbsolute(options.styleTagTransform)
|
|
73
|
-
? "module-path"
|
|
74
|
-
: "default";
|
|
63
|
+
options.insert && _path.default.isAbsolute(options.insert)
|
|
64
|
+
? "module-path"
|
|
65
|
+
: "selector";
|
|
75
66
|
switch (injectType) {
|
|
76
67
|
case "linkTag": {
|
|
77
68
|
const hmrCode = this.hot
|
|
@@ -87,7 +78,7 @@
|
|
|
87
78
|
const hmrCode = this.hot
|
|
88
79
|
? (0, _utils.getStyleHmrCode)(esModule, this, request, true)
|
|
89
80
|
: "";
|
|
90
|
-
return `\n var exported = {};\n\n ${(0, _utils.getImportStyleAPICode)(esModule, this)}\n ${(0, _utils.getImportStyleDomAPICode)(esModule, this, isSingleton, isAuto)}\n ${(0, _utils.getImportInsertBySelectorCode)(esModule, this, insertType, options)}\n ${(0, _utils.getSetAttributesCode)(esModule, this, options)}\n ${(0, _utils.getImportInsertStyleElementCode)(esModule, this)}\n ${(0, _utils.getStyleTagTransformFnCode)(esModule, this, options, isSingleton
|
|
81
|
+
return `\n var exported = {};\n\n ${(0, _utils.getImportStyleAPICode)(esModule, this)}\n ${(0, _utils.getImportStyleDomAPICode)(esModule, this, isSingleton, isAuto)}\n ${(0, _utils.getImportInsertBySelectorCode)(esModule, this, insertType, options)}\n ${(0, _utils.getSetAttributesCode)(esModule, this, options)}\n ${(0, _utils.getImportInsertStyleElementCode)(esModule, this)}\n ${(0, _utils.getStyleTagTransformFnCode)(esModule, this, options, isSingleton)}\n ${(0, _utils.getImportStyleContentCode)(esModule, this, request)}\n ${isAuto ? (0, _utils.getImportIsOldIECode)(esModule, this) : ""}\n ${esModule ? `if (content && content.locals) {\n exported.locals = content.locals;\n }\n ` : `content = content.__esModule ? content.default : content;\n\n exported.locals = content.locals || {};`}\n\nvar refs = 0;\nvar update;\nvar options = ${JSON.stringify(runtimeOptions)};\n\n${(0, _utils.getStyleTagTransformFn)(options, isSingleton)};\noptions.setAttributes = setAttributes;\n${(0, _utils.getInsertOptionCode)(insertType, options)}\noptions.domAPI = ${(0, _utils.getdomAPI)(isAuto)};\noptions.insertStyleElement = insertStyleElement;\n\nexported.use = function(insertOptions) {\n options.options = insertOptions || {};\n\n if (!(refs++)) {\n update = API(content, options);\n }\n\n return exported;\n};\nexported.unuse = function() {\n if (refs > 0 && !--refs) {\n update();\n update = null;\n }\n};\n\n${hmrCode}\n\n${(0, _utils.getExportLazyStyleCode)(esModule, this, request)}\n`;
|
|
91
82
|
}
|
|
92
83
|
case "styleTag":
|
|
93
84
|
case "autoStyleTag":
|
|
@@ -98,13 +89,13 @@
|
|
|
98
89
|
const hmrCode = this.hot
|
|
99
90
|
? (0, _utils.getStyleHmrCode)(esModule, this, request, false)
|
|
100
91
|
: "";
|
|
101
|
-
return `\n ${(0, _utils.getImportStyleAPICode)(esModule, this)}\n ${(0, _utils.getImportStyleDomAPICode)(esModule, this, isSingleton, isAuto)}\n ${(0, _utils.getImportInsertBySelectorCode)(esModule, this, insertType, options)}\n ${(0, _utils.getSetAttributesCode)(esModule, this, options)}\n ${(0, _utils.getImportInsertStyleElementCode)(esModule, this)}\n ${(0, _utils.getStyleTagTransformFnCode)(esModule, this, options, isSingleton
|
|
92
|
+
return `\n ${(0, _utils.getImportStyleAPICode)(esModule, this)}\n ${(0, _utils.getImportStyleDomAPICode)(esModule, this, isSingleton, isAuto)}\n ${(0, _utils.getImportInsertBySelectorCode)(esModule, this, insertType, options)}\n ${(0, _utils.getSetAttributesCode)(esModule, this, options)}\n ${(0, _utils.getImportInsertStyleElementCode)(esModule, this)}\n ${(0, _utils.getStyleTagTransformFnCode)(esModule, this, options, isSingleton)}\n ${(0, _utils.getImportStyleContentCode)(esModule, this, request)}\n ${isAuto ? (0, _utils.getImportIsOldIECode)(esModule, this) : ""}\n ${esModule ? "" : `content = content.__esModule ? content.default : content;`}\n\nvar options = ${JSON.stringify(runtimeOptions)};\n\n${(0, _utils.getStyleTagTransformFn)(options, isSingleton)};\noptions.setAttributes = setAttributes;\n${(0, _utils.getInsertOptionCode)(insertType, options)}\noptions.domAPI = ${(0, _utils.getdomAPI)(isAuto)};\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n${hmrCode}\n\n${(0, _utils.getExportStyleCode)(esModule, this, request)}\n`;
|
|
102
93
|
}
|
|
103
94
|
}
|
|
104
95
|
};
|
|
105
96
|
var _default = (exports["default"] = loader);
|
|
106
97
|
},
|
|
107
|
-
|
|
98
|
+
109: (module) => {
|
|
108
99
|
function isEqualLocals(a, b, isNamedExport) {
|
|
109
100
|
if ((!a && b) || (a && !b)) {
|
|
110
101
|
return false;
|
|
@@ -130,7 +121,7 @@
|
|
|
130
121
|
}
|
|
131
122
|
module.exports = isEqualLocals;
|
|
132
123
|
},
|
|
133
|
-
|
|
124
|
+
187: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
134
125
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
135
126
|
exports.getExportLazyStyleCode = getExportLazyStyleCode;
|
|
136
127
|
exports.getExportStyleCode = getExportStyleCode;
|
|
@@ -151,49 +142,13 @@
|
|
|
151
142
|
exports.getdomAPI = getdomAPI;
|
|
152
143
|
exports.stringifyRequest = stringifyRequest;
|
|
153
144
|
var _path = _interopRequireDefault(__nccwpck_require__(928));
|
|
154
|
-
var _isEqualLocals = _interopRequireDefault(__nccwpck_require__(
|
|
145
|
+
var _isEqualLocals = _interopRequireDefault(__nccwpck_require__(109));
|
|
155
146
|
function _interopRequireDefault(obj) {
|
|
156
147
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
157
148
|
}
|
|
158
|
-
const matchRelativePath = /^\.\.?[/\\]/;
|
|
159
|
-
function isAbsolutePath(str) {
|
|
160
|
-
return (
|
|
161
|
-
_path.default.posix.isAbsolute(str) ||
|
|
162
|
-
_path.default.win32.isAbsolute(str)
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
function isRelativePath(str) {
|
|
166
|
-
return matchRelativePath.test(str);
|
|
167
|
-
}
|
|
168
149
|
function stringifyRequest(loaderContext, request) {
|
|
169
|
-
if (
|
|
170
|
-
typeof loaderContext.utils !== "undefined" &&
|
|
171
|
-
typeof loaderContext.utils.contextify === "function"
|
|
172
|
-
) {
|
|
173
|
-
return JSON.stringify(
|
|
174
|
-
loaderContext.utils.contextify(loaderContext.context, request),
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
const splitted = request.split("!");
|
|
178
|
-
const { context } = loaderContext;
|
|
179
150
|
return JSON.stringify(
|
|
180
|
-
|
|
181
|
-
.map((part) => {
|
|
182
|
-
const splittedPart = part.match(/^(.*?)(\?.*)/);
|
|
183
|
-
const query = splittedPart ? splittedPart[2] : "";
|
|
184
|
-
let singlePath = splittedPart ? splittedPart[1] : part;
|
|
185
|
-
if (isAbsolutePath(singlePath) && context) {
|
|
186
|
-
singlePath = _path.default.relative(context, singlePath);
|
|
187
|
-
if (isAbsolutePath(singlePath)) {
|
|
188
|
-
return singlePath + query;
|
|
189
|
-
}
|
|
190
|
-
if (isRelativePath(singlePath) === false) {
|
|
191
|
-
singlePath = `./${singlePath}`;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
return singlePath.replace(/\\/g, "/") + query;
|
|
195
|
-
})
|
|
196
|
-
.join("!"),
|
|
151
|
+
loaderContext.utils.contextify(loaderContext.context, request),
|
|
197
152
|
);
|
|
198
153
|
}
|
|
199
154
|
function getImportLinkAPICode(esModule, loaderContext) {
|
|
@@ -255,15 +210,6 @@
|
|
|
255
210
|
insertType,
|
|
256
211
|
options,
|
|
257
212
|
) {
|
|
258
|
-
if (insertType === "selector") {
|
|
259
|
-
const modulePath = stringifyRequest(
|
|
260
|
-
loaderContext,
|
|
261
|
-
`!${_path.default.join(__dirname, "runtime/insertBySelector.js")}`,
|
|
262
|
-
);
|
|
263
|
-
return esModule
|
|
264
|
-
? `import insertFn from ${modulePath};`
|
|
265
|
-
: `var insertFn = require(${modulePath});`;
|
|
266
|
-
}
|
|
267
213
|
if (insertType === "module-path") {
|
|
268
214
|
const modulePath = stringifyRequest(
|
|
269
215
|
loaderContext,
|
|
@@ -274,19 +220,22 @@
|
|
|
274
220
|
? `import insertFn from ${modulePath};`
|
|
275
221
|
: `var insertFn = require(${modulePath});`;
|
|
276
222
|
}
|
|
277
|
-
|
|
223
|
+
const modulePath = stringifyRequest(
|
|
224
|
+
loaderContext,
|
|
225
|
+
`!${_path.default.join(__dirname, "runtime/insertBySelector.js")}`,
|
|
226
|
+
);
|
|
227
|
+
return esModule
|
|
228
|
+
? `import insertFn from ${modulePath};`
|
|
229
|
+
: `var insertFn = require(${modulePath});`;
|
|
278
230
|
}
|
|
279
231
|
function getInsertOptionCode(insertType, options) {
|
|
280
|
-
if (insertType === "selector") {
|
|
281
|
-
const insert = options.insert
|
|
282
|
-
? JSON.stringify(options.insert)
|
|
283
|
-
: '"head"';
|
|
284
|
-
return `\n options.insert = insertFn.bind(null, ${insert});\n `;
|
|
285
|
-
}
|
|
286
232
|
if (insertType === "module-path") {
|
|
287
233
|
return `options.insert = insertFn;`;
|
|
288
234
|
}
|
|
289
|
-
|
|
235
|
+
const insert = options.insert
|
|
236
|
+
? JSON.stringify(options.insert)
|
|
237
|
+
: '"head"';
|
|
238
|
+
return `options.insert = insertFn.bind(null, ${insert});`;
|
|
290
239
|
}
|
|
291
240
|
function getImportInsertStyleElementCode(esModule, loaderContext) {
|
|
292
241
|
const modulePath = stringifyRequest(
|
|
@@ -322,21 +271,11 @@
|
|
|
322
271
|
loaderContext,
|
|
323
272
|
options,
|
|
324
273
|
isSingleton,
|
|
325
|
-
styleTagTransformType,
|
|
326
274
|
) {
|
|
327
275
|
if (isSingleton) {
|
|
328
276
|
return "";
|
|
329
277
|
}
|
|
330
|
-
if (
|
|
331
|
-
const modulePath = stringifyRequest(
|
|
332
|
-
loaderContext,
|
|
333
|
-
`!${_path.default.join(__dirname, "runtime/styleTagTransform.js")}`,
|
|
334
|
-
);
|
|
335
|
-
return esModule
|
|
336
|
-
? `import styleTagTransformFn from ${modulePath};`
|
|
337
|
-
: `var styleTagTransformFn = require(${modulePath});`;
|
|
338
|
-
}
|
|
339
|
-
if (styleTagTransformType === "module-path") {
|
|
278
|
+
if (typeof options.styleTagTransform !== "undefined") {
|
|
340
279
|
const modulePath = stringifyRequest(
|
|
341
280
|
loaderContext,
|
|
342
281
|
`${options.styleTagTransform}`,
|
|
@@ -346,14 +285,18 @@
|
|
|
346
285
|
? `import styleTagTransformFn from ${modulePath};`
|
|
347
286
|
: `var styleTagTransformFn = require(${modulePath});`;
|
|
348
287
|
}
|
|
349
|
-
|
|
288
|
+
const modulePath = stringifyRequest(
|
|
289
|
+
loaderContext,
|
|
290
|
+
`!${_path.default.join(__dirname, "runtime/styleTagTransform.js")}`,
|
|
291
|
+
);
|
|
292
|
+
return esModule
|
|
293
|
+
? `import styleTagTransformFn from ${modulePath};`
|
|
294
|
+
: `var styleTagTransformFn = require(${modulePath});`;
|
|
350
295
|
}
|
|
351
296
|
function getStyleTagTransformFn(options, isSingleton) {
|
|
352
297
|
return isSingleton
|
|
353
298
|
? ""
|
|
354
|
-
:
|
|
355
|
-
? `options.styleTagTransform = ${options.styleTagTransform.toString()}`
|
|
356
|
-
: `options.styleTagTransform = styleTagTransformFn`;
|
|
299
|
+
: `options.styleTagTransform = styleTagTransformFn`;
|
|
357
300
|
}
|
|
358
301
|
function getExportStyleCode(esModule, loaderContext, request) {
|
|
359
302
|
const modulePath = stringifyRequest(loaderContext, `!!${request}`);
|
|
@@ -394,9 +337,9 @@
|
|
|
394
337
|
928: (module) => {
|
|
395
338
|
module.exports = require("path");
|
|
396
339
|
},
|
|
397
|
-
|
|
340
|
+
648: (module) => {
|
|
398
341
|
module.exports = JSON.parse(
|
|
399
|
-
'{"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","
|
|
342
|
+
'{"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}',
|
|
400
343
|
);
|
|
401
344
|
},
|
|
402
345
|
};
|
|
@@ -422,6 +365,6 @@
|
|
|
422
365
|
}
|
|
423
366
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
424
367
|
__nccwpck_require__.ab = __dirname + "/";
|
|
425
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
368
|
+
var __webpack_exports__ = __nccwpck_require__(756);
|
|
426
369
|
module.exports = __webpack_exports__;
|
|
427
370
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"style-loader","author":"Tobias Koppers @sokra","version":"
|
|
1
|
+
{"name":"style-loader","author":"Tobias Koppers @sokra","version":"4.0.0","funding":{"type":"opencollective","url":"https://opencollective.com/webpack"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
|