@rsbuild/core 2.0.0-beta.5 → 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.
Files changed (50) hide show
  1. package/compiled/chokidar/index.d.ts +197 -29
  2. package/compiled/chokidar/package.json +1 -1
  3. package/compiled/connect/index.d.ts +90 -0
  4. package/compiled/connect/license +25 -0
  5. package/compiled/connect/package.json +1 -0
  6. package/compiled/cors/index.d.ts +56 -0
  7. package/compiled/cors/license +22 -0
  8. package/compiled/cors/package.json +1 -0
  9. package/compiled/css-loader/index.js +2 -2
  10. package/compiled/html-rspack-plugin/index.js +14 -14
  11. package/compiled/postcss/index.js +1 -1
  12. package/compiled/postcss/lib/at-rule.d.ts +1 -1
  13. package/compiled/postcss/lib/comment.d.ts +1 -1
  14. package/compiled/postcss/lib/container.d.ts +1 -1
  15. package/compiled/postcss/lib/css-syntax-error.d.ts +1 -1
  16. package/compiled/postcss/lib/declaration.d.ts +1 -1
  17. package/compiled/postcss/lib/document.d.ts +1 -1
  18. package/compiled/postcss/lib/input.d.ts +1 -1
  19. package/compiled/postcss/lib/lazy-result.d.ts +1 -1
  20. package/compiled/postcss/lib/no-work-result.d.ts +1 -1
  21. package/compiled/postcss/lib/node.d.ts +1 -1
  22. package/compiled/postcss/lib/previous-map.d.ts +1 -1
  23. package/compiled/postcss/lib/processor.d.ts +1 -1
  24. package/compiled/postcss/lib/result.d.ts +1 -1
  25. package/compiled/postcss/lib/root.d.ts +1 -1
  26. package/compiled/postcss/lib/rule.d.ts +1 -1
  27. package/compiled/postcss/lib/stringifier.d.ts +1 -1
  28. package/compiled/postcss/lib/warning.d.ts +1 -1
  29. package/compiled/postcss/package.json +1 -1
  30. package/compiled/postcss-loader/index.js +6 -6
  31. package/compiled/rspack-chain/package.json +1 -1
  32. package/compiled/rspack-chain/types/index.d.ts +0 -2
  33. package/compiled/rspack-manifest-plugin/index.d.ts +48 -0
  34. package/compiled/rspack-manifest-plugin/license +21 -0
  35. package/compiled/rspack-manifest-plugin/package.json +1 -0
  36. package/compiled/style-loader/index.js +37 -94
  37. package/compiled/style-loader/package.json +1 -1
  38. package/dist/131.js +869 -713
  39. package/dist/client/hmr.js +1 -1
  40. package/dist/connect.js +5 -1
  41. package/dist/launch-editor-middleware.js +11 -10
  42. package/dist/manifest-plugin.js +5 -5
  43. package/dist/memfs.js +45 -45
  44. package/dist/open.js +3 -4
  45. package/dist/tinyglobby.js +100 -55
  46. package/dist-types/server/socketServer.d.ts +2 -0
  47. package/dist-types/types/config.d.ts +10 -15
  48. package/dist-types/types/thirdParty.d.ts +14 -5
  49. package/package.json +9 -9
  50. package/compiled/chokidar/handler.d.ts +0 -90
@@ -43,7 +43,7 @@ declare namespace Container {
43
43
  | string
44
44
  | undefined
45
45
 
46
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
46
+
47
47
  export { Container_ as default }
48
48
  }
49
49
 
@@ -16,7 +16,7 @@ declare namespace CssSyntaxError {
16
16
  line: number
17
17
  }
18
18
 
19
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
19
+
20
20
  export { CssSyntaxError_ as default }
21
21
  }
22
22
 
@@ -39,7 +39,7 @@ declare namespace Declaration {
39
39
  value: string
40
40
  }
41
41
 
42
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
42
+
43
43
  export { Declaration_ as default }
44
44
  }
45
45
 
@@ -16,7 +16,7 @@ declare namespace Document {
16
16
  raws?: Record<string, any>
17
17
  }
18
18
 
19
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
19
+
20
20
  export { Document_ as default }
21
21
  }
22
22
 
@@ -49,7 +49,7 @@ declare namespace Input {
49
49
  url: string
50
50
  }
51
51
 
