@unpackjs/core 4.1.0 → 4.2.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.
@@ -1,24 +1,24 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 588: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 5788: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const loader = __nccwpck_require__(8674);
5
+ const loader = __nccwpck_require__(9410);
6
6
  module.exports = loader.default;
7
7
  module.exports.defaultGetLocalIdent =
8
- __nccwpck_require__(8867).defaultGetLocalIdent;
8
+ __nccwpck_require__(4643).defaultGetLocalIdent;
9
9
  },
10
- 8674: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ 9410: (__unused_webpack_module, exports, __nccwpck_require__) => {
11
11
  "use strict";
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports["default"] = loader;
14
14
  var _postcss = _interopRequireDefault(__nccwpck_require__(1940));
15
15
  var _package = _interopRequireDefault(__nccwpck_require__(444));
16
16
  var _semver = __nccwpck_require__(5200);
17
- var _options = _interopRequireDefault(__nccwpck_require__(2824));
18
- var _plugins = __nccwpck_require__(945);
19
- var _utils = __nccwpck_require__(8867);
20
- function _interopRequireDefault(obj) {
21
- return obj && obj.__esModule ? obj : { default: obj };
17
+ var _options = _interopRequireDefault(__nccwpck_require__(2204));
18
+ var _plugins = __nccwpck_require__(3153);
19
+ var _utils = __nccwpck_require__(4643);
20
+ function _interopRequireDefault(e) {
21
+ return e && e.__esModule ? e : { default: e };
22
22
  }
23
23
  async function loader(content, map, meta) {
24
24
  const rawOptions = this.getOptions(_options.default);
@@ -243,7 +243,7 @@
243
243
  callback(null, `${importCode}${moduleCode}${exportCode}`);
244
244
  }
245
245
  },
246
- 945: (__unused_webpack_module, exports, __nccwpck_require__) => {
246
+ 3153: (__unused_webpack_module, exports, __nccwpck_require__) => {
247
247
  "use strict";
248
248
  Object.defineProperty(exports, "__esModule", { value: true });
249
249
  Object.defineProperty(exports, "icssParser", {
@@ -265,22 +265,22 @@
265
265
  },
266
266
  });
267
267
  var _postcssImportParser = _interopRequireDefault(
268
- __nccwpck_require__(762),
268
+ __nccwpck_require__(8170),
269
269
  );
270
270
  var _postcssIcssParser = _interopRequireDefault(
271
- __nccwpck_require__(2691),
271
+ __nccwpck_require__(6451),
272
272
  );
273
- var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(9222));
274
- function _interopRequireDefault(obj) {
275
- return obj && obj.__esModule ? obj : { default: obj };
273
+ var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(6246));
274
+ function _interopRequireDefault(e) {
275
+ return e && e.__esModule ? e : { default: e };
276
276
  }
277
277
  },