52
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
52
+
53
53
  export { Input_ as default }
54
54
  }
55
55
 
@@ -6,7 +6,7 @@ import Root from './root.js'
6
6
  import Warning from './warning.js'
7
7
 
8
8
  declare namespace LazyResult {
9
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
9
+
10
10
  export { LazyResult_ as default }
11
11
  }
12
12
 
@@ -6,7 +6,7 @@ import Root from './root.js'
6
6
  import Warning from './warning.js'
7
7
 
8
8
  declare namespace NoWorkResult {
9
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
9
+
10
10
  export { NoWorkResult_ as default }
11
11
  }
12
12
 
@@ -126,7 +126,7 @@ declare namespace Node {
126
126
  word?: string
127
127
  }
128
128
 
129
- // eslint-disable-next-line @typescript-eslint/no-shadow
129
+
130
130
  class Node extends Node_ {}
131
131
  export { Node as default }
132
132
  }
@@ -3,7 +3,7 @@ import { SourceMapConsumer } from "./source-map-js"
3
3
  import { ProcessOptions } from './postcss.js'
4
4
 
5
5
  declare namespace PreviousMap {
6
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
6
+
7
7
  export { PreviousMap_ as default }
8
8
  }
9
9
 
@@ -12,7 +12,7 @@ import Result from './result.js'
12
12
  import Root from './root.js'
13
13
 
14
14
  declare namespace Processor {
15
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
15
+
16
16
  export { Processor_ as default }
17
17
  }
18
18
 
@@ -39,7 +39,7 @@ declare namespace Result {
39
39
  plugin?: string
40
40
  }
41
41
 
42
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
42
+
43
43
  export { Result_ as default }
44
44
  }
45
45
 
@@ -40,7 +40,7 @@ declare namespace Root {
40
40
  raws?: RootRaws
41
41
  }
42
42
 
43
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
43
+
44
44
  export { Root_ as default }
45
45
  }
46
46
 
@@ -56,7 +56,7 @@ declare namespace Rule {
56
56
  }
57
57
  ) & ContainerProps
58
58
 
59
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
59
+
60
60
  export { Rule_ as default }
61
61
  }
62
62
 
@@ -11,7 +11,7 @@ import {
11
11
  } from './postcss.js'
12
12
 
13
13
  declare namespace Stringifier {
14
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
14
+
15
15
  export { Stringifier_ as default }
16
16
  }
17
17
 
@@ -40,7 +40,7 @@ declare namespace Warning {
40
40
  word?: string
41
41
  }
42
42
 
43
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
43
+
44
44
  export { Warning_ as default }
45
45
  }
46
46
 
@@ -1 +1 @@
1
- {"name":"postcss","author":"Andrey Sitnik <andrey@sitnik.ru>","version":"8.5.6","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
+ {"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
- 918: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(964)["default"];
4
+ 343: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(889)["default"];
6
6
  },
7
- 964: (__unused_webpack_module, exports, __nccwpck_require__) => {
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__(205);
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
- 205: (module, exports, __nccwpck_require__) => {
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__(918);
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-alpha.0","license":"MIT","types":"types/index.d.ts","type":"module"}
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
- 139: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- const loader = __nccwpck_require__(669);
4
+ 756: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ const loader = __nccwpck_require__(594);
6
6
  module.exports = loader.default;
7
7
  },
8
- 669: (__unused_webpack_module, exports, __nccwpck_require__) => {
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__(256);
13
- var _options = _interopRequireDefault(__nccwpck_require__(671));
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
- typeof options.insert === "function"
64
- ? "function"
65
- : options.insert && _path.default.isAbsolute(options.insert)
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, styleTagTransformType)}\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`;
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, styleTagTransformType)}\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`;
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
- 58: (module) => {
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
- 256: (__unused_webpack_module, exports, __nccwpck_require__) => {
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__(58));
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
- splitted
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
- return "";
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
- return `options.insert = ${options.insert.toString()};`;
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 (styleTagTransformType === "default") {
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
- return "";
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
- : typeof options.styleTagTransform === "function"
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
- 671: (module) => {
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","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"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","anyOf":[{"type":"string"},{"instanceof":"Function"}]}},"additionalProperties":false}',
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__(139);
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":"3.3.4","funding":{"type":"opencollective","url":"https://opencollective.com/webpack"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
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"}