278
- 2691: (__unused_webpack_module, exports, __nccwpck_require__) => {
278
+ 6451: (__unused_webpack_module, exports, __nccwpck_require__) => {
279
279
  "use strict";
280
280
  Object.defineProperty(exports, "__esModule", { value: true });
281
281
  exports["default"] = void 0;
282
282
  var _icssUtils = __nccwpck_require__(229);
283
- var _utils = __nccwpck_require__(8867);
283
+ var _utils = __nccwpck_require__(4643);
284
284
  const plugin = (options = {}) => ({
285
285
  postcssPlugin: "postcss-icss-parser",
286
286
  async OnceExit(root) {
@@ -379,16 +379,16 @@
379
379
  plugin.postcss = true;
380
380
  var _default = (exports["default"] = plugin);
381
381
  },
382
- 762: (__unused_webpack_module, exports, __nccwpck_require__) => {
382
+ 8170: (__unused_webpack_module, exports, __nccwpck_require__) => {
383
383
  "use strict";
384
384
  Object.defineProperty(exports, "__esModule", { value: true });
385
385
  exports["default"] = void 0;
386
386
  var _postcssValueParser = _interopRequireDefault(
387
387
  __nccwpck_require__(5245),
388
388
  );
389
- var _utils = __nccwpck_require__(8867);
390
- function _interopRequireDefault(obj) {
391
- return obj && obj.__esModule ? obj : { default: obj };
389
+ var _utils = __nccwpck_require__(4643);
390
+ function _interopRequireDefault(e) {
391
+ return e && e.__esModule ? e : { default: e };
392
392
  }
393
393
  function isIgnoredAfterName(atRule) {
394
394
  if (
@@ -691,16 +691,16 @@
691
691
  plugin.postcss = true;
692
692
  var _default = (exports["default"] = plugin);
693
693
  },
694
- 9222: (__unused_webpack_module, exports, __nccwpck_require__) => {
694
+ 6246: (__unused_webpack_module, exports, __nccwpck_require__) => {
695
695
  "use strict";
696
696
  Object.defineProperty(exports, "__esModule", { value: true });
697
697
  exports["default"] = void 0;
698
698
  var _postcssValueParser = _interopRequireDefault(
699
699
  __nccwpck_require__(5245),
700
700
  );
701
- var _utils = __nccwpck_require__(8867);
702
- function _interopRequireDefault(obj) {
703
- return obj && obj.__esModule ? obj : { default: obj };
701
+ var _utils = __nccwpck_require__(4643);
702
+ function _interopRequireDefault(e) {
703
+ return e && e.__esModule ? e : { default: e };
704
704
  }
705
705
  const isUrlFunc = /url/i;
706
706
  const isImageSetFunc = /^(?:-webkit-)?image-set$/i;
@@ -1041,7 +1041,7 @@
1041
1041
  plugin.postcss = true;
1042
1042
  var _default = (exports["default"] = plugin);
1043
1043
  },
1044
- 8867: (__unused_webpack_module, exports, __nccwpck_require__) => {
1044
+ 4643: (__unused_webpack_module, exports, __nccwpck_require__) => {
1045
1045
  "use strict";
1046
1046
  Object.defineProperty(exports, "__esModule", { value: true });
1047
1047
  exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
@@ -1085,8 +1085,8 @@
1085
1085
  var _postcssModulesScope = _interopRequireDefault(
1086
1086
  __nccwpck_require__(8519),
1087
1087
  );
1088
- function _interopRequireDefault(obj) {
1089
- return obj && obj.__esModule ? obj : { default: obj };
1088
+ function _interopRequireDefault(e) {
1089
+ return e && e.__esModule ? e : { default: e };
1090
1090
  }
1091
1091
  const WEBPACK_IGNORE_COMMENT_REGEXP =
1092
1092
  (exports.WEBPACK_IGNORE_COMMENT_REGEXP =
@@ -1308,8 +1308,10 @@
1308
1308
  }
1309
1309
  let localIdentHash = "";
1310
1310
  for (let tier = 0; localIdentHash.length < hashDigestLength; tier++) {
1311
- const hash =
1312
- loaderContext._compiler.webpack.util.createHash(hashFunction);
1311
+ const hash = (
1312
+ loaderContext.utils.createHash ||
1313
+ loaderContext._compiler.webpack.util.createHash
1314
+ )(hashFunction);
1313
1315
  if (hashSalt) {
1314
1316
  hash.update(hashSalt);
1315
1317
  }
@@ -1448,7 +1450,6 @@
1448
1450
  rawModulesOptions = rawOptions.modules;
1449
1451
  ({ auto } = rawModulesOptions);
1450
1452
  }
1451
- const { outputOptions } = loaderContext._compilation;
1452
1453
  const needNamedExport =
1453
1454
  exportType === "css-style-sheet" || exportType === "string";
1454
1455
  const namedExport =
@@ -1467,10 +1468,18 @@
1467
1468
  exportGlobals: false,
1468
1469
  localIdentName: "[hash:base64]",
1469
1470
  localIdentContext: loaderContext.rootContext,
1470
- localIdentHashSalt: outputOptions.hashSalt,
1471
- localIdentHashFunction: outputOptions.hashFunction,
1472
- localIdentHashDigest: outputOptions.hashDigest,
1473
- localIdentHashDigestLength: outputOptions.hashDigestLength,
1471
+ localIdentHashSalt:
1472
+ loaderContext.hashSalt ||
1473
+ loaderContext._compilation.outputOptions.hashSalt,
1474
+ localIdentHashFunction:
1475
+ loaderContext.hashFunction ||
1476
+ loaderContext._compilation.outputOptions.hashFunction,
1477
+ localIdentHashDigest:
1478
+ loaderContext.hashDigest ||
1479
+ loaderContext._compilation.outputOptions.hashDigest,
1480
+ localIdentHashDigestLength:
1481
+ loaderContext.hashDigestLength ||
1482
+ loaderContext._compilation.outputOptions.hashDigestLength,
1474
1483
  localIdentRegExp: undefined,
1475
1484
  getLocalIdent: undefined,
1476
1485
  exportOnlyLocals: false,
@@ -1972,6 +1981,7 @@
1972
1981
  "volatile",
1973
1982
  "while",
1974
1983
  "with",
1984
+ "module",
1975
1985
  ]);
1976
1986
  function getExportCode(
1977
1987
  exports,
@@ -5952,7 +5962,6 @@
5952
5962
  for (
5953
5963
  var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step;
5954
5964
  !(_step = _iterator()).done;
5955
-
5956
5965
  ) {
5957
5966
  var node = _step.value;
5958
5967
  node.parent = undefined;
@@ -8086,10 +8095,10 @@
8086
8095
  "use strict";
8087
8096
  module.exports = require("util");
8088
8097
  },
8089
- 2824: (module) => {
8098
+ 2204: (module) => {
8090
8099
  "use strict";
8091
8100
  module.exports = JSON.parse(
8092
- '{"title":"CSS Loader options","additionalProperties":false,"properties":{"url":{"description":"Allows to enables/disables `url()`/`image-set()` functions handling.","link":"https://github.com/webpack-contrib/css-loader#url","anyOf":[{"type":"boolean"},{"type":"object","properties":{"filter":{"instanceof":"Function"}},"additionalProperties":false}]},"import":{"description":"Allows to enables/disables `@import` at-rules handling.","link":"https://github.com/webpack-contrib/css-loader#import","anyOf":[{"type":"boolean"},{"type":"object","properties":{"filter":{"instanceof":"Function"}},"additionalProperties":false}]},"modules":{"description":"Allows to enable/disable CSS Modules or ICSS and setup configuration.","link":"https://github.com/webpack-contrib/css-loader#modules","anyOf":[{"type":"boolean"},{"enum":["local","global","pure","icss"]},{"type":"object","additionalProperties":false,"properties":{"auto":{"description":"Allows auto enable CSS modules based on filename.","link":"https://github.com/webpack-contrib/css-loader#auto","anyOf":[{"instanceof":"RegExp"},{"instanceof":"Function"},{"type":"boolean"}]},"mode":{"description":"Setup `mode` option.","link":"https://github.com/webpack-contrib/css-loader#mode","anyOf":[{"enum":["local","global","pure","icss"]},{"instanceof":"Function"}]},"localIdentName":{"description":"Allows to configure the generated local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentname","type":"string","minLength":1},"localIdentContext":{"description":"Allows to redefine basic loader context for local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentcontext","type":"string","minLength":1},"localIdentHashSalt":{"description":"Allows to add custom hash to generate more unique classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashsalt","type":"string","minLength":1},"localIdentHashFunction":{"description":"Allows to specify hash function to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashfunction","type":"string","minLength":1},"localIdentHashDigest":{"description":"Allows to specify hash digest to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashdigest","type":"string","minLength":1},"localIdentHashDigestLength":{"description":"Allows to specify hash digest length to generate classes.","link":"https://github.com/webpack-contrib/css-loader#localidenthashdigestlength","type":"number"},"hashStrategy":{"description":"Allows to specify should localName be used when computing the hash.","link":"https://github.com/webpack-contrib/css-loader#hashstrategy","enum":["resource-path-and-local-name","minimal-subset"]},"localIdentRegExp":{"description":"Allows to specify custom RegExp for local ident name.","link":"https://github.com/webpack-contrib/css-loader#localidentregexp","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"getLocalIdent":{"description":"Allows to specify a function to generate the classname.","link":"https://github.com/webpack-contrib/css-loader#getlocalident","instanceof":"Function"},"namedExport":{"description":"Enables/disables ES modules named export for locals.","link":"https://github.com/webpack-contrib/css-loader#namedexport","type":"boolean"},"exportGlobals":{"description":"Allows to export names from global class or id, so you can use that as local name.","link":"https://github.com/webpack-contrib/css-loader#exportglobals","type":"boolean"},"exportLocalsConvention":{"description":"Style of exported classnames.","link":"https://github.com/webpack-contrib/css-loader#localsconvention","anyOf":[{"enum":["asIs","as-is","camelCase","camel-case","camelCaseOnly","camel-case-only","dashes","dashesOnly","dashes-only"]},{"instanceof":"Function"}]},"exportOnlyLocals":{"description":"Export only locals.","link":"https://github.com/webpack-contrib/css-loader#exportonlylocals","type":"boolean"},"getJSON":{"description":"Allows outputting of CSS modules mapping through a callback.","link":"https://github.com/webpack-contrib/css-loader#getJSON","instanceof":"Function"}}}]},"sourceMap":{"description":"Allows to enable/disable source maps.","link":"https://github.com/webpack-contrib/css-loader#sourcemap","type":"boolean"},"importLoaders":{"description":"Allows enables/disables or setups number of loaders applied before CSS loader for `@import`/CSS Modules and ICSS imports.","link":"https://github.com/webpack-contrib/css-loader#importloaders","anyOf":[{"type":"boolean"},{"type":"string"},{"type":"integer"}]},"esModule":{"description":"Use the ES modules syntax.","link":"https://github.com/webpack-contrib/css-loader#esmodule","type":"boolean"},"exportType":{"description":"Allows exporting styles as array with modules, string or constructable stylesheet (i.e. `CSSStyleSheet`).","link":"https://github.com/webpack-contrib/css-loader#exporttype","enum":["array","string","css-style-sheet"]}},"type":"object"}',
8101
+ '{"title":"CSS Loader options","additionalProperties":false,"properties":{"url":{"description":"Allows to enables/disables `url()`/`image-set()` functions handling.","link":"https://github.com/webpack/css-loader#url","anyOf":[{"type":"boolean"},{"type":"object","properties":{"filter":{"instanceof":"Function"}},"additionalProperties":false}]},"import":{"description":"Allows to enables/disables `@import` at-rules handling.","link":"https://github.com/webpack/css-loader#import","anyOf":[{"type":"boolean"},{"type":"object","properties":{"filter":{"instanceof":"Function"}},"additionalProperties":false}]},"modules":{"description":"Allows to enable/disable CSS Modules or ICSS and setup configuration.","link":"https://github.com/webpack/css-loader#modules","anyOf":[{"type":"boolean"},{"enum":["local","global","pure","icss"]},{"type":"object","additionalProperties":false,"properties":{"auto":{"description":"Allows auto enable CSS modules based on filename.","link":"https://github.com/webpack/css-loader#auto","anyOf":[{"instanceof":"RegExp"},{"instanceof":"Function"},{"type":"boolean"}]},"mode":{"description":"Setup `mode` option.","link":"https://github.com/webpack/css-loader#mode","anyOf":[{"enum":["local","global","pure","icss"]},{"instanceof":"Function"}]},"localIdentName":{"description":"Allows to configure the generated local ident name.","link":"https://github.com/webpack/css-loader#localidentname","type":"string","minLength":1},"localIdentContext":{"description":"Allows to redefine basic loader context for local ident name.","link":"https://github.com/webpack/css-loader#localidentcontext","type":"string","minLength":1},"localIdentHashSalt":{"description":"Allows to add custom hash to generate more unique classes.","link":"https://github.com/webpack/css-loader#localidenthashsalt","type":"string","minLength":1},"localIdentHashFunction":{"description":"Allows to specify hash function to generate classes.","link":"https://github.com/webpack/css-loader#localidenthashfunction","type":"string","minLength":1},"localIdentHashDigest":{"description":"Allows to specify hash digest to generate classes.","link":"https://github.com/webpack/css-loader#localidenthashdigest","type":"string","minLength":1},"localIdentHashDigestLength":{"description":"Allows to specify hash digest length to generate classes.","link":"https://github.com/webpack/css-loader#localidenthashdigestlength","type":"number"},"hashStrategy":{"description":"Allows to specify should localName be used when computing the hash.","link":"https://github.com/webpack/css-loader#hashstrategy","enum":["resource-path-and-local-name","minimal-subset"]},"localIdentRegExp":{"description":"Allows to specify custom RegExp for local ident name.","link":"https://github.com/webpack/css-loader#localidentregexp","anyOf":[{"type":"string","minLength":1},{"instanceof":"RegExp"}]},"getLocalIdent":{"description":"Allows to specify a function to generate the classname.","link":"https://github.com/webpack/css-loader#getlocalident","instanceof":"Function"},"namedExport":{"description":"Enables/disables ES modules named export for locals.","link":"https://github.com/webpack/css-loader#namedexport","type":"boolean"},"exportGlobals":{"description":"Allows to export names from global class or id, so you can use that as local name.","link":"https://github.com/webpack/css-loader#exportglobals","type":"boolean"},"exportLocalsConvention":{"description":"Style of exported classnames.","link":"https://github.com/webpack/css-loader#localsconvention","anyOf":[{"enum":["asIs","as-is","camelCase","camel-case","camelCaseOnly","camel-case-only","dashes","dashesOnly","dashes-only"]},{"instanceof":"Function"}]},"exportOnlyLocals":{"description":"Export only locals.","link":"https://github.com/webpack/css-loader#exportonlylocals","type":"boolean"},"getJSON":{"description":"Allows outputting of CSS modules mapping through a callback.","link":"https://github.com/webpack/css-loader#getJSON","instanceof":"Function"}}}]},"sourceMap":{"description":"Allows to enable/disable source maps.","link":"https://github.com/webpack/css-loader#sourcemap","type":"boolean"},"importLoaders":{"description":"Allows enables/disables or setups number of loaders applied before CSS loader for `@import`/CSS Modules and ICSS imports.","link":"https://github.com/webpack/css-loader#importloaders","anyOf":[{"type":"boolean"},{"type":"string"},{"type":"integer"}]},"esModule":{"description":"Use the ES modules syntax.","link":"https://github.com/webpack/css-loader#esmodule","type":"boolean"},"exportType":{"description":"Allows exporting styles as array with modules, string or constructable stylesheet (i.e. `CSSStyleSheet`).","link":"https://github.com/webpack/css-loader#exporttype","enum":["array","string","css-style-sheet"]}},"type":"object"}',
8093
8102
  );
8094
8103
  },
8095
8104
  444: (module) => {
@@ -8121,6 +8130,6 @@
8121
8130
  }
8122
8131
  if (typeof __nccwpck_require__ !== "undefined")
8123
8132
  __nccwpck_require__.ab = __dirname + "/";
8124
- var __webpack_exports__ = __nccwpck_require__(588);
8133
+ var __webpack_exports__ = __nccwpck_require__(5788);
8125
8134
  module.exports = __webpack_exports__;
8126
8135
  })();
@@ -1 +1 @@
1
- {"name":"css-loader","author":"Tobias Koppers @sokra","version":"7.1.2","funding":{"type":"opencollective","url":"https://opencollective.com/webpack"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"css-loader","author":"Tobias Koppers @sokra","version":"7.1.3","funding":{"type":"opencollective","url":"https://opencollective.com/webpack"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
@@ -1,16 +1,16 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 392: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(590)["default"];
4
+ 265: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(939)["default"];
6
6
  },
7
- 590: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 939: (__unused_webpack_module, exports, __nccwpck_require__) => {
8
8
  var __webpack_unused_export__;
9
9
  __webpack_unused_export__ = { value: true };
10
10
  exports["default"] = void 0;
11
11
  var _path = _interopRequireDefault(__nccwpck_require__(928));
12
- var _options = _interopRequireDefault(__nccwpck_require__(460));
13
- var _utils = __nccwpck_require__(383);
12
+ var _options = _interopRequireDefault(__nccwpck_require__(601));
13
+ var _utils = __nccwpck_require__(174);
14
14
  function _interopRequireDefault(e) {
15
15
  return e && e.__esModule ? e : { default: e };
16
16
  }
@@ -112,7 +112,7 @@
112
112
  }
113
113
  var _default = (exports["default"] = lessLoader);
114
114
  },
115
- 383: (__unused_webpack_module, exports, __nccwpck_require__) => {
115
+ 174: (__unused_webpack_module, exports, __nccwpck_require__) => {
116
116
  Object.defineProperty(exports, "__esModule", { value: true });
117
117
  exports.errorFactory = errorFactory;
118
118
  exports.getLessImplementation = getLessImplementation;
@@ -312,7 +312,7 @@
312
312
  928: (module) => {
313
313
  module.exports = require("path");
314
314
  },
315
- 460: (module) => {
315
+ 601: (module) => {
316
316
  module.exports = JSON.parse(
317
317
  '{"title":"Less Loader options","type":"object","properties":{"lessOptions":{"description":"Options to pass through to `Less`.","link":"https://github.com/webpack-contrib/less-loader#lessoptions","anyOf":[{"type":"object","additionalProperties":true},{"instanceof":"Function"}]},"additionalData":{"description":"Prepends/Appends `Less` code to the actual entry file.","link":"https://github.com/webpack-contrib/less-loader#additionalData","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/less-loader#sourcemap","type":"boolean"},"webpackImporter":{"description":"Enables/Disables default `webpack` importer.","link":"https://github.com/webpack-contrib/less-loader#webpackimporter","anyOf":[{"type":"boolean"},{"type":"string","enum":["only"]}]},"implementation":{"description":"The implementation of the `Less` to be used.","link":"https://github.com/webpack-contrib/less-loader#implementation","anyOf":[{"type":"string"},{"type":"object"}]},"lessLogAsWarnOrErr":{"description":"Less warnings and errors will be webpack warnings or errors.","link":"https://github.com/webpack-contrib/less-loader#lesslogaswarnorerr","type":"boolean"}},"additionalProperties":false}',
318
318
  );
@@ -340,6 +340,6 @@
340
340
  }
341
341
  if (typeof __nccwpck_require__ !== "undefined")
342
342
  __nccwpck_require__.ab = __dirname + "/";
343
- var __webpack_exports__ = __nccwpck_require__(392);
343
+ var __webpack_exports__ = __nccwpck_require__(265);
344
344
  module.exports = __webpack_exports__;
345
345
  })();
@@ -5319,19 +5319,19 @@
5319
5319
  module.exports = createColors();
5320
5320
  module.exports.createColors = createColors;
5321
5321
  },
5322
- 1678: (module, __unused_webpack_exports, __nccwpck_require__) => {
5322
+ 6725: (module, __unused_webpack_exports, __nccwpck_require__) => {
5323
5323
  "use strict";
5324
- module.exports = __nccwpck_require__(4)["default"];
5324
+ module.exports = __nccwpck_require__(3103)["default"];
5325
5325
  },
5326
- 4: (__unused_webpack_module, exports, __nccwpck_require__) => {
5326
+ 3103: (__unused_webpack_module, exports, __nccwpck_require__) => {
5327
5327
  "use strict";
5328
5328
  var __webpack_unused_export__;
5329
5329
  __webpack_unused_export__ = { value: true };
5330
5330
  exports["default"] = loader;
5331
5331
  var _nodePath = _interopRequireDefault(__nccwpck_require__(6760));
5332
5332
  var _package = _interopRequireDefault(__nccwpck_require__(444));
5333
- var _options = _interopRequireDefault(__nccwpck_require__(5288));
5334
- var _utils = __nccwpck_require__(2829);
5333
+ var _options = _interopRequireDefault(__nccwpck_require__(8699));
5334
+ var _utils = __nccwpck_require__(8458);
5335
5335
  function _interopRequireDefault(e) {
5336
5336
  return e && e.__esModule ? e : { default: e };
5337
5337
  }
@@ -5509,7 +5509,7 @@
5509
5509
  callback(null, result.css, map, { ast });
5510
5510
  }
5511
5511
  },
5512
- 2829: (module, exports, __nccwpck_require__) => {
5512
+ 8458: (module, exports, __nccwpck_require__) => {
5513
5513
  "use strict";
5514
5514
  module = __nccwpck_require__.nmd(module);
5515
5515
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6617,7 +6617,7 @@
6617
6617
  return keywords.has(word);
6618
6618
  }
6619
6619
  },
6620
- 5288: (module) => {
6620
+ 8699: (module) => {
6621
6621
  "use strict";
6622
6622
  module.exports = JSON.parse(
6623
6623
  '{"title":"PostCSS Loader options","type":"object","properties":{"postcssOptions":{"description":"Options to pass through to `Postcss`.","link":"https://github.com/webpack-contrib/postcss-loader#postcssOptions","anyOf":[{"type":"object","additionalProperties":true,"properties":{"config":{"description":"Allows to specify PostCSS config path.","link":"https://github.com/webpack-contrib/postcss-loader#config","anyOf":[{"description":"Allows to specify the path to the configuration file","type":"string"},{"description":"Enables/Disables autoloading config","type":"boolean"}]}}},{"instanceof":"Function"}]},"execute":{"description":"Enables/Disables PostCSS parser support in \'CSS-in-JS\'.","link":"https://github.com/webpack-contrib/postcss-loader#execute","type":"boolean"},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/postcss-loader#sourcemap","type":"boolean"},"implementation":{"description":"The implementation of postcss to use, instead of the locally installed version","link":"https://github.com/webpack-contrib/postcss-loader#implementation","anyOf":[{"type":"string"},{"instanceof":"Function"}]}},"additionalProperties":false}',
@@ -6727,6 +6727,6 @@
6727
6727
  })();
6728
6728
  if (typeof __nccwpck_require__ !== "undefined")
6729
6729
  __nccwpck_require__.ab = __dirname + "/";
6730
- var __webpack_exports__ = __nccwpck_require__(1678);
6730
+ var __webpack_exports__ = __nccwpck_require__(6725);
6731
6731
  module.exports = __webpack_exports__;
6732
6732
  })();
@@ -4795,19 +4795,19 @@
4795
4795
  }
4796
4796
  });
4797
4797
  },
4798
- 308: (module, __unused_webpack_exports, __nccwpck_require__) => {
4798
+ 477: (module, __unused_webpack_exports, __nccwpck_require__) => {
4799
4799
  "use strict";
4800
- const loader = __nccwpck_require__(34);
4800
+ const loader = __nccwpck_require__(431);
4801
4801
  module.exports = loader.default;
4802
4802
  },
4803
- 34: (__unused_webpack_module, exports, __nccwpck_require__) => {
4803
+ 431: (__unused_webpack_module, exports, __nccwpck_require__) => {
4804
4804
  "use strict";
4805
4805
  Object.defineProperty(exports, "__esModule", { value: true });
4806
4806
  exports["default"] = void 0;
4807
4807
  var _nodePath = _interopRequireDefault(__nccwpck_require__(760));
4808
4808
  var _nodeUrl = _interopRequireDefault(__nccwpck_require__(136));
4809
- var _options = _interopRequireDefault(__nccwpck_require__(28));
4810
- var _utils = __nccwpck_require__(115);
4809
+ var _options = _interopRequireDefault(__nccwpck_require__(985));
4810
+ var _utils = __nccwpck_require__(522);
4811
4811
  function _interopRequireDefault(e) {
4812
4812
  return e && e.__esModule ? e : { default: e };
4813
4813
  }
@@ -4914,7 +4914,7 @@
4914
4914
  }
4915
4915
  var _default = (exports["default"] = loader);
4916
4916
  },
4917
- 115: (__unused_webpack_module, exports, __nccwpck_require__) => {
4917
+ 522: (__unused_webpack_module, exports, __nccwpck_require__) => {
4918
4918
  "use strict";
4919
4919
  Object.defineProperty(exports, "__esModule", { value: true });
4920
4920
  exports.errorFactory = errorFactory;
@@ -5568,7 +5568,7 @@
5568
5568
  "use strict";
5569
5569
  module.exports = require("sass");
5570
5570
  },
5571
- 28: (module) => {
5571
+ 985: (module) => {
5572
5572
  "use strict";
5573
5573
  module.exports = JSON.parse(
5574
5574
  '{"title":"Sass Loader options","type":"object","properties":{"implementation":{"description":"The implementation of the sass to be used.","link":"https://github.com/webpack/sass-loader#implementation","anyOf":[{"type":"string"},{"type":"object"}]},"api":{"description":"Switch between old and modern API for `sass` (`Dart Sass`) and `Sass Embedded` implementations.","link":"https://github.com/webpack/sass-loader#sassoptions","enum":["legacy","modern","modern-compiler"]},"sassOptions":{"description":"Options for `node-sass` or `sass` (`Dart Sass`) implementation.","link":"https://github.com/webpack/sass-loader#sassoptions","anyOf":[{"type":"object","additionalProperties":true},{"instanceof":"Function"}]},"additionalData":{"description":"Prepends/Appends `Sass`/`SCSS` code before the actual entry file.","link":"https://github.com/webpack/sass-loader#additionaldata","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack/sass-loader#sourcemap","type":"boolean"},"webpackImporter":{"description":"Enables/Disables default `webpack` importer.","link":"https://github.com/webpack/sass-loader#webpackimporter","type":"boolean"},"warnRuleAsWarning":{"description":"Treats the \'@warn\' rule as a webpack warning.","link":"https://github.com/webpack/sass-loader#warnruleaswarning","type":"boolean"}},"additionalProperties":false}',
@@ -5598,6 +5598,6 @@
5598
5598
  }
5599
5599
  if (typeof __nccwpck_require__ !== "undefined")
5600
5600
  __nccwpck_require__.ab = __dirname + "/";
5601
- var __webpack_exports__ = __nccwpck_require__(308);
5601
+ var __webpack_exports__ = __nccwpck_require__(477);
5602
5602
  module.exports = __webpack_exports__;
5603
5603
  })();
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import node_path, { dirname as __rspack_dirname, join, sep } from "node:path";
6
6
  import * as __rspack_external__compiled_launch_editor_index_js_29002383 from "../compiled/launch-editor/index.js";
7
7
  import * as __rspack_external__compiled_webpack_merge_index_js_efd91626 from "../compiled/webpack-merge/index.js";
8
8
  import { __webpack_require__ } from "./rslib-runtime.js";
9
- import { rspack } from "@rspack/core";
9
+ import { Compilation, rspack } from "@rspack/core";
10
10
  import cac from "cac";
11
11
  import node_fs from "node:fs";
12
12
  import node_readline from "node:readline";
@@ -17,6 +17,8 @@ import { format, promisify } from "node:util";
17
17
  import { TraceMap, originalPositionFor } from "@jridgewell/trace-mapping";
18
18
  import { parse } from "stacktrace-parser";
19
19
  import node_zlib from "node:zlib";
20
+ import { createHash } from "node:crypto";
21
+ import magic_string from "magic-string";
20
22
  import { expand } from "dotenv-expand";
21
23
  import node_assert from "node:assert";
22
24
  import { RspackDevServer } from "@rspack/dev-server";
@@ -476,7 +478,7 @@ let removeDir = (dir)=>{
476
478
  currentUnpackConfig = config;
477
479
  }, unpackStartTime = 0, getUnpackStartTime = ()=>unpackStartTime, setUnpackStartTime = (time)=>{
478
480
  unpackStartTime = time;
479
- }, STYLE_IMPORT_RE = /import\s+([\s\S]+?)\s+from\s+(['"])(.*?\.(?:css|less|scss|sass))\2/g, TYPE_IMPORT_CLAUSE_RE = /^\s*type\b/, STYLE_EXT_HINTS = [
481
+ }, STYLE_IMPORT_RE = /import\s+((?:(?!\nimport\s)[\s\S])*?)\s+from\s+(['"])([^'"]+?\.(?:css|less|scss|sass)(?:\?[^'"]+)?(?:#[^'"]+)?)\2/g, TYPE_IMPORT_CLAUSE_RE = /^\s*type\b/, STYLE_EXT_HINTS = [
480
482
  '.css',
481
483
  '.less',
482
484
  '.scss',
@@ -524,7 +526,7 @@ let COMPRESSIBLE_REGEX = /\.(?:js|css|html|json|svg|txt|xml|xhtml|wasm|manifest|
524
526
  'react-router-dom': 'ReactRouterDOM'
525
527
  };
526
528
  return externalAlias[pkgName] ? externalAlias[pkgName] : pkgName.replace(/^@/, '').split(/[/\-.]/).filter(Boolean).map((part)=>part.charAt(0).toUpperCase() + part.slice(1)).join('');
527
- }, getExternalValue = (pkgName)=>`window ${getExternalLibraryName(pkgName)}`, REGISTER_ID = 'virtual-svg-icons-register', NAMES_ID = 'virtual-svg-icons-names', normalizeSvg = (content)=>content.replace(/<\?xml[\s\S]*?\?>/gi, '').replace(/<!DOCTYPE[\s\S]*?>/gi, '').replace(/<!--[\s\S]*?-->/g, '').trim(), extractSvgContent = (content)=>{
529
+ }, getExternalValue = (pkgName)=>`window ${getExternalLibraryName(pkgName)}`, normalizeSvg = (content)=>content.replace(/<\?xml[\s\S]*?\?>/gi, '').replace(/<!DOCTYPE[\s\S]*?>/gi, '').replace(/<!--[\s\S]*?-->/g, '').trim(), extractSvgContent = (content)=>{
528
530
  let match = content.match(/<svg\b([^>]*)>/i), viewBoxMatch = match?.[1]?.match(/viewBox\s*=\s*["']([^"']+)["']/i);
529
531
  return {
530
532
  inner: content.replace(/^[\s\S]*?<svg\b[^>]*>/i, '').replace(/<\/svg>[\s\S]*$/i, '').trim(),
@@ -544,10 +546,39 @@ let COMPRESSIBLE_REGEX = /\.(?:js|css|html|json|svg|txt|xml|xhtml|wasm|manifest|
544
546
  if ('function' == typeof symbolId) return symbolId(name, filePath);
545
547
  let id = (symbolId || 'icon-[dir]-[name]').replace(/\[name\]/g, name).replace(/\[dir\]/g, dir);
546
548
  return id.replace(/--+/g, '-').replace(/^-+|-+$/g, '');
549
+ }, UNOCSS_CONFIG_FILES = [
550
+ 'unocss.config.mjs',
551
+ 'unocss.config.ts',
552
+ 'unocss.config.js',
553
+ 'unocss.config.mts',
554
+ 'uno.config.mjs',
555
+ 'uno.config.ts',
556
+ 'uno.config.js',
557
+ 'uno.config.mts'
558
+ ], loadConfigFile = async (configFilePath)=>{
559
+ if (/\.(?:js|mjs)$/.test(configFilePath)) {
560
+ let configFileURL = pathToFileURL(configFilePath).href, exportModule = await import(`${configFileURL}?t=${Date.now()}`);
561
+ return exportModule.default ? exportModule.default : exportModule;
562
+ }
563
+ let { createJiti } = await import("jiti"), jiti = createJiti(import.meta.url, {
564
+ moduleCache: !1,
565
+ interopDefault: !0,
566
+ nativeModules: [
567
+ '@rspack/core',
568
+ "typescript"
569
+ ]
570
+ });
571
+ return await jiti.import(configFilePath, {
572
+ default: !0
573
+ });
574
+ }, LAYER_MARK_ALL = '__ALL__', HASH_PLACEHOLDER_RE = /#--unocss-hash--\s*\{\s*content\s*:\s*\\*"([^\\"]+)\\*";?\s*\}/g, LAYER_PLACEHOLDER_RE = /#--unocss--\s*\{\s*layer\s*:\s*(.+?)\s*(?:;\s*escape-view\s*:\s*(.+?)\s*)?;?\s*\}/g, SKIP_START_COMMENT = '@unocss-skip-start', SKIP_END_COMMENT = '@unocss-skip-end', SKIP_COMMENT_RE = RegExp(`(?://\\s*?${SKIP_START_COMMENT}\\s*?|/\\*\\s*?${SKIP_START_COMMENT}\\s*?\\*/|<!--\\s*?${SKIP_START_COMMENT}\\s*?-->)[\\s\\S]*?(?://\\s*?${SKIP_END_COMMENT}\\s*?|/\\*\\s*?${SKIP_END_COMMENT}\\s*?\\*/|<!--\\s*?${SKIP_END_COMMENT}\\s*?-->)`, 'g'), getCssEscaperForJsContent = (view)=>{
575
+ if (!view) return (css)=>css;
576
+ let prefix = {};
577
+ return view.trim().replace(/(\\*)\\(["'`\\])/g, (_, bs, char)=>(prefix[char] = bs.replace(/\\\\/g, '\\'), '')), (css)=>css.replace(/["'`\\]/g, (v)=>(prefix[v] || '') + v);
547
578
  }, DOTENV_LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
548
579
  function getNormalizedPluginsByHook(hook) {
549
580
  let pluginMap = new Map();
550
- return (getCurrentUnpackConfig().plugins?.flat(1 / 0) || []).forEach((plugin)=>{
581
+ (getCurrentUnpackConfig().plugins?.flat(1 / 0) || []).forEach((plugin)=>{
551
582
  plugin && ((plugin, hook)=>{
552
583
  if (!plugin[hook]) return !1;
553
584
  let apply = plugin.apply;
@@ -558,12 +589,60 @@ function getNormalizedPluginsByHook(hook) {
558
589
  };
559
590
  return 'string' == typeof apply ? apply === env.command : !!apply(getCurrentUnpackConfig(), env);
560
591
  })(plugin, hook) && pluginMap.set(plugin.name, plugin);
561
- }), Array.from(pluginMap.values());
592
+ });
593
+ let normalizedPlugins = Array.from(pluginMap.values()), enforceOrder = (plugin)=>'pre' === plugin.enforce ? 0 : 'post' === plugin.enforce ? 2 : 1;
594
+ return normalizedPlugins.map((plugin, index)=>({
595
+ plugin,
596
+ index
597
+ })).sort((a, b)=>{
598
+ let diff = enforceOrder(a.plugin) - enforceOrder(b.plugin);
599
+ return 0 !== diff ? diff : a.index - b.index;
600
+ }).map((item)=>item.plugin);
562
601
  }
602
+ let createPluginHookTimer = (plugin, hook)=>{
603
+ let startTime = 0;
604
+ return {
605
+ start: ()=>{
606
+ startTime = performance.now();
607
+ },
608
+ end: ()=>{
609
+ let duration = performance.now() - startTime;
610
+ logger_logger.debug(`${colors.magenta('[plugin]')} ${colors.cyan(plugin.name)} ${colors.blue(hook)} ${colors.dim('in')} ${colors.yellow(`${duration.toFixed(2)}ms`)}`);
611
+ }
612
+ };
613
+ }, TRANSFORM_TIMING_STORE = Symbol.for('unpack:transformTimingMap'), globalScope = globalThis, transformTimingMap = globalScope[TRANSFORM_TIMING_STORE] ?? new WeakMap();
563
614
  async function applyPluginsByHook(hook, runner) {
615
+ let shouldMeasure = 'processAssets' !== hook && 'transform' !== hook;
564
616
  for (let plugin of getNormalizedPluginsByHook(hook)){
565
617
  let impl = plugin[hook];
566
- await runner(impl);
618
+ if (!shouldMeasure) {
619
+ await runner(impl, plugin);
620
+ continue;
621
+ }
622
+ let timer = createPluginHookTimer(plugin, hook);
623
+ timer.start();
624
+ try {
625
+ await runner(impl, plugin);
626
+ } finally{
627
+ timer.end();
628
+ }
629
+ }
630
+ }
631
+ function applyPluginsByHookSync(hook, runner) {
632
+ let shouldMeasure = 'processAssets' !== hook && 'transform' !== hook;
633
+ for (let plugin of getNormalizedPluginsByHook(hook)){
634
+ let impl = plugin[hook];
635
+ if (!shouldMeasure) {
636
+ runner(impl, plugin);
637
+ continue;
638
+ }
639
+ let timer = createPluginHookTimer(plugin, hook);
640
+ timer.start();
641
+ try {
642
+ runner(impl, plugin);
643
+ } finally{
644
+ timer.end();
645
+ }
567
646
  }
568
647
  }
569
648
  async function applyBuildAnalyzeConfig({ config, unpackConfig }) {
@@ -622,6 +701,7 @@ async function applyCacheConfig({ config, unpackConfig, envFilePaths }) {
622
701
  }
623
702
  });
624
703
  }
704
+ globalScope[TRANSFORM_TIMING_STORE] = transformTimingMap;
625
705
  let MODULE_PATH_REGEX = /.*[\\/]node_modules[\\/](?!\.pnpm[\\/])(?:(@[^\\/]+)[\\/])?([^\\/]+)/, SPLIT_STRATEGY_DISPATCHER = {
626
706
  'split-by-module': function(ctx) {
627
707
  let { forceSplittingGroups, defaultConfig } = ctx;
@@ -750,7 +830,7 @@ class JsMinifyPlugin {
750
830
  apply(compiler) {
751
831
  let meta = JSON.stringify({
752
832
  name: jsMinify_PLUGIN_NAME,
753
- version: "4.1.0",
833
+ version: "4.2.0",
754
834
  options: this.minifyOptions
755
835
  });
756
836
  compiler.hooks.compilation.tap(jsMinify_PLUGIN_NAME, (compilation)=>{
@@ -853,15 +933,15 @@ async function compileDone(compiler, stats) {
853
933
  if (!fileInfo) return;
854
934
  if (fileInfo === lastFileInfo ? sameCount++ : (lastFileInfo = fileInfo, sameCount = 1), isDebug()) {
855
935
  var modules;
856
- let nodeModulesStats, nodeModulesPath;
857
- Object.entries((modules = stats.compilation.modules, nodeModulesStats = {}, nodeModulesPath = node_path.resolve(root, 'node_modules'), modules.forEach((module)=>{
936
+ let nodeModulesStats, nodeModulesPath, sortedStats;
937
+ (sortedStats = Object.entries((modules = stats.compilation.modules, nodeModulesStats = {}, nodeModulesPath = node_path.resolve(root, 'node_modules'), modules.forEach((module)=>{
858
938
  let { resource } = module;
859
939
  if (resource?.includes(nodeModulesPath)) {
860
940
  let packageName, pathParts = node_path.relative(nodeModulesPath, resource).split(sep);
861
941
  (packageName = '.pnpm' === pathParts[0] && pathParts.length >= 4 ? pathParts[3].startsWith('@') ? `${pathParts[3]}/${pathParts[4]}` : pathParts[3] : pathParts[0].startsWith('@') ? `${pathParts[0]}/${pathParts[1]}` : pathParts[0]) && (nodeModulesStats[packageName] = (nodeModulesStats[packageName] || 0) + 1);
862
942
  }
863
- }), nodeModulesStats)).sort((a, b)=>a[1] - b[1]).forEach(([packageName, count])=>{
864
- count > 10 && logger_logger.debug(`${colors.cyan(packageName)}: ${colors.yellow(count)} modules`);
943
+ }), nodeModulesStats)).sort((a, b)=>a[1] - b[1])).forEach(([packageName, count], i)=>{
944
+ i >= sortedStats.length - 10 && logger_logger.debug(`[dependency] ${colors.cyan(packageName)}: ${colors.yellow(count)} modules`);
865
945
  });
866
946
  }
867
947
  isDebug() || logger_logger.clear(), console.log(colors.dim(getTime()), colors.cyan(`[${getCurrentUnpackConfig()._context.callerName}]`), colors.brand(utils_isDevServer() ? 'hmr update' : 'build'), `${colors.dim(fileInfo)}${sameCount > 1 ? ` ${colors.yellow(`(x${sameCount})`)}` : ''}`, isDebug() ? colors.dim(`| ${prettyTime(getCompileTime(stats))} (${stats.compilation.modules.size} modules)`) : '');
@@ -895,7 +975,8 @@ let registerHooks_PLUGIN_NAME = 'RegisterHooksPlugin';
895
975
  class RegisterHooksPlugin {
896
976
  isFirstCompile = !0;
897
977
  apply(compiler) {
898
- compiler.hooks.beforeCompile.tapPromise(registerHooks_PLUGIN_NAME, async ()=>{
978
+ let virtualModulesPlugin = new rspack.experiments.VirtualModulesPlugin();
979
+ virtualModulesPlugin.apply(compiler), compiler.hooks.beforeCompile.tapPromise(registerHooks_PLUGIN_NAME, async ()=>{
899
980
  await applyPluginsByHook('buildStart', async (impl)=>{
900
981
  await impl({
901
982
  compiler,
@@ -904,18 +985,54 @@ class RegisterHooksPlugin {
904
985
  });
905
986
  });
906
987
  }), compiler.hooks.done.tapPromise(registerHooks_PLUGIN_NAME, async (stats)=>{
907
- await applyPluginsByHook('buildEnd', async (impl)=>{
908
- await impl({
909
- compiler,
910
- isFirstCompile: this.isFirstCompile,
911
- isWatch: isWatch(),
912
- stats
988
+ try {
989
+ await applyPluginsByHook('buildEnd', async (impl)=>{
990
+ await impl({
991
+ compiler,
992
+ isFirstCompile: this.isFirstCompile,
993
+ isWatch: isWatch(),
994
+ stats
995
+ });
913
996
  });
914
- }), this.isFirstCompile = !1;
997
+ } finally{
998
+ stats?.compilation && ((compilation)=>{
999
+ let pluginMap = transformTimingMap.get(compilation);
1000
+ if (pluginMap) {
1001
+ for (let [pluginName, total] of pluginMap)logger_logger.debug(`${colors.magenta('[plugin]')} ${colors.cyan(pluginName)} ${colors.blue('transform')} ${colors.dim('in')} ${colors.yellow(`${total.toFixed(2)}ms`)}`);
1002
+ transformTimingMap.delete(compilation);
1003
+ }
1004
+ })(stats.compilation);
1005
+ }
1006
+ this.isFirstCompile = !1;
915
1007
  }), compiler.hooks.compilation.tap(registerHooks_PLUGIN_NAME, (compilation)=>{
916
1008
  rspack.HtmlRspackPlugin.getCompilationHooks(compilation).beforeEmit.tapPromise(registerHooks_PLUGIN_NAME, async (data)=>(await applyPluginsByHook('transformHtml', async (impl)=>{
917
1009
  data.html = await impl(data.html);
918
1010
  }), data));
1011
+ }), compiler.hooks.thisCompilation.tap(registerHooks_PLUGIN_NAME, (compilation)=>{
1012
+ applyPluginsByHookSync('virtualModules', (impl)=>{
1013
+ Object.entries(impl()).forEach(([path, content])=>{
1014
+ virtualModulesPlugin.writeModule(path, content);
1015
+ });
1016
+ }), applyPluginsByHook('processAssets', (impl, plugin)=>{
1017
+ let { stage, handler } = impl;
1018
+ compilation.hooks.processAssets.tapPromise({
1019
+ name: registerHooks_PLUGIN_NAME,
1020
+ stage
1021
+ }, async (assets)=>{
1022
+ let timer = createPluginHookTimer(plugin, 'processAssets');
1023
+ timer.start();
1024
+ try {
1025
+ await handler({
1026
+ assets,
1027
+ compilation,
1028
+ sources: rspack.sources,
1029
+ compiler
1030
+ });
1031
+ } finally{
1032
+ timer.end();
1033
+ }
1034
+ });
1035
+ });
919
1036
  });
920
1037
  }
921
1038
  }
@@ -976,14 +1093,14 @@ async function getBundlerConfig(originalUnpackConfig) {
976
1093
  `.env.${mode}`,
977
1094
  `.env.${mode}.local`
978
1095
  ].map((filename)=>join(cwd, filename)).filter(isFileSync), parsed = {};
979
- for (let envPath of filePaths)Object.assign(parsed, function(src) {
1096
+ for (let envPath of filePaths)logger_logger.debug('loading env file:', colors.dim(envPath)), Object.assign(parsed, function(src) {
980
1097
  let match, obj = {}, lines = src.toString();
981
1098
  for(lines = lines.replace(/\r\n?/gm, '\n'); null != (match = DOTENV_LINE.exec(lines));){
982
1099
  let key = match[1], value = match[2] || '', maybeQuote = (value = value.trim())[0];
983
1100
  value = value.replace(/^(['"`])([\s\S]*)\1$/gm, '$2'), '"' === maybeQuote && (value = (value = value.replace(/\\n/g, '\n')).replace(/\\r/g, '\r')), obj[key] = value;
984
1101
  }
985
1102
  return obj;
986
- }(node_fs.readFileSync(envPath))), logger_logger.debug('loaded env file:', envPath);
1103
+ }(node_fs.readFileSync(envPath)));
987
1104
  parsed.NODE_ENV && (processEnv.NODE_ENV = parsed.NODE_ENV), expand({
988
1105
  parsed,
989
1106
  processEnv
@@ -1141,9 +1258,9 @@ async function getBundlerConfig(originalUnpackConfig) {
1141
1258
  hints: !1
1142
1259
  }
1143
1260
  };
1144
- for (let plugin of getNormalizedPluginsByHook('transform')){
1145
- let { filter, handler } = plugin.transform;
1146
- config.module.rules.push({
1261
+ return applyPluginsByHookSync('transform', (impl, plugin)=>{
1262
+ let { filter, handler } = impl;
1263
+ config.module.rules.unshift({
1147
1264
  exclude: NODE_MODULES_REGEX,
1148
1265
  ...filter,
1149
1266
  enforce: 'pre',
@@ -1151,13 +1268,13 @@ async function getBundlerConfig(originalUnpackConfig) {
1151
1268
  {
1152
1269
  loader: node_path.resolve(bundler_config_dirname, './transformLoader.js'),
1153
1270
  options: {
1154
- handler
1271
+ handler,
1272
+ pluginName: plugin.name
1155
1273
  }
1156
1274
  }
1157
1275
  ]
1158
1276
  });
1159
- }
1160
- return config = (({ config, unpackConfig })=>{
1277
+ }), config = (({ config, unpackConfig })=>{
1161
1278
  let { chunkSplit } = unpackConfig.performance || {};
1162
1279
  if (chunkSplit?.strategy) {
1163
1280
  let forceSplittingGroups = {};
@@ -1588,7 +1705,7 @@ async function unpackDev(unpackConfig) {
1588
1705
  ...middlewares
1589
1706
  ]);
1590
1707
  let server = new RspackDevServer(devServerOptions, compiler);
1591
- await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v4.1.0${unpackConfig.performance?.cache ? ' ϟ' : ''}`)} ${colors.dim('ready in')} ${colors.bold(Math.ceil(performance.now() - getUnpackStartTime()))} ${colors.dim('ms')}\n`), printServerUrls({
1708
+ await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v4.2.0`)} ${colors.dim('ready in')} ${colors.bold(Math.ceil(performance.now() - getUnpackStartTime()))} ${colors.dim('ms')}\n`), printServerUrls({
1592
1709
  port,
1593
1710
  host: unpackConfig.server.host,
1594
1711
  base: unpackConfig.base
@@ -1602,11 +1719,10 @@ async function unpackDev(unpackConfig) {
1602
1719
  function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'unpack' }) {
1603
1720
  let _context = {
1604
1721
  callerName,
1605
- version: "4.1.0",
1722
+ version: "4.2.0",
1606
1723
  cachePath: 'node_modules/.unpack'
1607
1724
  }, resolveConfig = (mode)=>{
1608
- var options;
1609
- let rootPath, outputPath, basePath, cachedTraceMap, fs, isValidMethodName, parseFrame, formatOriginalLocation, formatFullStack, resolveErrorLocationAndStack, shouldTransformDeepImport, preJsAssets, jsAssets, cssAssets, bundledDepsCachePath, deepImportPkgPattern, deepImportRegex, plugin, root, rootPath1, inject, domId, registerCode, namesCode, virtualModules, ensureVirtualModules, mergedConfig = utils_mergeConfig({
1725
+ let rootPath, outputPath, basePath, cachedTraceMap, fs, isValidMethodName, parseFrame, formatOriginalLocation, formatFullStack, resolveErrorLocationAndStack, shouldTransformDeepImport, preJsAssets, jsAssets, cssAssets, bundledDepsCachePath, deepImportPkgPattern, deepImportRegex, plugin, root, uno, configFilePath, configOrPathFromUnpackConfig, defaultsFromUnpackConfig, compilerRef, VIRTUAL_UNO_CSS_ID, rootDir, unoConfig, tokens, tasks, requestedLayers, layerImportRE, ensureReady, invalidate, flushTasks, getVirtualLayerId, getVirtualModuleContent, hash, restoreSkipCode, applyUnoTransformers, getResolvedLayers, optionsFromUnpackConfig, rootPath1, registerCode, namesCode, defaultConfig = {
1610
1726
  root: cwd,
1611
1727
  base: '/',
1612
1728
  sourceMap: 'production' !== mode && 'cheap-module-source-map',
@@ -1643,7 +1759,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
1643
1759
  name: 'unpack:auto-css-modules',
1644
1760
  transform: {
1645
1761
  filter: {
1646
- test: JSX_REGEX
1762
+ test: /\.(?:[jt]sx|vue)$/
1647
1763
  },
1648
1764
  handler: (code)=>STYLE_EXT_HINTS.some((ext)=>code.includes(ext)) ? code.replace(STYLE_IMPORT_RE, (full, importClause, quote, spec)=>TYPE_IMPORT_CLAUSE_RE.test(importClause) || spec.includes('?') || spec.includes('#') ? full : `import ${importClause} from ${quote}${spec}?module${quote}`) : null
1649
1765
  }
@@ -2328,52 +2444,172 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
2328
2444
  let log = colors.blue('Total'.padEnd(longest + 2));
2329
2445
  log += colors.blue(displaySize(totalSize)), console.log(log += colors.dim(` │ gzip: ${displaySize(totalCompressedSize)}`));
2330
2446
  }
2331
- })
2332
- ]
2333
- }, userConfig);
2334
- return mergedConfig.svgIcons && mergedConfig.plugins?.push((options = mergedConfig.svgIcons, rootPath1 = '', inject = options.inject || 'body-last', domId = options.customDomId || '__svg__icons__dom__', registerCode = '', namesCode = '', virtualModules = null, ensureVirtualModules = ()=>{
2335
- let root;
2336
- if (!rootPath1) return;
2337
- let { svg, names } = ((iconDirs, symbolId, customDomId)=>{
2338
- let symbols = [], names = [], idSet = new Set();
2339
- for (let dir of iconDirs)for (let file of readSvgFiles(dir)){
2340
- let { inner, viewBox } = extractSvgContent(normalizeSvg(node_fs.readFileSync(file, 'utf-8'))), id = toSymbolId(file, dir, symbolId);
2341
- !id || idSet.has(id) || (idSet.add(id), names.push(id), symbols.push(`<symbol id="${id}"${viewBox ? ` viewBox="${viewBox}"` : ''}>${inner}</symbol>`));
2342
- }
2343
- return {
2344
- svg: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="${customDomId}" style="position: absolute; width: 0; height: 0" aria-hidden="true">${symbols.join('')}</svg>`,
2345
- names
2346
- };
2347
- })((root = rootPath1, (options.iconDirs || []).map((dir)=>node_path.isAbsolute(dir) ? dir : node_path.resolve(root, dir))), options.symbolId, domId);
2348
- registerCode = `const svgDomId = ${JSON.stringify(domId)}\nconst svgHtml = ${JSON.stringify(svg)}\nconst inject = (position) => {\n if (typeof document === 'undefined') return\n if (document.getElementById(svgDomId)) return\n const div = document.createElement('div')\n div.innerHTML = svgHtml\n const svgEl = div.firstElementChild\n if (!svgEl) return\n if (position === 'head' && document.head) {\n document.head.prepend(svgEl)\n return\n }\n const body = document.body\n if (!body) return\n if (position === 'body-first' && body.firstChild) {\n body.insertBefore(svgEl, body.firstChild)\n } else {\n body.appendChild(svgEl)\n }\n}\nconst mount = () => inject(${JSON.stringify(inject)})\nif (typeof document !== 'undefined') {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', mount)\n } else {\n mount()\n }\n}\nexport default mount`, namesCode = `export const svgIconNames = ${JSON.stringify(names)}\nexport default svgIconNames`;
2349
- }, {
2350
- name: 'unpack:svg-icons',
2351
- configResolved: (config)=>{
2352
- rootPath1 = config.root || process.cwd(), ensureVirtualModules();
2353
- },
2354
- bundlerConfig: (config, { mergeConfig })=>(virtualModules || (virtualModules = new rspack.experiments.VirtualModulesPlugin({
2355
- [REGISTER_ID]: registerCode || 'export default null',
2356
- [NAMES_ID]: namesCode || 'export default []'
2357
- })), mergeConfig(config, {
2358
- plugins: [
2359
- virtualModules,
2360
- {
2361
- apply: (compiler)=>{
2362
- compiler.hooks.thisCompilation.tap('UnpackSvgIconsVirtualModules', ()=>{
2363
- ensureVirtualModules(), virtualModules?.writeModule?.(REGISTER_ID, registerCode || 'export default null'), virtualModules?.writeModule?.(NAMES_ID, namesCode || 'export default []');
2364
- });
2447
+ }),
2448
+ (VIRTUAL_UNO_CSS_ID = 'uno.css', rootDir = process.cwd(), unoConfig = {}, tokens = new Set(), tasks = [], requestedLayers = new Set([
2449
+ LAYER_MARK_ALL
2450
+ ]), layerImportRE = /(['"])uno\.css\?layer=([^'"]+)\1/g, ensureReady = async ()=>{
2451
+ var root, configOrPath;
2452
+ let core = await import("@unocss/core"), resolvedConfigOrPath = (root = rootDir, 'string' != typeof (configOrPath = (void 0) ?? configOrPathFromUnpackConfig) || node_path.isAbsolute(configOrPath) ? configOrPath : node_path.resolve(root, configOrPath)), resolvedDefaults = (void 0) ?? defaultsFromUnpackConfig, configFromOption = {};
2453
+ if (isPlainObject(resolvedConfigOrPath) ? configFromOption = resolvedConfigOrPath : isString(resolvedConfigOrPath) && (configFilePath = resolvedConfigOrPath), configFilePath || (configFilePath = ((root, customConfig)=>{
2454
+ for (let file of UNOCSS_CONFIG_FILES){
2455
+ let configFile = node_path.join(root, file);
2456
+ if (node_fs.existsSync(configFile)) return configFile;
2457
+ }
2458
+ })(rootDir)), configFilePath && node_fs.existsSync(configFilePath)) {
2459
+ let loaded = await loadConfigFile(configFilePath);
2460
+ if (isFunction(loaded)) {
2461
+ let result = await loaded({
2462
+ env: isDev() ? 'development' : 'production',
2463
+ command: isDev() ? 'dev' : 'build'
2464
+ });
2465
+ result && (configFromOption = utils_mergeConfig(configFromOption, result));
2466
+ } else loaded && (configFromOption = utils_mergeConfig(configFromOption, loaded));
2467
+ }
2468
+ resolvedDefaults && (configFromOption = utils_mergeConfig(resolvedDefaults, configFromOption)), unoConfig = configFromOption;
2469
+ let createGenerator = core.createGenerator;
2470
+ if (!createGenerator) throw Error('Failed to load "createGenerator" from "@unocss/core".');
2471
+ uno = await createGenerator(unoConfig), tokens = new Set();
2472
+ }, invalidate = ()=>{
2473
+ setTimeout(()=>{
2474
+ compilerRef.watching.invalidate(), logger_logger.debug(colors.yellow('[unocss] Invalidation triggered.'));
2475
+ }, 0);
2476
+ }, flushTasks = async ()=>{
2477
+ if (!tasks.length) return;
2478
+ let pending = tasks.map((t)=>t());
2479
+ tasks = [], await Promise.all(pending);
2480
+ }, getVirtualLayerId = (layer)=>`${VIRTUAL_UNO_CSS_ID}?layer=${encodeURIComponent(layer)}`, getVirtualModuleContent = (layer)=>{
2481
+ let code, layer1, layersKey = Array.from(requestedLayers).sort().join(','), hash = (code = `${Date.now()}|${layer}|${layersKey}`, createHash('sha256').update(code).digest('hex').slice(0, 8));
2482
+ return `#--unocss-hash--{content:"${hash}"}${layer1 = encodeURIComponent(layer), `#--unocss--{layer:${layer1};escape-view:\\"\\'\\\`\\\\}`}`;
2483
+ }, hash = (str)=>{
2484
+ let i, l, hVal = 0x811c9dc5;
2485
+ for(i = 0, l = str.length; i < l; i++)hVal ^= str.charCodeAt(i), hVal += (hVal << 1) + (hVal << 4) + (hVal << 7) + (hVal << 8) + (hVal << 24);
2486
+ return `00000${(hVal >>> 0).toString(36)}`.slice(-6);
2487
+ }, restoreSkipCode = (code, map)=>{
2488
+ let next = code;
2489
+ for (let [withHashKey, matched] of map.entries())next = next.replaceAll(withHashKey, matched);
2490
+ return next;
2491
+ }, applyUnoTransformers = async (original, id, enforce = 'default')=>{
2492
+ if (!uno || original.includes('@unocss-ignore')) return null;
2493
+ let transformers = (uno.config.transformers || []).filter((i)=>(i.enforce || 'default') === enforce);
2494
+ if (!transformers.length) return null;
2495
+ let skipMap = new Map(), code = original, s = new magic_string(((code, map, rules, keyFlag)=>{
2496
+ let next = code;
2497
+ for (let item of Array.from(next.matchAll(rules)))if (null != item) {
2498
+ let matched = item[0], withHashKey = `${keyFlag}${hash(matched)}`;
2499
+ map.set(withHashKey, matched), next = next.replace(matched, withHashKey);
2500
+ }
2501
+ return next;
2502
+ })(code, skipMap, SKIP_COMMENT_RE, '@unocss-skip-placeholder-'));
2503
+ for (let t of transformers)(!t.idFilter || t.idFilter(id)) && (await t.transform(s, id, {
2504
+ uno,
2505
+ tokens,
2506
+ invalidate
2507
+ }), s.hasChanged() && (s = new magic_string(code = restoreSkipCode(s.toString(), skipMap))));
2508
+ return code !== original ? code : null;
2509
+ }, getResolvedLayers = ()=>Array.from(requestedLayers).filter((layer)=>layer !== LAYER_MARK_ALL), {
2510
+ name: 'unpack:unocss',
2511
+ apply: (config)=>!!config.unocss,
2512
+ config: (config, { mergeConfig })=>mergeConfig(config, {
2513
+ performance: {
2514
+ cache: !1
2365
2515
  }
2516
+ }),
2517
+ configResolved: async (config)=>{
2518
+ if (rootDir = config.root || process.cwd(), Array.isArray(config.unocss)) {
2519
+ let [configOrPathValue, defaultsValue] = config.unocss;
2520
+ configOrPathFromUnpackConfig = configOrPathValue, defaultsFromUnpackConfig = defaultsValue;
2366
2521
  }
2367
- ]
2368
- })),
2369
- transform: {
2370
- filter: {
2371
- test: JS_REGEX
2372
- },
2373
- handler: (code)=>code.includes('virtual:svg-icons-') ? code.replace('virtual:svg-icons-', 'virtual-svg-icons-') : null
2374
- }
2375
- })), {
2376
- ...mergedConfig,
2522
+ await ensureReady();
2523
+ },
2524
+ bundlerConfig: (config)=>(config.lazyCompilation = !1, config),
2525
+ buildStart ({ compiler }) {
2526
+ compilerRef = compiler;
2527
+ },
2528
+ transform: {
2529
+ filter: {
2530
+ test: /\.(vue|svelte|[jt]sx?|vine\.ts|mdx?|astro|elm|php|phtml|marko)($|\?)/
2531
+ },
2532
+ handler: async (code, id)=>{
2533
+ var task;
2534
+ if (JS_REGEX.test(id) && !code.includes('@unocss-include')) return null;
2535
+ let transformedCode = code, preTransformed = await applyUnoTransformers(transformedCode, id, 'pre');
2536
+ null != preTransformed && (transformedCode = preTransformed);
2537
+ let defaultTransformed = await applyUnoTransformers(transformedCode, id, 'default');
2538
+ null != defaultTransformed && (transformedCode = defaultTransformed);
2539
+ let postTransformed = await applyUnoTransformers(transformedCode, id, 'post');
2540
+ return null != postTransformed && (transformedCode = postTransformed), transformedCode.includes('uno.css?layer=') && (transformedCode = transformedCode.replace(layerImportRE, (_, quote, layer)=>{
2541
+ let decodedLayer = ((layer)=>{
2542
+ try {
2543
+ return decodeURIComponent(layer);
2544
+ } catch {
2545
+ return layer;
2546
+ }
2547
+ })(layer);
2548
+ return requestedLayers.add(decodedLayer), `${quote}${getVirtualLayerId(decodedLayer)}${quote}`;
2549
+ })), task = async ()=>{
2550
+ await uno.applyExtractors(code.replace(SKIP_COMMENT_RE, ''), id, tokens);
2551
+ }, tasks.push(task), transformedCode === code ? null : transformedCode;
2552
+ }
2553
+ },
2554
+ processAssets: {
2555
+ stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,
2556
+ handler: async ({ compilation, sources })=>{
2557
+ if (await flushTasks(), !uno) return;
2558
+ let resolvedLayers = getResolvedLayers(), result = await uno.generate(tokens, {
2559
+ minify: !0
2560
+ });
2561
+ for (let file of Object.keys(compilation.assets)){
2562
+ if ('*' === file || file.includes('vendor')) continue;
2563
+ let code = compilation.assets[file].source().toString();
2564
+ if (!code.includes('#--unocss')) continue;
2565
+ let isJsAsset = /\.(?:[cm]?js|[cm]?jsx)$/.test(file), replaced = !1;
2566
+ code = (code = code.replace(HASH_PLACEHOLDER_RE, '')).replace(LAYER_PLACEHOLDER_RE, (_, layer, escapeView)=>{
2567
+ replaced = !0;
2568
+ let css = layer.trim() === LAYER_MARK_ALL ? result.getLayers(void 0, resolvedLayers) : result.getLayer(layer) || '';
2569
+ return isJsAsset ? getCssEscaperForJsContent(escapeView)(css) : css;
2570
+ }), replaced && compilation.updateAsset(file, new sources.RawSource(code));
2571
+ }
2572
+ }
2573
+ },
2574
+ virtualModules: ()=>({
2575
+ [VIRTUAL_UNO_CSS_ID]: getVirtualModuleContent(LAYER_MARK_ALL),
2576
+ ...getResolvedLayers().reduce((acc, layer)=>(acc[getVirtualLayerId(layer)] = getVirtualModuleContent(layer), acc), {})
2577
+ })
2578
+ }),
2579
+ (rootPath1 = '', registerCode = '', namesCode = '', {
2580
+ name: 'unpack:svg-icons',
2581
+ apply: (config)=>!!config.svgIcons,
2582
+ configResolved: (config)=>{
2583
+ rootPath1 = config.root || process.cwd(), optionsFromUnpackConfig = config.svgIcons, (()=>{
2584
+ let root, resolvedOptions = (void 0) ?? optionsFromUnpackConfig, inject = resolvedOptions.inject || 'body-last', domId = resolvedOptions.customDomId || '__svg__icons__dom__', { svg, names } = ((iconDirs, symbolId, customDomId)=>{
2585
+ let symbols = [], names = [], idSet = new Set();
2586
+ for (let dir of iconDirs)for (let file of readSvgFiles(dir)){
2587
+ let { inner, viewBox } = extractSvgContent(normalizeSvg(node_fs.readFileSync(file, 'utf-8'))), id = toSymbolId(file, dir, symbolId);
2588
+ !id || idSet.has(id) || (idSet.add(id), names.push(id), symbols.push(`<symbol id="${id}"${viewBox ? ` viewBox="${viewBox}"` : ''}>${inner}</symbol>`));
2589
+ }
2590
+ return {
2591
+ svg: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="${customDomId}" style="position: absolute; width: 0; height: 0" aria-hidden="true">${symbols.join('')}</svg>`,
2592
+ names
2593
+ };
2594
+ })((root = rootPath1, (resolvedOptions.iconDirs || []).map((dir)=>node_path.isAbsolute(dir) ? dir : node_path.resolve(root, dir))), resolvedOptions.symbolId, domId);
2595
+ registerCode = `const svgDomId = ${JSON.stringify(domId)}\nconst svgHtml = ${JSON.stringify(svg)}\nconst inject = (position) => {\n if (typeof document === 'undefined') return\n if (document.getElementById(svgDomId)) return\n const div = document.createElement('div')\n div.innerHTML = svgHtml\n const svgEl = div.firstElementChild\n if (!svgEl) return\n if (position === 'head' && document.head) {\n document.head.prepend(svgEl)\n return\n }\n const body = document.body\n if (!body) return\n if (position === 'body-first' && body.firstChild) {\n body.insertBefore(svgEl, body.firstChild)\n } else {\n body.appendChild(svgEl)\n }\n}\nconst mount = () => inject(${JSON.stringify(inject)})\nif (typeof document !== 'undefined') {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', mount)\n } else {\n mount()\n }\n}\nexport default mount`, namesCode = `export const svgIconNames = ${JSON.stringify(names)}\nexport default svgIconNames`;
2596
+ })();
2597
+ },
2598
+ virtualModules: ()=>({
2599
+ '~svg-icons-register': registerCode || 'export default null',
2600
+ '~svg-icons-names': namesCode || 'export default []'
2601
+ }),
2602
+ transform: {
2603
+ filter: {
2604
+ test: JS_REGEX
2605
+ },
2606
+ handler: (code)=>code.includes('virtual:svg-icons-') ? code.replace('virtual:svg-icons-', '~svg-icons-') : null
2607
+ }
2608
+ })
2609
+ ]
2610
+ };
2611
+ return {
2612
+ ...utils_mergeConfig(defaultConfig, userConfig),
2377
2613
  _context
2378
2614
  };
2379
2615
  };
@@ -2382,7 +2618,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
2382
2618
  let mode = watch ? 'development' : 'production';
2383
2619
  setNodeEnv(mode);
2384
2620
  let config = resolveConfig(mode);
2385
- console.log(colors.brand(`${callerName} v4.1.0${config.performance?.cache ? ' ϟ' : ''}`), colors.cyan(`building for ${mode}...`)), await unpackBuild(config);
2621
+ console.log(colors.brand(`${callerName} v4.2.0`), colors.cyan(`building for ${mode}...`)), await unpackBuild(config);
2386
2622
  },
2387
2623
  dev: async ()=>{
2388
2624
  setUnpackStartTime(performance.now());
@@ -2531,7 +2767,7 @@ function runCLI() {
2531
2767
  logger_logger.clear(), logger_logger.info(`${node_path.basename(file)} changed, restarting server...`), await watcher.close(), await cleanUpBeforeRestart(), startServer(options);
2532
2768
  });
2533
2769
  });
2534
- devCommand.option('-o, --open [url]', 'Open browser on startup').option('--port <port>', 'Specify port').option('--host', 'Expose hostname').action(startServer), cli.help(), cli.version("4.1.0"), cli.parse();
2770
+ devCommand.option('-o, --open [url]', 'Open browser on startup').option('--port <port>', 'Specify port').option('--host', 'Expose hostname').action(startServer), cli.help(), cli.version("4.2.0"), cli.parse();
2535
2771
  }
2536
2772
  var src_CSS_MODULES_NAMED_EXPORT = !1;
2537
2773
  export { ALL_INTERFACES_IPV4, CSS_MODULES_EXPORTS_CONVENTION, CSS_MODULES_LOCAL_IDENT_NAME, DEV_DEFAULT_FILENAME, JSX_REGEX, JS_REGEX, LOCALHOST, NODE_MODULES_REGEX, PROD_DEFAULT_FILENAME, SCRIPT_REGEX, TEMPLATE_CONTENT, addRestartCleaner, cleanUpBeforeRestart, clearLine, colors, convertBasicAnsiColors, createChokidar, createUnpack, debounce, defineConfig, esVersionToBrowserslist, external_tinyglobby_glob as glob, findExists, getAddressUrls, getCompiledPkgPath, getCurrentUnpackConfig, getHtmlTemplateOrContent, getIpv4Interfaces, getNodeEnv, getOrSetDefault, getPathInJs, getPort, getTime, getUnpackStartTime, getUserDepPath, getUserDepVersion, globSync, injectToHead, isBoolean, isDebug, isDev, isEmptyDir, isFileExists, isFileSync, isFunction, isNodeVersionAtLeast, isObject, isPlainObject, isRegExp, isString, isUndefined, isWatch, isWin, launchEditor, loadConfig, logUpdate, logger_LogColor as LogColor, logger_logger as logger, normalizePublicPath, openBrowser, pLimit, pathExists, pathToExportIdentifier, prettyTime, printServerUrls, removeDir, resolveConfigPath, rspack, runCLI, set, setCurrentUnpackConfig, setDevServer, setNodeEnv, setUnpackStartTime, src_CSS_MODULES_NAMED_EXPORT as CSS_MODULES_NAMED_EXPORT, trackPerformance, utils_isDevServer as isDevServer, utils_isProd as isProd, utils_mergeConfig as mergeConfig };
@@ -1,7 +1,16 @@
1
+ let TRANSFORM_TIMING_STORE = Symbol.for('unpack:transformTimingMap'), globalScope = globalThis, transformTimingMap = globalScope[TRANSFORM_TIMING_STORE] ?? new WeakMap();
2
+ globalScope[TRANSFORM_TIMING_STORE] = transformTimingMap;
1
3
  export default function(content) {
2
- let callback = this.async(), { handler } = this.getOptions(), id = `${this.resourcePath}${this.resourceQuery || ''}`;
4
+ let callback = this.async(), { handler, pluginName } = this.getOptions(), id = `${this.resourcePath}${this.resourceQuery || ''}`;
3
5
  (async ()=>{
4
- let result = await handler(content, id);
5
- return 'string' == typeof result ? result : content;
6
+ let startTime = performance.now();
7
+ try {
8
+ let result = await handler(content, id);
9
+ return 'string' == typeof result ? result : content;
10
+ } finally{
11
+ var compilation;
12
+ let pluginMap, prev, duration = performance.now() - startTime;
13
+ this._compilation && (compilation = this._compilation, (pluginMap = transformTimingMap.get(compilation)) || (pluginMap = new Map(), transformTimingMap.set(compilation, pluginMap)), prev = pluginMap.get(pluginName) || 0, pluginMap.set(pluginName, prev + duration));
14
+ }
6
15
  })().then((code)=>callback(null, code)).catch((error)=>callback(error));
7
16
  };
@@ -1,5 +1,6 @@
1
1
  import type { Rspack, UnpackPlugin } from '../../types';
2
2
  export default function (this: Rspack.LoaderContext<{
3
3
  handler: NonNullable<UnpackPlugin['transform']>['handler'];
4
+ pluginName: string;
4
5
  }>, content: string): void;
5
6
  //# sourceMappingURL=transformLoader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformLoader.d.ts","sourceRoot":"","sources":["../../../src/bundler-config/loaders/transformLoader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAErD,MAAM,CAAC,OAAO,WACZ,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC;IAAE,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;CAAE,CAAC,EAC1F,OAAO,EAAE,MAAM,GACd,IAAI,CAWN"}
1
+ {"version":3,"file":"transformLoader.d.ts","sourceRoot":"","sources":["../../../src/bundler-config/loaders/transformLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAErD,MAAM,CAAC,OAAO,WACZ,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC;IACzB,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAC1D,UAAU,EAAE,MAAM,CAAA;CACnB,CAAC,EACF,OAAO,EAAE,MAAM,GACd,IAAI,CAmBN"}
@@ -1 +1 @@
1
- {"version":3,"file":"registerHooks.d.ts","sourceRoot":"","sources":["../../../src/bundler-config/plugins/registerHooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAKvC,qBAAa,mBAAmB;IAC9B,cAAc,UAAO;IACrB,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAG,IAAI;CA2BvC"}
1
+ {"version":3,"file":"registerHooks.d.ts","sourceRoot":"","sources":["../../../src/bundler-config/plugins/registerHooks.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAIvC,qBAAa,mBAAmB;IAC9B,cAAc,UAAO;IACrB,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAG,IAAI;CA6DvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createUnpack.d.ts","sourceRoot":"","sources":["../src/createUnpack.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAW,YAAY,EAAiB,MAAM,SAAS,CAAA;AA6CnE,wBAAgB,YAAY,CAAC,EAC3B,GAAmB,EACnB,MAAM,EAAE,UAAU,EAClB,UAAqB,GACtB,EAAE;IACD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,YAAY,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;wBAsB4B;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;;;;;;EA8B/C"}
1
+ {"version":3,"file":"createUnpack.d.ts","sourceRoot":"","sources":["../src/createUnpack.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAW,YAAY,EAAiB,MAAM,SAAS,CAAA;AA+CnE,wBAAgB,YAAY,CAAC,EAC3B,GAAmB,EACnB,MAAM,EAAE,UAAU,EAClB,UAAqB,GACtB,EAAE;IACD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,YAAY,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;wBAkB4B;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;;;;;;EA8B/C"}
@@ -1,6 +1,13 @@
1
1
  import type { UnpackPlugin, UnpackPluginHook } from './types';
2
2
  export declare function getNormalizedPluginsByHook(hook: UnpackPluginHook): UnpackPlugin[];
3
3
  type HookImpl<T extends UnpackPluginHook> = Exclude<UnpackPlugin[T], undefined>;
4
- export declare function applyPluginsByHook<T extends UnpackPluginHook>(hook: T, runner: (impl: HookImpl<T>) => void | Promise<void>): Promise<void>;
4
+ export declare const createPluginHookTimer: (plugin: UnpackPlugin, hook: UnpackPluginHook) => {
5
+ start: () => void;
6
+ end: () => void;
7
+ };
8
+ export declare const addTransformTiming: (compilation: object, pluginName: string, duration: number) => void;
9
+ export declare const flushTransformTiming: (compilation: object) => void;
10
+ export declare function applyPluginsByHook<T extends UnpackPluginHook>(hook: T, runner: (impl: HookImpl<T>, plugin: UnpackPlugin) => void | Promise<void>): Promise<void>;
11
+ export declare function applyPluginsByHookSync<T extends UnpackPluginHook>(hook: T, runner: (impl: HookImpl<T>, plugin: UnpackPlugin) => void): void;
5
12
  export {};
6
13
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AA8B7E,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAUjF;AAED,KAAK,QAAQ,CAAC,CAAC,SAAS,gBAAgB,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;AAE/E,wBAAsB,kBAAkB,CAAC,CAAC,SAAS,gBAAgB,EACjE,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAClD,OAAO,CAAC,IAAI,CAAC,CAQf"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAkB,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AA8B7E,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAsBjF;AAED,KAAK,QAAQ,CAAC,CAAC,SAAS,gBAAgB,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;AAE/E,eAAO,MAAM,qBAAqB,GAAI,QAAQ,YAAY,EAAE,MAAM,gBAAgB;;;CAajF,CAAA;AAUD,eAAO,MAAM,kBAAkB,GAAI,aAAa,MAAM,EAAE,YAAY,MAAM,EAAE,UAAU,MAAM,SAQ3F,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM,SASvD,CAAA;AAED,wBAAsB,kBAAkB,CAAC,CAAC,SAAS,gBAAgB,EACjE,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GACxE,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,gBAAgB,EAC/D,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,GACxD,IAAI,CAiBN"}
@@ -1 +1 @@
1
- {"version":3,"file":"autoCssModules.d.ts","sourceRoot":"","sources":["../../src/plugins/autoCssModules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAM7C,eAAO,MAAM,oBAAoB,QAAO,YAoBvC,CAAA"}
1
+ {"version":3,"file":"autoCssModules.d.ts","sourceRoot":"","sources":["../../src/plugins/autoCssModules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAO7C,eAAO,MAAM,oBAAoB,QAAO,YAoBvC,CAAA"}
@@ -5,5 +5,5 @@ export type PluginSvgIconsOptions = {
5
5
  customDomId?: string;
6
6
  inject?: 'body-first' | 'body-last' | 'head';
7
7
  };
8
- export declare const pluginSvgIcons: (options: PluginSvgIconsOptions) => UnpackPlugin;
8
+ export declare const pluginSvgIcons: (options?: PluginSvgIconsOptions) => UnpackPlugin;
9
9
  //# sourceMappingURL=svgIcons.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"svgIcons.d.ts","sourceRoot":"","sources":["../../src/plugins/svgIcons.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,WAAW,CAAA;AAErD,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,CAAA;IAChE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,GAAG,MAAM,CAAA;CAC7C,CAAA;AAwID,eAAO,MAAM,cAAc,GAAI,SAAS,qBAAqB,KAAG,YAuD/D,CAAA"}
1
+ {"version":3,"file":"svgIcons.d.ts","sourceRoot":"","sources":["../../src/plugins/svgIcons.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,CAAA;IAChE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,GAAG,MAAM,CAAA;CAC7C,CAAA;AAwID,eAAO,MAAM,cAAc,GAAI,UAAU,qBAAqB,KAAG,YAwChE,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { UserConfig } from '@unocss/core';
2
+ import type { UnpackPlugin } from '../types';
3
+ export type PluginUnocssOptions<Theme extends object = object> = UserConfig<Theme>;
4
+ export declare const pluginUnocss: <Theme extends object>(configOrPath?: PluginUnocssOptions<Theme> | string, defaults?: PluginUnocssOptions<Theme>) => UnpackPlugin;
5
+ //# sourceMappingURL=unocss.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unocss.d.ts","sourceRoot":"","sources":["../../src/plugins/unocss.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAIV,UAAU,EACX,MAAM,cAAc,CAAA;AAKrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C,MAAM,MAAM,mBAAmB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,UAAU,CAAC,KAAK,CAAC,CAAA;AAkGlF,eAAO,MAAM,YAAY,GAAI,KAAK,SAAS,MAAM,EAC/C,eAAe,mBAAmB,CAAC,KAAK,CAAC,GAAG,MAAM,EAClD,WAAW,mBAAmB,CAAC,KAAK,CAAC,KACpC,YAqQF,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import type * as Rspack from '@rspack/core';
2
2
  import type { AcceptedPlugin, ProcessOptions } from 'postcss';
3
3
  import type { PluginSvgIconsOptions } from '../plugins/svgIcons';
4
+ import type { PluginUnocssOptions } from '../plugins/unocss';
4
5
  import type { ChunkSplit } from './chunkSplit';
5
6
  import type { OxcMinifyPluginOptions } from './oxc';
6
7
  import type { UnpackPluginOption } from './plugin';
@@ -296,5 +297,9 @@ export type UnpackConfig = {
296
297
  * Port of [vite-plugin-svg-icons](https://github.com/vbenjs/vite-plugin-svg-icons).
297
298
  */
298
299
  svgIcons?: PluginSvgIconsOptions;
300
+ /**
301
+ * Unocss plugin options.
302
+ */
303
+ unocss?: [configOrPath?: PluginUnocssOptions | string, defaults?: PluginUnocssOptions];
299
304
  };
300
305
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAElD,YAAY,EAAE,MAAM,EAAE,CAAA;AAEtB,MAAM,MAAM,oBAAoB,GAAG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  name: string;
10
+ enforce?: 'pre' | 'post';
10
11
  apply?: 'dev' | 'build' | ((config: PartialUnpackConfig, env: PluginApplyEnv) => boolean | undefined);
12
+ virtualModules?: () => Record<string, string>;
11
13
  config?: (config: PartialUnpackConfig, context: UnpackContext & {
12
14
  mergeConfig: (...configs: PartialUnpackConfig[]) => PartialUnpackConfig;
13
15
  }) => Promise<PartialUnpackConfig> | PartialUnpackConfig;
@@ -20,6 +22,15 @@ export type UnpackPlugin = {
20
22
  filter: Pick<Rspack.RuleSetRule, 'test' | 'resourceQuery' | 'include' | 'exclude'>;
21
23
  handler: (code: string, id: string) => Promise<string | null> | string | null;
22
24
  };
25
+ processAssets?: {
26
+ stage?: number;
27
+ handler: (context: {
28
+ assets: Rspack.Compilation['assets'];
29
+ sources: typeof Rspack.sources;
30
+ compilation: Rspack.Compilation;
31
+ compiler: Rspack.Compiler;
32
+ }) => Promise<void> | void;
33
+ };
23
34
  transformHtml?: (html: string) => Promise<string> | string;
24
35
  setupMiddlewares?: (middlewares: DevServerMiddleware[]) => Promise<DevServerMiddleware[]> | DevServerMiddleware[];
25
36
  buildStart?: (context: {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAEzF,KAAK,mBAAmB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,eAAe,CAAC,CAAA;AAE1E,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,KAAK,GAAG,OAAO,CAAA;IACxB,IAAI,EAAE,aAAa,GAAG,YAAY,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EACF,KA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OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;KAC3B,CAAA;IACD,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAA;IAC1D,gBAAgB,CAAC,EAAE,CACjB,WAAW,EAAE,mBAAmB,EAAE,KAC/B,OAAO,CAAC,mBAAmB,EAAE,CAAC,GAAG,mBAAmB,EAAE,CAAA;IAC3D,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE;QACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;QACzB,cAAc,EAAE,OAAO,CAAA;QACvB,OAAO,EAAE,OAAO,CAAA;KACjB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC1B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAA;QACzB,cAAc,EAAE,OAAO,CAAA;QACvB,OAAO,EAAE,OAAO,CAAA;QAChB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAA;KACpB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CAC3B,CAAA;AACD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,YAAY,EAAE,CAAA;AAC9D,MAAM,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unpackjs/core",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "An Rspack-based build tool",
5
5
  "type": "module",
6
6
  "bin": {
@@ -29,7 +29,8 @@
29
29
  "access": "public"
30
30
  },
31
31
  "devDependencies": {
32
- "css-loader": "7.1.2",
32
+ "@unocss/core": "66.6.0",
33
+ "css-loader": "7.1.3",
33
34
  "launch-editor": "2.12.0",
34
35
  "less-loader": "12.3.0",
35
36
  "postcss-loader": "8.2.0",
@@ -40,20 +41,24 @@
40
41
  },
41
42
  "dependencies": {
42
43
  "@jridgewell/trace-mapping": "0.3.31",
43
- "@rsdoctor/rspack-plugin": "1.5.0",
44
- "@rspack/core": "1.7.3",
45
- "@rspack/dev-server": "1.1.5",
44
+ "@rsdoctor/rspack-plugin": "1.5.1",
45
+ "@rspack/core": "1.7.4",
46
+ "@rspack/dev-server": "1.2.1",
46
47
  "cac": "6.7.14",
47
48
  "chokidar": "5.0.0",
48
49
  "dotenv-expand": "12.0.3",
49
50
  "jiti": "2.6.1",
50
- "oxc-minify": "0.110.0",
51
+ "magic-string": "0.30.21",
52
+ "oxc-minify": "0.111.0",
51
53
  "portfinder": "1.0.38",
52
54
  "postcss": "8.5.6",
53
55
  "stacktrace-parser": "0.1.11",
54
56
  "tinyglobby": "0.2.15",
55
57
  "ts-checker-rspack-plugin": "1.2.6"
56
58
  },
59
+ "peerDependencies": {
60
+ "@unocss/core": "*"
61
+ },
57
62
  "scripts": {
58
63
  "dev": "rslib build --watch",
59
64
  "build": "pnpm run prebundle && rslib build",