@rsbuild/core 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/css-loader/index.js +20 -20
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/postcss-loader/index.js +8 -8
- package/compiled/rspack-chain/index.d.ts +3 -0
- package/compiled/rspack-chain/index.js +69 -66
- package/compiled/rspack-chain/package.json +1 -1
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/dist/index.cjs +57 -58
- package/dist/index.js +57 -58
- package/dist-types/config.d.ts +29 -3
- package/dist-types/index.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
1762: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const loader = __nccwpck_require__(
|
|
5
|
+
const loader = __nccwpck_require__(4711);
|
|
6
6
|
module.exports = loader.default;
|
|
7
7
|
module.exports.defaultGetLocalIdent =
|
|
8
|
-
__nccwpck_require__(
|
|
8
|
+
__nccwpck_require__(7797).defaultGetLocalIdent;
|
|
9
9
|
},
|
|
10
|
-
|
|
10
|
+
4711: (__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__(9961));
|
|
15
15
|
var _package = _interopRequireDefault(__nccwpck_require__(7337));
|
|
16
16
|
var _semver = { satisfies: () => true };
|
|
17
|
-
var _options = _interopRequireDefault(__nccwpck_require__(
|
|
18
|
-
var _plugins = __nccwpck_require__(
|
|
19
|
-
var _utils = __nccwpck_require__(
|
|
17
|
+
var _options = _interopRequireDefault(__nccwpck_require__(1536));
|
|
18
|
+
var _plugins = __nccwpck_require__(1715);
|
|
19
|
+
var _utils = __nccwpck_require__(7797);
|
|
20
20
|
function _interopRequireDefault(obj) {
|
|
21
21
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
22
22
|
}
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
callback(null, `${importCode}${moduleCode}${exportCode}`);
|
|
244
244
|
}
|
|
245
245
|
},
|
|
246
|
-
|
|
246
|
+
1715: (__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__(
|
|
268
|
+
__nccwpck_require__(9985),
|
|
269
269
|
);
|
|
270
270
|
var _postcssIcssParser = _interopRequireDefault(
|
|
271
|
-
__nccwpck_require__(
|
|
271
|
+
__nccwpck_require__(2709),
|
|
272
272
|
);
|
|
273
|
-
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(
|
|
273
|
+
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(7445));
|
|
274
274
|
function _interopRequireDefault(obj) {
|
|
275
275
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
276
276
|
}
|
|
277
277
|
},
|
|
278
|
-
|
|
278
|
+
2709: (__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__(4508);
|
|
283
|
-
var _utils = __nccwpck_require__(
|
|
283
|
+
var _utils = __nccwpck_require__(7797);
|
|
284
284
|
const plugin = (options = {}) => ({
|
|
285
285
|
postcssPlugin: "postcss-icss-parser",
|
|
286
286
|
async OnceExit(root) {
|
|
@@ -379,14 +379,14 @@
|
|
|
379
379
|
plugin.postcss = true;
|
|
380
380
|
var _default = (exports["default"] = plugin);
|
|
381
381
|
},
|
|
382
|
-
|
|
382
|
+
9985: (__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__(7555),
|
|
388
388
|
);
|
|
389
|
-
var _utils = __nccwpck_require__(
|
|
389
|
+
var _utils = __nccwpck_require__(7797);
|
|
390
390
|
function _interopRequireDefault(obj) {
|
|
391
391
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
392
392
|
}
|
|
@@ -691,14 +691,14 @@
|
|
|
691
691
|
plugin.postcss = true;
|
|
692
692
|
var _default = (exports["default"] = plugin);
|
|
693
693
|
},
|
|
694
|
-
|
|
694
|
+
7445: (__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__(7555),
|
|
700
700
|
);
|
|
701
|
-
var _utils = __nccwpck_require__(
|
|
701
|
+
var _utils = __nccwpck_require__(7797);
|
|
702
702
|
function _interopRequireDefault(obj) {
|
|
703
703
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
704
704
|
}
|
|
@@ -1041,7 +1041,7 @@
|
|
|
1041
1041
|
plugin.postcss = true;
|
|
1042
1042
|
var _default = (exports["default"] = plugin);
|
|
1043
1043
|
},
|
|
1044
|
-
|
|
1044
|
+
7797: (__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;
|
|
@@ -7968,7 +7968,7 @@
|
|
|
7968
7968
|
"use strict";
|
|
7969
7969
|
module.exports = require("util");
|
|
7970
7970
|
},
|
|
7971
|
-
|
|
7971
|
+
1536: (module) => {
|
|
7972
7972
|
"use strict";
|
|
7973
7973
|
module.exports = JSON.parse(
|
|
7974
7974
|
'{"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"}',
|
|
@@ -8003,6 +8003,6 @@
|
|
|
8003
8003
|
}
|
|
8004
8004
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
8005
8005
|
__nccwpck_require__.ab = __dirname + "/";
|
|
8006
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
8006
|
+
var __webpack_exports__ = __nccwpck_require__(1762);
|
|
8007
8007
|
module.exports = __webpack_exports__;
|
|
8008
8008
|
})();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
277: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const { HtmlWebpackChildCompiler } = __nccwpck_require__(
|
|
5
|
+
const { HtmlWebpackChildCompiler } = __nccwpck_require__(846);
|
|
6
6
|
const compilerMap = new WeakMap();
|
|
7
7
|
class CachedChildCompilation {
|
|
8
8
|
constructor(compiler) {
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
}
|
|
305
305
|
module.exports = { CachedChildCompilation };
|
|
306
306
|
},
|
|
307
|
-
|
|
307
|
+
846: (module) => {
|
|
308
308
|
"use strict";
|
|
309
309
|
class HtmlWebpackChildCompiler {
|
|
310
310
|
constructor(templates) {
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
}
|
|
474
474
|
module.exports = { HtmlWebpackChildCompiler };
|
|
475
475
|
},
|
|
476
|
-
|
|
476
|
+
749: (module) => {
|
|
477
477
|
"use strict";
|
|
478
478
|
module.exports = {};
|
|
479
479
|
module.exports.none = (chunks) => chunks;
|
|
@@ -492,7 +492,7 @@
|
|
|
492
492
|
};
|
|
493
493
|
module.exports.auto = module.exports.none;
|
|
494
494
|
},
|
|
495
|
-
|
|
495
|
+
654: (module) => {
|
|
496
496
|
"use strict";
|
|
497
497
|
module.exports = function (err) {
|
|
498
498
|
return {
|
|
@@ -513,7 +513,7 @@
|
|
|
513
513
|
};
|
|
514
514
|
};
|
|
515
515
|
},
|
|
516
|
-
|
|
516
|
+
401: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
517
517
|
"use strict";
|
|
518
518
|
const { AsyncSeriesWaterfallHook } = __nccwpck_require__(348);
|
|
519
519
|
const htmlWebpackPluginHooksMap = new WeakMap();
|
|
@@ -539,7 +539,7 @@
|
|
|
539
539
|
}
|
|
540
540
|
module.exports = { getHtmlRspackPluginHooks };
|
|
541
541
|
},
|
|
542
|
-
|
|
542
|
+
562: (module) => {
|
|
543
543
|
const voidTags = [
|
|
544
544
|
"area",
|
|
545
545
|
"base",
|
|
@@ -607,19 +607,19 @@
|
|
|
607
607
|
htmlTagObjectToString,
|
|
608
608
|
};
|
|
609
609
|
},
|
|
610
|
-
|
|
610
|
+
993: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
611
611
|
"use strict";
|
|
612
612
|
const promisify = __nccwpck_require__(837).promisify;
|
|
613
613
|
const vm = __nccwpck_require__(144);
|
|
614
614
|
const fs = __nccwpck_require__(147);
|
|
615
615
|
const path = __nccwpck_require__(17);
|
|
616
|
-
const { CachedChildCompilation } = __nccwpck_require__(
|
|
616
|
+
const { CachedChildCompilation } = __nccwpck_require__(277);
|
|
617
617
|
const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
|
|
618
|
-
__nccwpck_require__(
|
|
619
|
-
const prettyError = __nccwpck_require__(
|
|
620
|
-
const chunkSorter = __nccwpck_require__(
|
|
618
|
+
__nccwpck_require__(562);
|
|
619
|
+
const prettyError = __nccwpck_require__(654);
|
|
620
|
+
const chunkSorter = __nccwpck_require__(749);
|
|
621
621
|
const getHtmlRspackPluginHooks =
|
|
622
|
-
__nccwpck_require__(
|
|
622
|
+
__nccwpck_require__(401).getHtmlRspackPluginHooks;
|
|
623
623
|
class HtmlRspackPlugin {
|
|
624
624
|
constructor(userOptions = {}) {
|
|
625
625
|
this.version = HtmlRspackPlugin.version;
|
|
@@ -1578,6 +1578,6 @@
|
|
|
1578
1578
|
}
|
|
1579
1579
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
1580
1580
|
__nccwpck_require__.ab = __dirname + "/";
|
|
1581
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
1581
|
+
var __webpack_exports__ = __nccwpck_require__(993);
|
|
1582
1582
|
module.exports = __webpack_exports__;
|
|
1583
1583
|
})();
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
294: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(425)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
425: (__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 _path = _interopRequireDefault(__nccwpck_require__(17));
|
|
12
12
|
var _package = _interopRequireDefault(__nccwpck_require__(337));
|
|
13
|
-
var _options = _interopRequireDefault(__nccwpck_require__(
|
|
14
|
-
var _utils = __nccwpck_require__(
|
|
13
|
+
var _options = _interopRequireDefault(__nccwpck_require__(54));
|
|
14
|
+
var _utils = __nccwpck_require__(171);
|
|
15
15
|
function _interopRequireDefault(obj) {
|
|
16
16
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
17
17
|
}
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
callback(null, result.css, map, { ast });
|
|
190
190
|
}
|
|
191
191
|
},
|
|
192
|
-
|
|
192
|
+
171: (module, exports, __nccwpck_require__) => {
|
|
193
193
|
module = __nccwpck_require__.nmd(module);
|
|
194
194
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
195
195
|
exports.exec = exec;
|
|
@@ -691,7 +691,7 @@
|
|
|
691
691
|
310: (module) => {
|
|
692
692
|
module.exports = require("url");
|
|
693
693
|
},
|
|
694
|
-
|
|
694
|
+
54: (module) => {
|
|
695
695
|
module.exports = JSON.parse(
|
|
696
696
|
'{"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}',
|
|
697
697
|
);
|
|
@@ -736,6 +736,6 @@
|
|
|
736
736
|
})();
|
|
737
737
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
738
738
|
__nccwpck_require__.ab = __dirname + "/";
|
|
739
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
739
|
+
var __webpack_exports__ = __nccwpck_require__(294);
|
|
740
740
|
module.exports = __webpack_exports__;
|
|
741
741
|
})();
|
|
@@ -412,6 +412,7 @@ declare namespace Config {
|
|
|
412
412
|
oneOfs: TypedChainedMap<this, { [key: string]: Rule<Rule> }>;
|
|
413
413
|
resolve: RuleResolve<Rule<T>>;
|
|
414
414
|
|
|
415
|
+
dependency(value: RspackRuleSet['dependency']): this;
|
|
415
416
|
enforce(value: RspackRuleSet['enforce']): this;
|
|
416
417
|
issuer(value: RspackRuleSet['issuer']): this;
|
|
417
418
|
issuerLayer(value: RspackRuleSet['issuerLayer']): this;
|
|
@@ -420,8 +421,10 @@ declare namespace Config {
|
|
|
420
421
|
parser(value: RspackRuleSet['parser']): this;
|
|
421
422
|
generator(value: RspackRuleSet['generator']): this;
|
|
422
423
|
resource(value: RspackRuleSet['resource']): this;
|
|
424
|
+
resourceFragment(value: RspackRuleSet['resourceFragment']): this;
|
|
423
425
|
resourceQuery(value: RspackRuleSet['resourceQuery']): this;
|
|
424
426
|
sideEffects(value: RspackRuleSet['sideEffects']): this;
|
|
427
|
+
with(value: RspackRuleSet['with']): this;
|
|
425
428
|
test(value: RspackRuleSet['test']): this;
|
|
426
429
|
type(value: RspackRuleSet['type']): this;
|
|
427
430
|
|
|
@@ -627,7 +627,7 @@
|
|
|
627
627
|
};
|
|
628
628
|
exports.toString = toString;
|
|
629
629
|
},
|
|
630
|
-
|
|
630
|
+
430: (module) => {
|
|
631
631
|
module.exports = class extends Function {
|
|
632
632
|
constructor() {
|
|
633
633
|
super();
|
|
@@ -640,35 +640,35 @@
|
|
|
640
640
|
}
|
|
641
641
|
};
|
|
642
642
|
},
|
|
643
|
-
|
|
644
|
-
const createMap = __nccwpck_require__(
|
|
645
|
-
const createChainable = __nccwpck_require__(
|
|
643
|
+
115: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
644
|
+
const createMap = __nccwpck_require__(944);
|
|
645
|
+
const createChainable = __nccwpck_require__(870);
|
|
646
646
|
module.exports = createMap(createChainable(Object));
|
|
647
647
|
},
|
|
648
|
-
|
|
649
|
-
const createSet = __nccwpck_require__(
|
|
650
|
-
const createChainable = __nccwpck_require__(
|
|
648
|
+
207: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
649
|
+
const createSet = __nccwpck_require__(72);
|
|
650
|
+
const createChainable = __nccwpck_require__(870);
|
|
651
651
|
module.exports = createSet(createChainable(Object));
|
|
652
652
|
},
|
|
653
|
-
|
|
654
|
-
const Callable = __nccwpck_require__(
|
|
655
|
-
const createMap = __nccwpck_require__(
|
|
656
|
-
const createChainable = __nccwpck_require__(
|
|
657
|
-
const createValue = __nccwpck_require__(
|
|
653
|
+
96: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
654
|
+
const Callable = __nccwpck_require__(430);
|
|
655
|
+
const createMap = __nccwpck_require__(944);
|
|
656
|
+
const createChainable = __nccwpck_require__(870);
|
|
657
|
+
const createValue = __nccwpck_require__(499);
|
|
658
658
|
module.exports = createValue(createMap(createChainable(Callable)));
|
|
659
659
|
},
|
|
660
|
-
|
|
661
|
-
const ChainedMap = __nccwpck_require__(
|
|
662
|
-
const ChainedValueMap = __nccwpck_require__(
|
|
663
|
-
const ChainedSet = __nccwpck_require__(
|
|
664
|
-
const Resolve = __nccwpck_require__(
|
|
665
|
-
const ResolveLoader = __nccwpck_require__(
|
|
666
|
-
const Output = __nccwpck_require__(
|
|
667
|
-
const DevServer = __nccwpck_require__(
|
|
668
|
-
const Plugin = __nccwpck_require__(
|
|
669
|
-
const Module = __nccwpck_require__(
|
|
670
|
-
const Optimization = __nccwpck_require__(
|
|
671
|
-
const Performance = __nccwpck_require__(
|
|
660
|
+
160: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
661
|
+
const ChainedMap = __nccwpck_require__(115);
|
|
662
|
+
const ChainedValueMap = __nccwpck_require__(96);
|
|
663
|
+
const ChainedSet = __nccwpck_require__(207);
|
|
664
|
+
const Resolve = __nccwpck_require__(171);
|
|
665
|
+
const ResolveLoader = __nccwpck_require__(817);
|
|
666
|
+
const Output = __nccwpck_require__(497);
|
|
667
|
+
const DevServer = __nccwpck_require__(551);
|
|
668
|
+
const Plugin = __nccwpck_require__(891);
|
|
669
|
+
const Module = __nccwpck_require__(23);
|
|
670
|
+
const Optimization = __nccwpck_require__(780);
|
|
671
|
+
const Performance = __nccwpck_require__(480);
|
|
672
672
|
module.exports = class extends ChainedMap {
|
|
673
673
|
constructor() {
|
|
674
674
|
super();
|
|
@@ -818,9 +818,9 @@
|
|
|
818
818
|
}
|
|
819
819
|
};
|
|
820
820
|
},
|
|
821
|
-
|
|
822
|
-
const ChainedMap = __nccwpck_require__(
|
|
823
|
-
const ChainedSet = __nccwpck_require__(
|
|
821
|
+
551: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
822
|
+
const ChainedMap = __nccwpck_require__(115);
|
|
823
|
+
const ChainedSet = __nccwpck_require__(207);
|
|
824
824
|
module.exports = class extends ChainedMap {
|
|
825
825
|
constructor(parent) {
|
|
826
826
|
super(parent);
|
|
@@ -892,9 +892,9 @@
|
|
|
892
892
|
}
|
|
893
893
|
};
|
|
894
894
|
},
|
|
895
|
-
|
|
896
|
-
const ChainedMap = __nccwpck_require__(
|
|
897
|
-
const Rule = __nccwpck_require__(
|
|
895
|
+
23: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
896
|
+
const ChainedMap = __nccwpck_require__(115);
|
|
897
|
+
const Rule = __nccwpck_require__(75);
|
|
898
898
|
module.exports = class extends ChainedMap {
|
|
899
899
|
constructor(parent) {
|
|
900
900
|
super(parent);
|
|
@@ -949,10 +949,10 @@
|
|
|
949
949
|
}
|
|
950
950
|
};
|
|
951
951
|
},
|
|
952
|
-
|
|
953
|
-
const ChainedMap = __nccwpck_require__(
|
|
954
|
-
const ChainedValueMap = __nccwpck_require__(
|
|
955
|
-
const Plugin = __nccwpck_require__(
|
|
952
|
+
780: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
953
|
+
const ChainedMap = __nccwpck_require__(115);
|
|
954
|
+
const ChainedValueMap = __nccwpck_require__(96);
|
|
955
|
+
const Plugin = __nccwpck_require__(891);
|
|
956
956
|
module.exports = class extends ChainedMap {
|
|
957
957
|
constructor(parent) {
|
|
958
958
|
super(parent);
|
|
@@ -1013,7 +1013,7 @@
|
|
|
1013
1013
|
}
|
|
1014
1014
|
};
|
|
1015
1015
|
},
|
|
1016
|
-
|
|
1016
|
+
134: (module) => {
|
|
1017
1017
|
module.exports = (Class) =>
|
|
1018
1018
|
class extends Class {
|
|
1019
1019
|
before(name) {
|
|
@@ -1045,8 +1045,8 @@
|
|
|
1045
1045
|
}
|
|
1046
1046
|
};
|
|
1047
1047
|
},
|
|
1048
|
-
|
|
1049
|
-
const ChainedMap = __nccwpck_require__(
|
|
1048
|
+
497: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1049
|
+
const ChainedMap = __nccwpck_require__(115);
|
|
1050
1050
|
module.exports = class extends ChainedMap {
|
|
1051
1051
|
constructor(parent) {
|
|
1052
1052
|
super(parent);
|
|
@@ -1100,8 +1100,8 @@
|
|
|
1100
1100
|
}
|
|
1101
1101
|
};
|
|
1102
1102
|
},
|
|
1103
|
-
|
|
1104
|
-
const ChainedValueMap = __nccwpck_require__(
|
|
1103
|
+
480: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1104
|
+
const ChainedValueMap = __nccwpck_require__(96);
|
|
1105
1105
|
module.exports = class extends ChainedValueMap {
|
|
1106
1106
|
constructor(parent) {
|
|
1107
1107
|
super(parent);
|
|
@@ -1114,9 +1114,9 @@
|
|
|
1114
1114
|
}
|
|
1115
1115
|
};
|
|
1116
1116
|
},
|
|
1117
|
-
|
|
1118
|
-
const ChainedMap = __nccwpck_require__(
|
|
1119
|
-
const Orderable = __nccwpck_require__(
|
|
1117
|
+
891: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1118
|
+
const ChainedMap = __nccwpck_require__(115);
|
|
1119
|
+
const Orderable = __nccwpck_require__(134);
|
|
1120
1120
|
module.exports = Orderable(
|
|
1121
1121
|
class extends ChainedMap {
|
|
1122
1122
|
constructor(parent, name, type = "plugin") {
|
|
@@ -1170,7 +1170,7 @@
|
|
|
1170
1170
|
}
|
|
1171
1171
|
if (typeof plugin === "string") {
|
|
1172
1172
|
pluginPath = plugin;
|
|
1173
|
-
plugin = __nccwpck_require__(
|
|
1173
|
+
plugin = __nccwpck_require__(183)(pluginPath);
|
|
1174
1174
|
}
|
|
1175
1175
|
const constructorName = plugin.__expression
|
|
1176
1176
|
? `(${plugin.__expression})`
|
|
@@ -1188,10 +1188,10 @@
|
|
|
1188
1188
|
},
|
|
1189
1189
|
);
|
|
1190
1190
|
},
|
|
1191
|
-
|
|
1192
|
-
const ChainedMap = __nccwpck_require__(
|
|
1193
|
-
const ChainedSet = __nccwpck_require__(
|
|
1194
|
-
const Plugin = __nccwpck_require__(
|
|
1191
|
+
171: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1192
|
+
const ChainedMap = __nccwpck_require__(115);
|
|
1193
|
+
const ChainedSet = __nccwpck_require__(207);
|
|
1194
|
+
const Plugin = __nccwpck_require__(891);
|
|
1195
1195
|
const childMaps = ["alias", "fallback", "byDependency", "extensionAlias"];
|
|
1196
1196
|
const childSets = [
|
|
1197
1197
|
"aliasFields",
|
|
@@ -1270,9 +1270,9 @@
|
|
|
1270
1270
|
}
|
|
1271
1271
|
};
|
|
1272
1272
|
},
|
|
1273
|
-
|
|
1274
|
-
const Resolve = __nccwpck_require__(
|
|
1275
|
-
const ChainedSet = __nccwpck_require__(
|
|
1273
|
+
817: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1274
|
+
const Resolve = __nccwpck_require__(171);
|
|
1275
|
+
const ChainedSet = __nccwpck_require__(207);
|
|
1276
1276
|
module.exports = class extends Resolve {
|
|
1277
1277
|
constructor(parent) {
|
|
1278
1278
|
super(parent);
|
|
@@ -1299,12 +1299,12 @@
|
|
|
1299
1299
|
}
|
|
1300
1300
|
};
|
|
1301
1301
|
},
|
|
1302
|
-
|
|
1303
|
-
const ChainedMap = __nccwpck_require__(
|
|
1304
|
-
const ChainedSet = __nccwpck_require__(
|
|
1305
|
-
const Orderable = __nccwpck_require__(
|
|
1306
|
-
const Use = __nccwpck_require__(
|
|
1307
|
-
const Resolve = __nccwpck_require__(
|
|
1302
|
+
75: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1303
|
+
const ChainedMap = __nccwpck_require__(115);
|
|
1304
|
+
const ChainedSet = __nccwpck_require__(207);
|
|
1305
|
+
const Orderable = __nccwpck_require__(134);
|
|
1306
|
+
const Use = __nccwpck_require__(420);
|
|
1307
|
+
const Resolve = __nccwpck_require__(171);
|
|
1308
1308
|
function toArray(arr) {
|
|
1309
1309
|
return Array.isArray(arr) ? arr : [arr];
|
|
1310
1310
|
}
|
|
@@ -1330,6 +1330,7 @@
|
|
|
1330
1330
|
this.resolve = new Resolve(this);
|
|
1331
1331
|
this.resolve.extend(["fullySpecified"]);
|
|
1332
1332
|
this.extend([
|
|
1333
|
+
"dependency",
|
|
1333
1334
|
"enforce",
|
|
1334
1335
|
"issuer",
|
|
1335
1336
|
"issuerLayer",
|
|
@@ -1338,8 +1339,10 @@
|
|
|
1338
1339
|
"parser",
|
|
1339
1340
|
"generator",
|
|
1340
1341
|
"resource",
|
|
1342
|
+
"resourceFragment",
|
|
1341
1343
|
"resourceQuery",
|
|
1342
1344
|
"sideEffects",
|
|
1345
|
+
"with",
|
|
1343
1346
|
"test",
|
|
1344
1347
|
"type",
|
|
1345
1348
|
]);
|
|
@@ -1429,10 +1432,10 @@
|
|
|
1429
1432
|
);
|
|
1430
1433
|
module.exports = Rule;
|
|
1431
1434
|
},
|
|
1432
|
-
|
|
1435
|
+
420: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1433
1436
|
const merge = __nccwpck_require__(964);
|
|
1434
|
-
const ChainedMap = __nccwpck_require__(
|
|
1435
|
-
const Orderable = __nccwpck_require__(
|
|
1437
|
+
const ChainedMap = __nccwpck_require__(115);
|
|
1438
|
+
const Orderable = __nccwpck_require__(134);
|
|
1436
1439
|
module.exports = Orderable(
|
|
1437
1440
|
class extends ChainedMap {
|
|
1438
1441
|
constructor(parent, name) {
|
|
@@ -1465,7 +1468,7 @@
|
|
|
1465
1468
|
},
|
|
1466
1469
|
);
|
|
1467
1470
|
},
|
|
1468
|
-
|
|
1471
|
+
870: (module) => {
|
|
1469
1472
|
module.exports = function createChainable(superClass) {
|
|
1470
1473
|
return class extends superClass {
|
|
1471
1474
|
constructor(parent) {
|
|
@@ -1482,7 +1485,7 @@
|
|
|
1482
1485
|
};
|
|
1483
1486
|
};
|
|
1484
1487
|
},
|
|
1485
|
-
|
|
1488
|
+
944: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
1486
1489
|
const merge = __nccwpck_require__(964);
|
|
1487
1490
|
module.exports = function createMap(superClass) {
|
|
1488
1491
|
return class extends superClass {
|
|
@@ -1606,7 +1609,7 @@
|
|
|
1606
1609
|
};
|
|
1607
1610
|
};
|
|
1608
1611
|
},
|
|
1609
|
-
|
|
1612
|
+
72: (module) => {
|
|
1610
1613
|
module.exports = function createSet(superClass) {
|
|
1611
1614
|
return class extends superClass {
|
|
1612
1615
|
constructor(...args) {
|
|
@@ -1656,7 +1659,7 @@
|
|
|
1656
1659
|
};
|
|
1657
1660
|
};
|
|
1658
1661
|
},
|
|
1659
|
-
|
|
1662
|
+
499: (module) => {
|
|
1660
1663
|
module.exports = function createValue(superClass) {
|
|
1661
1664
|
return class extends superClass {
|
|
1662
1665
|
constructor(...args) {
|
|
@@ -1694,7 +1697,7 @@
|
|
|
1694
1697
|
};
|
|
1695
1698
|
};
|
|
1696
1699
|
},
|
|
1697
|
-
|
|
1700
|
+
183: (module) => {
|
|
1698
1701
|
function webpackEmptyContext(req) {
|
|
1699
1702
|
var e = new Error("Cannot find module '" + req + "'");
|
|
1700
1703
|
e.code = "MODULE_NOT_FOUND";
|
|
@@ -1702,7 +1705,7 @@
|
|
|
1702
1705
|
}
|
|
1703
1706
|
webpackEmptyContext.keys = () => [];
|
|
1704
1707
|
webpackEmptyContext.resolve = webpackEmptyContext;
|
|
1705
|
-
webpackEmptyContext.id =
|
|
1708
|
+
webpackEmptyContext.id = 183;
|
|
1706
1709
|
module.exports = webpackEmptyContext;
|
|
1707
1710
|
},
|
|
1708
1711
|
};
|
|
@@ -1732,6 +1735,6 @@
|
|
|
1732
1735
|
})();
|
|
1733
1736
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
1734
1737
|
__nccwpck_require__.ab = __dirname + "/";
|
|
1735
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
1738
|
+
var __webpack_exports__ = __nccwpck_require__(160);
|
|
1736
1739
|
module.exports = __webpack_exports__;
|
|
1737
1740
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"rspack-chain","author":"rspack-contrib","version":"1.0
|
|
1
|
+
{"name":"rspack-chain","author":"rspack-contrib","version":"1.1.0","license":"MPL-2.0","types":"index.d.ts","type":"commonjs"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
4
|
+
674: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.transformFiles =
|
|
7
7
|
exports.reduceChunk =
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
.map(standardizeFilePaths);
|
|
121
121
|
exports.transformFiles = transformFiles;
|
|
122
122
|
},
|
|
123
|
-
|
|
123
|
+
641: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
124
124
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
125
125
|
exports.normalModuleLoaderHook =
|
|
126
126
|
exports.getCompilerHooks =
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
const fs_1 = __nccwpck_require__(147);
|
|
131
131
|
const path_1 = __nccwpck_require__(17);
|
|
132
132
|
const lite_tapable_1 = __nccwpck_require__(348);
|
|
133
|
-
const helpers_1 = __nccwpck_require__(
|
|
133
|
+
const helpers_1 = __nccwpck_require__(674);
|
|
134
134
|
const compilerHookMap = new WeakMap();
|
|
135
135
|
const getCompilerHooks = (compiler) => {
|
|
136
136
|
let hooks = compilerHookMap.get(compiler);
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
exports.getCompilerHooks =
|
|
313
313
|
void 0;
|
|
314
314
|
const path_1 = __nccwpck_require__(17);
|
|
315
|
-
const hooks_1 = __nccwpck_require__(
|
|
315
|
+
const hooks_1 = __nccwpck_require__(641);
|
|
316
316
|
Object.defineProperty(exports, "getCompilerHooks", {
|
|
317
317
|
enumerable: true,
|
|
318
318
|
get: function () {
|
package/dist/index.cjs
CHANGED
|
@@ -2278,7 +2278,7 @@ var __webpack_exports__ = {};
|
|
|
2278
2278
|
});
|
|
2279
2279
|
watcher.on('add', callback), watcher.on('change', callback), watcher.on('unlink', callback);
|
|
2280
2280
|
}
|
|
2281
|
-
async function config_loadConfig({ cwd = process.cwd(), path, envMode } = {}) {
|
|
2281
|
+
async function config_loadConfig({ cwd = process.cwd(), path, envMode, meta } = {}) {
|
|
2282
2282
|
let configExport;
|
|
2283
2283
|
let configFilePath = resolveConfigPath(cwd, path);
|
|
2284
2284
|
if (!configFilePath) return {
|
|
@@ -2310,7 +2310,8 @@ var __webpack_exports__ = {};
|
|
|
2310
2310
|
let command = process.argv[2], nodeEnv = getNodeEnv(), result = await configExport({
|
|
2311
2311
|
env: nodeEnv,
|
|
2312
2312
|
command,
|
|
2313
|
-
envMode: envMode || nodeEnv
|
|
2313
|
+
envMode: envMode || nodeEnv,
|
|
2314
|
+
meta
|
|
2314
2315
|
});
|
|
2315
2316
|
if (void 0 === result) throw Error('The config function must return a config object.');
|
|
2316
2317
|
return {
|
|
@@ -2743,7 +2744,7 @@ var __webpack_exports__ = {};
|
|
|
2743
2744
|
async function createContext(options, userConfig, bundlerType) {
|
|
2744
2745
|
let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache');
|
|
2745
2746
|
return {
|
|
2746
|
-
version: "1.1.
|
|
2747
|
+
version: "1.1.4",
|
|
2747
2748
|
rootPath,
|
|
2748
2749
|
distPath: '',
|
|
2749
2750
|
cachePath,
|
|
@@ -3151,62 +3152,56 @@ var __webpack_exports__ = {};
|
|
|
3151
3152
|
config: config.tools.cssLoader,
|
|
3152
3153
|
mergeFn: cjs_default()
|
|
3153
3154
|
}), !emitCss);
|
|
3154
|
-
}
|
|
3155
|
-
async function applyCSSRule({ rule, config, context, utils: { target, isProd, CHAIN_ID, environment } }) {
|
|
3156
|
-
let emitCss = config.output.emitCss ?? 'web' === target;
|
|
3157
|
-
if (emitCss) {
|
|
3158
|
-
if (config.output.injectStyles) {
|
|
3159
|
-
let styleLoaderOptions = reduceConfigs({
|
|
3160
|
-
initial: {},
|
|
3161
|
-
config: config.tools.styleLoader
|
|
3162
|
-
});
|
|
3163
|
-
rule.use(CHAIN_ID.USE.STYLE).loader(getCompiledPath('style-loader')).options(styleLoaderOptions);
|
|
3164
|
-
} else rule.use(CHAIN_ID.USE.MINI_CSS_EXTRACT).loader(getCssExtractPlugin().loader).options(config.tools.cssExtract.loaderOptions);
|
|
3165
|
-
} else rule.use(CHAIN_ID.USE.IGNORE_CSS).loader(external_node_path_default().join(LOADER_PATH, 'ignoreCssLoader.cjs'));
|
|
3166
|
-
let importLoaders = 0;
|
|
3167
|
-
if (rule.use(CHAIN_ID.USE.CSS).loader(getCompiledPath('css-loader')), emitCss) {
|
|
3168
|
-
var _postcssLoaderOptions_postcssOptions_plugins, _postcssLoaderOptions_postcssOptions;
|
|
3169
|
-
if ('rspack' === context.bundlerType && !1 !== config.tools.lightningcssLoader) {
|
|
3170
|
-
importLoaders++;
|
|
3171
|
-
let userOptions = !0 === config.tools.lightningcssLoader ? {} : config.tools.lightningcssLoader, initialOptions = {
|
|
3172
|
-
targets: environment.browserslist
|
|
3173
|
-
};
|
|
3174
|
-
'production' === config.mode && config.output.injectStyles && (initialOptions.minify = !0);
|
|
3175
|
-
let loaderOptions = reduceConfigs({
|
|
3176
|
-
initial: initialOptions,
|
|
3177
|
-
config: userOptions
|
|
3178
|
-
});
|
|
3179
|
-
rule.use(CHAIN_ID.USE.LIGHTNINGCSS).loader('builtin:lightningcss-loader').options(loaderOptions);
|
|
3180
|
-
}
|
|
3181
|
-
let postcssLoaderOptions = await getPostcssLoaderOptions({
|
|
3182
|
-
config,
|
|
3183
|
-
root: context.rootPath
|
|
3184
|
-
});
|
|
3185
|
-
('function' == typeof postcssLoaderOptions.postcssOptions || (null === (_postcssLoaderOptions_postcssOptions = postcssLoaderOptions.postcssOptions) || void 0 === _postcssLoaderOptions_postcssOptions ? void 0 : null === (_postcssLoaderOptions_postcssOptions_plugins = _postcssLoaderOptions_postcssOptions.plugins) || void 0 === _postcssLoaderOptions_postcssOptions_plugins ? void 0 : _postcssLoaderOptions_postcssOptions_plugins.length)) && (importLoaders++, rule.use(CHAIN_ID.USE.POSTCSS).loader(getCompiledPath('postcss-loader')).options(postcssLoaderOptions));
|
|
3186
|
-
}
|
|
3187
|
-
let localIdentName = getCSSModulesLocalIdentName(config, isProd), cssLoaderOptions = getCSSLoaderOptions({
|
|
3188
|
-
config,
|
|
3189
|
-
importLoaders,
|
|
3190
|
-
localIdentName,
|
|
3191
|
-
emitCss
|
|
3192
|
-
});
|
|
3193
|
-
rule.use(CHAIN_ID.USE.CSS).options(cssLoaderOptions), rule.merge({
|
|
3194
|
-
sideEffects: !0
|
|
3195
|
-
}), rule.resolve.preferRelative(!0);
|
|
3196
|
-
}
|
|
3197
|
-
let pluginCss = ()=>({
|
|
3155
|
+
}, pluginCss = ()=>({
|
|
3198
3156
|
name: 'rsbuild:css',
|
|
3199
3157
|
setup (api) {
|
|
3200
3158
|
api.modifyBundlerChain({
|
|
3201
3159
|
order: 'pre',
|
|
3202
|
-
handler: async (chain,
|
|
3203
|
-
let rule = chain.module.rule(
|
|
3204
|
-
rule.test(CSS_REGEX).type('javascript/auto')
|
|
3205
|
-
|
|
3206
|
-
|
|
3160
|
+
handler: async (chain, { target, isProd, CHAIN_ID, environment })=>{
|
|
3161
|
+
let rule = chain.module.rule(CHAIN_ID.RULE.CSS), { config } = environment;
|
|
3162
|
+
rule.test(CSS_REGEX).type('javascript/auto').dependency({
|
|
3163
|
+
not: 'url'
|
|
3164
|
+
});
|
|
3165
|
+
let emitCss = config.output.emitCss ?? 'web' === target;
|
|
3166
|
+
if (emitCss) {
|
|
3167
|
+
if (config.output.injectStyles) {
|
|
3168
|
+
let styleLoaderOptions = reduceConfigs({
|
|
3169
|
+
initial: {},
|
|
3170
|
+
config: config.tools.styleLoader
|
|
3171
|
+
});
|
|
3172
|
+
rule.use(CHAIN_ID.USE.STYLE).loader(getCompiledPath('style-loader')).options(styleLoaderOptions);
|
|
3173
|
+
} else rule.use(CHAIN_ID.USE.MINI_CSS_EXTRACT).loader(getCssExtractPlugin().loader).options(config.tools.cssExtract.loaderOptions);
|
|
3174
|
+
} else rule.use(CHAIN_ID.USE.IGNORE_CSS).loader(external_node_path_default().join(LOADER_PATH, 'ignoreCssLoader.cjs'));
|
|
3175
|
+
let importLoaders = 0;
|
|
3176
|
+
if (rule.use(CHAIN_ID.USE.CSS).loader(getCompiledPath('css-loader')), emitCss) {
|
|
3177
|
+
var _postcssLoaderOptions_postcssOptions_plugins, _postcssLoaderOptions_postcssOptions;
|
|
3178
|
+
if ('rspack' === api.context.bundlerType && !1 !== config.tools.lightningcssLoader) {
|
|
3179
|
+
importLoaders++;
|
|
3180
|
+
let userOptions = !0 === config.tools.lightningcssLoader ? {} : config.tools.lightningcssLoader, initialOptions = {
|
|
3181
|
+
targets: environment.browserslist
|
|
3182
|
+
};
|
|
3183
|
+
'production' === config.mode && config.output.injectStyles && (initialOptions.minify = !0);
|
|
3184
|
+
let loaderOptions = reduceConfigs({
|
|
3185
|
+
initial: initialOptions,
|
|
3186
|
+
config: userOptions
|
|
3187
|
+
});
|
|
3188
|
+
rule.use(CHAIN_ID.USE.LIGHTNINGCSS).loader('builtin:lightningcss-loader').options(loaderOptions);
|
|
3189
|
+
}
|
|
3190
|
+
let postcssLoaderOptions = await getPostcssLoaderOptions({
|
|
3191
|
+
config,
|
|
3192
|
+
root: api.context.rootPath
|
|
3193
|
+
});
|
|
3194
|
+
('function' == typeof postcssLoaderOptions.postcssOptions || (null === (_postcssLoaderOptions_postcssOptions = postcssLoaderOptions.postcssOptions) || void 0 === _postcssLoaderOptions_postcssOptions ? void 0 : null === (_postcssLoaderOptions_postcssOptions_plugins = _postcssLoaderOptions_postcssOptions.plugins) || void 0 === _postcssLoaderOptions_postcssOptions_plugins ? void 0 : _postcssLoaderOptions_postcssOptions_plugins.length)) && (importLoaders++, rule.use(CHAIN_ID.USE.POSTCSS).loader(getCompiledPath('postcss-loader')).options(postcssLoaderOptions));
|
|
3195
|
+
}
|
|
3196
|
+
let localIdentName = getCSSModulesLocalIdentName(config, isProd), cssLoaderOptions = getCSSLoaderOptions({
|
|
3207
3197
|
config,
|
|
3208
|
-
|
|
3198
|
+
importLoaders,
|
|
3199
|
+
localIdentName,
|
|
3200
|
+
emitCss
|
|
3209
3201
|
});
|
|
3202
|
+
rule.use(CHAIN_ID.USE.CSS).options(cssLoaderOptions), rule.merge({
|
|
3203
|
+
sideEffects: !0
|
|
3204
|
+
}), rule.resolve.preferRelative(!0);
|
|
3210
3205
|
}
|
|
3211
3206
|
});
|
|
3212
3207
|
}
|
|
@@ -4021,7 +4016,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4021
4016
|
let trailingSlashBase = addTrailingSlash(base);
|
|
4022
4017
|
return path.startsWith(trailingSlashBase) ? path.slice(trailingSlashBase.length - 1) : path;
|
|
4023
4018
|
}, getRoutes = (context)=>Object.values(context.environments).reduce((prev, environmentContext)=>{
|
|
4024
|
-
let { distPath, config } = environmentContext, distPrefix = external_node_path_.
|
|
4019
|
+
let { distPath, config } = environmentContext, distPrefix = (0, external_node_path_.relative)(context.distPath, distPath).split(external_node_path_.sep).join('/'), routes = formatRoutes(environmentContext.htmlPaths, context.normalizedConfig.server.base, external_node_path_.posix.join(distPrefix, config.output.distPath.html), config.html.outputStructure);
|
|
4025
4020
|
return prev.concat(...routes);
|
|
4026
4021
|
}, []), formatRoutes = (entry, base, distPathPrefix, outputStructure)=>{
|
|
4027
4022
|
let prefix = joinUrlSegments(base, formatPrefix(distPathPrefix));
|
|
@@ -4845,7 +4840,9 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
4845
4840
|
order: 'pre',
|
|
4846
4841
|
handler: async (chain, { CHAIN_ID, isDev, target, environment })=>{
|
|
4847
4842
|
var browserslist, target1;
|
|
4848
|
-
let { config, browserslist: browserslist1 } = environment, cacheRoot = external_node_path_default().join(api.context.cachePath, '.swc'), rule = chain.module.rule(CHAIN_ID.RULE.JS).test(SCRIPT_REGEX).type('javascript/auto')
|
|
4843
|
+
let { config, browserslist: browserslist1 } = environment, cacheRoot = external_node_path_default().join(api.context.cachePath, '.swc'), rule = chain.module.rule(CHAIN_ID.RULE.JS).test(SCRIPT_REGEX).type('javascript/auto').dependency({
|
|
4844
|
+
not: 'url'
|
|
4845
|
+
}), dataUriRule = chain.module.rule(CHAIN_ID.RULE.JS_DATA_URI).mimetype({
|
|
4849
4846
|
or: [
|
|
4850
4847
|
'text/javascript',
|
|
4851
4848
|
'application/javascript'
|
|
@@ -5521,6 +5518,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
5521
5518
|
errorDetails: !1,
|
|
5522
5519
|
entrypoints: !0,
|
|
5523
5520
|
children: !0,
|
|
5521
|
+
moduleTrace: !0,
|
|
5524
5522
|
...statsOptions
|
|
5525
5523
|
});
|
|
5526
5524
|
}
|
|
@@ -6327,6 +6325,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
6327
6325
|
let done = (stats)=>{
|
|
6328
6326
|
let statsOptions = getStatsOptions(compiler), statsJson = stats.toJson({
|
|
6329
6327
|
children: !0,
|
|
6328
|
+
moduleTrace: !0,
|
|
6330
6329
|
timings: !0,
|
|
6331
6330
|
preset: 'errors-warnings',
|
|
6332
6331
|
...statsOptions
|
|
@@ -7002,11 +7001,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
7002
7001
|
}
|
|
7003
7002
|
}();
|
|
7004
7003
|
let { npm_execpath } = process.env;
|
|
7005
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.1.
|
|
7004
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.1.4\n`);
|
|
7006
7005
|
}();
|
|
7007
7006
|
try {
|
|
7008
7007
|
!function() {
|
|
7009
|
-
program.name('rsbuild').usage('<command> [options]').version("1.1.
|
|
7008
|
+
program.name('rsbuild').usage('<command> [options]').version("1.1.4");
|
|
7010
7009
|
let devCommand = program.command('dev'), buildCommand = program.command('build'), previewCommand = program.command('preview'), inspectCommand = program.command('inspect');
|
|
7011
7010
|
[
|
|
7012
7011
|
devCommand,
|
|
@@ -7065,7 +7064,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
|
|
|
7065
7064
|
rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
|
|
7066
7065
|
}
|
|
7067
7066
|
}
|
|
7068
|
-
let src_version = "1.1.
|
|
7067
|
+
let src_version = "1.1.4";
|
|
7069
7068
|
})();
|
|
7070
7069
|
var __webpack_export_target__ = exports;
|
|
7071
7070
|
for(var i in __webpack_exports__)__webpack_export_target__[i] = __webpack_exports__[i];
|
package/dist/index.js
CHANGED
|
@@ -2168,7 +2168,7 @@ async function watchFilesForRestart(files, root, isBuildWatch, watchOptions) {
|
|
|
2168
2168
|
});
|
|
2169
2169
|
watcher.on('add', callback), watcher.on('change', callback), watcher.on('unlink', callback);
|
|
2170
2170
|
}
|
|
2171
|
-
async function config_loadConfig({ cwd = process.cwd(), path, envMode } = {}) {
|
|
2171
|
+
async function config_loadConfig({ cwd = process.cwd(), path, envMode, meta } = {}) {
|
|
2172
2172
|
let configExport;
|
|
2173
2173
|
let configFilePath = resolveConfigPath(cwd, path);
|
|
2174
2174
|
if (!configFilePath) return {
|
|
@@ -2200,7 +2200,8 @@ async function config_loadConfig({ cwd = process.cwd(), path, envMode } = {}) {
|
|
|
2200
2200
|
let command = process.argv[2], nodeEnv = getNodeEnv(), result = await configExport({
|
|
2201
2201
|
env: nodeEnv,
|
|
2202
2202
|
command,
|
|
2203
|
-
envMode: envMode || nodeEnv
|
|
2203
|
+
envMode: envMode || nodeEnv,
|
|
2204
|
+
meta
|
|
2204
2205
|
});
|
|
2205
2206
|
if (void 0 === result) throw Error('The config function must return a config object.');
|
|
2206
2207
|
return {
|
|
@@ -2633,7 +2634,7 @@ async function updateEnvironmentContext(context, configs) {
|
|
|
2633
2634
|
async function createContext(options, userConfig, bundlerType) {
|
|
2634
2635
|
let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache');
|
|
2635
2636
|
return {
|
|
2636
|
-
version: "1.1.
|
|
2637
|
+
version: "1.1.4",
|
|
2637
2638
|
rootPath,
|
|
2638
2639
|
distPath: '',
|
|
2639
2640
|
cachePath,
|
|
@@ -3040,62 +3041,56 @@ let isPostcssPluginCreator = (plugin)=>'function' == typeof plugin && !0 === plu
|
|
|
3040
3041
|
config: config.tools.cssLoader,
|
|
3041
3042
|
mergeFn: cjs_default()
|
|
3042
3043
|
}), !emitCss);
|
|
3043
|
-
}
|
|
3044
|
-
async function applyCSSRule({ rule, config, context, utils: { target, isProd, CHAIN_ID, environment } }) {
|
|
3045
|
-
let emitCss = config.output.emitCss ?? 'web' === target;
|
|
3046
|
-
if (emitCss) {
|
|
3047
|
-
if (config.output.injectStyles) {
|
|
3048
|
-
let styleLoaderOptions = reduceConfigs({
|
|
3049
|
-
initial: {},
|
|
3050
|
-
config: config.tools.styleLoader
|
|
3051
|
-
});
|
|
3052
|
-
rule.use(CHAIN_ID.USE.STYLE).loader(getCompiledPath('style-loader')).options(styleLoaderOptions);
|
|
3053
|
-
} else rule.use(CHAIN_ID.USE.MINI_CSS_EXTRACT).loader(getCssExtractPlugin().loader).options(config.tools.cssExtract.loaderOptions);
|
|
3054
|
-
} else rule.use(CHAIN_ID.USE.IGNORE_CSS).loader(external_node_path_.default.join(LOADER_PATH, 'ignoreCssLoader.cjs'));
|
|
3055
|
-
let importLoaders = 0;
|
|
3056
|
-
if (rule.use(CHAIN_ID.USE.CSS).loader(getCompiledPath('css-loader')), emitCss) {
|
|
3057
|
-
var _postcssLoaderOptions_postcssOptions_plugins, _postcssLoaderOptions_postcssOptions;
|
|
3058
|
-
if ('rspack' === context.bundlerType && !1 !== config.tools.lightningcssLoader) {
|
|
3059
|
-
importLoaders++;
|
|
3060
|
-
let userOptions = !0 === config.tools.lightningcssLoader ? {} : config.tools.lightningcssLoader, initialOptions = {
|
|
3061
|
-
targets: environment.browserslist
|
|
3062
|
-
};
|
|
3063
|
-
'production' === config.mode && config.output.injectStyles && (initialOptions.minify = !0);
|
|
3064
|
-
let loaderOptions = reduceConfigs({
|
|
3065
|
-
initial: initialOptions,
|
|
3066
|
-
config: userOptions
|
|
3067
|
-
});
|
|
3068
|
-
rule.use(CHAIN_ID.USE.LIGHTNINGCSS).loader('builtin:lightningcss-loader').options(loaderOptions);
|
|
3069
|
-
}
|
|
3070
|
-
let postcssLoaderOptions = await getPostcssLoaderOptions({
|
|
3071
|
-
config,
|
|
3072
|
-
root: context.rootPath
|
|
3073
|
-
});
|
|
3074
|
-
('function' == typeof postcssLoaderOptions.postcssOptions || (null === (_postcssLoaderOptions_postcssOptions = postcssLoaderOptions.postcssOptions) || void 0 === _postcssLoaderOptions_postcssOptions ? void 0 : null === (_postcssLoaderOptions_postcssOptions_plugins = _postcssLoaderOptions_postcssOptions.plugins) || void 0 === _postcssLoaderOptions_postcssOptions_plugins ? void 0 : _postcssLoaderOptions_postcssOptions_plugins.length)) && (importLoaders++, rule.use(CHAIN_ID.USE.POSTCSS).loader(getCompiledPath('postcss-loader')).options(postcssLoaderOptions));
|
|
3075
|
-
}
|
|
3076
|
-
let localIdentName = getCSSModulesLocalIdentName(config, isProd), cssLoaderOptions = getCSSLoaderOptions({
|
|
3077
|
-
config,
|
|
3078
|
-
importLoaders,
|
|
3079
|
-
localIdentName,
|
|
3080
|
-
emitCss
|
|
3081
|
-
});
|
|
3082
|
-
rule.use(CHAIN_ID.USE.CSS).options(cssLoaderOptions), rule.merge({
|
|
3083
|
-
sideEffects: !0
|
|
3084
|
-
}), rule.resolve.preferRelative(!0);
|
|
3085
|
-
}
|
|
3086
|
-
let pluginCss = ()=>({
|
|
3044
|
+
}, pluginCss = ()=>({
|
|
3087
3045
|
name: 'rsbuild:css',
|
|
3088
3046
|
setup (api) {
|
|
3089
3047
|
api.modifyBundlerChain({
|
|
3090
3048
|
order: 'pre',
|
|
3091
|
-
handler: async (chain,
|
|
3092
|
-
let rule = chain.module.rule(
|
|
3093
|
-
rule.test(CSS_REGEX).type('javascript/auto')
|
|
3094
|
-
|
|
3095
|
-
|
|
3049
|
+
handler: async (chain, { target, isProd, CHAIN_ID, environment })=>{
|
|
3050
|
+
let rule = chain.module.rule(CHAIN_ID.RULE.CSS), { config } = environment;
|
|
3051
|
+
rule.test(CSS_REGEX).type('javascript/auto').dependency({
|
|
3052
|
+
not: 'url'
|
|
3053
|
+
});
|
|
3054
|
+
let emitCss = config.output.emitCss ?? 'web' === target;
|
|
3055
|
+
if (emitCss) {
|
|
3056
|
+
if (config.output.injectStyles) {
|
|
3057
|
+
let styleLoaderOptions = reduceConfigs({
|
|
3058
|
+
initial: {},
|
|
3059
|
+
config: config.tools.styleLoader
|
|
3060
|
+
});
|
|
3061
|
+
rule.use(CHAIN_ID.USE.STYLE).loader(getCompiledPath('style-loader')).options(styleLoaderOptions);
|
|
3062
|
+
} else rule.use(CHAIN_ID.USE.MINI_CSS_EXTRACT).loader(getCssExtractPlugin().loader).options(config.tools.cssExtract.loaderOptions);
|
|
3063
|
+
} else rule.use(CHAIN_ID.USE.IGNORE_CSS).loader(external_node_path_.default.join(LOADER_PATH, 'ignoreCssLoader.cjs'));
|
|
3064
|
+
let importLoaders = 0;
|
|
3065
|
+
if (rule.use(CHAIN_ID.USE.CSS).loader(getCompiledPath('css-loader')), emitCss) {
|
|
3066
|
+
var _postcssLoaderOptions_postcssOptions_plugins, _postcssLoaderOptions_postcssOptions;
|
|
3067
|
+
if ('rspack' === api.context.bundlerType && !1 !== config.tools.lightningcssLoader) {
|
|
3068
|
+
importLoaders++;
|
|
3069
|
+
let userOptions = !0 === config.tools.lightningcssLoader ? {} : config.tools.lightningcssLoader, initialOptions = {
|
|
3070
|
+
targets: environment.browserslist
|
|
3071
|
+
};
|
|
3072
|
+
'production' === config.mode && config.output.injectStyles && (initialOptions.minify = !0);
|
|
3073
|
+
let loaderOptions = reduceConfigs({
|
|
3074
|
+
initial: initialOptions,
|
|
3075
|
+
config: userOptions
|
|
3076
|
+
});
|
|
3077
|
+
rule.use(CHAIN_ID.USE.LIGHTNINGCSS).loader('builtin:lightningcss-loader').options(loaderOptions);
|
|
3078
|
+
}
|
|
3079
|
+
let postcssLoaderOptions = await getPostcssLoaderOptions({
|
|
3080
|
+
config,
|
|
3081
|
+
root: api.context.rootPath
|
|
3082
|
+
});
|
|
3083
|
+
('function' == typeof postcssLoaderOptions.postcssOptions || (null === (_postcssLoaderOptions_postcssOptions = postcssLoaderOptions.postcssOptions) || void 0 === _postcssLoaderOptions_postcssOptions ? void 0 : null === (_postcssLoaderOptions_postcssOptions_plugins = _postcssLoaderOptions_postcssOptions.plugins) || void 0 === _postcssLoaderOptions_postcssOptions_plugins ? void 0 : _postcssLoaderOptions_postcssOptions_plugins.length)) && (importLoaders++, rule.use(CHAIN_ID.USE.POSTCSS).loader(getCompiledPath('postcss-loader')).options(postcssLoaderOptions));
|
|
3084
|
+
}
|
|
3085
|
+
let localIdentName = getCSSModulesLocalIdentName(config, isProd), cssLoaderOptions = getCSSLoaderOptions({
|
|
3096
3086
|
config,
|
|
3097
|
-
|
|
3087
|
+
importLoaders,
|
|
3088
|
+
localIdentName,
|
|
3089
|
+
emitCss
|
|
3098
3090
|
});
|
|
3091
|
+
rule.use(CHAIN_ID.USE.CSS).options(cssLoaderOptions), rule.merge({
|
|
3092
|
+
sideEffects: !0
|
|
3093
|
+
}), rule.resolve.preferRelative(!0);
|
|
3099
3094
|
}
|
|
3100
3095
|
});
|
|
3101
3096
|
}
|
|
@@ -3901,7 +3896,7 @@ let normalizeUrl = (url)=>url.replace(/([^:]\/)\/+/g, '$1'), formatPrefix = (inp
|
|
|
3901
3896
|
let trailingSlashBase = addTrailingSlash(base);
|
|
3902
3897
|
return path.startsWith(trailingSlashBase) ? path.slice(trailingSlashBase.length - 1) : path;
|
|
3903
3898
|
}, getRoutes = (context)=>Object.values(context.environments).reduce((prev, environmentContext)=>{
|
|
3904
|
-
let { distPath, config } = environmentContext, distPrefix = external_node_path_.
|
|
3899
|
+
let { distPath, config } = environmentContext, distPrefix = (0, external_node_path_.relative)(context.distPath, distPath).split(external_node_path_.sep).join('/'), routes = formatRoutes(environmentContext.htmlPaths, context.normalizedConfig.server.base, external_node_path_.posix.join(distPrefix, config.output.distPath.html), config.html.outputStructure);
|
|
3905
3900
|
return prev.concat(...routes);
|
|
3906
3901
|
}, []), formatRoutes = (entry, base, distPathPrefix, outputStructure)=>{
|
|
3907
3902
|
let prefix = joinUrlSegments(base, formatPrefix(distPathPrefix));
|
|
@@ -4721,7 +4716,9 @@ let resourceHints_generateLinks = (options, rel)=>options.map((option)=>({
|
|
|
4721
4716
|
order: 'pre',
|
|
4722
4717
|
handler: async (chain, { CHAIN_ID, isDev, target, environment })=>{
|
|
4723
4718
|
var browserslist, target1;
|
|
4724
|
-
let { config, browserslist: browserslist1 } = environment, cacheRoot = external_node_path_.default.join(api.context.cachePath, '.swc'), rule = chain.module.rule(CHAIN_ID.RULE.JS).test(SCRIPT_REGEX).type('javascript/auto')
|
|
4719
|
+
let { config, browserslist: browserslist1 } = environment, cacheRoot = external_node_path_.default.join(api.context.cachePath, '.swc'), rule = chain.module.rule(CHAIN_ID.RULE.JS).test(SCRIPT_REGEX).type('javascript/auto').dependency({
|
|
4720
|
+
not: 'url'
|
|
4721
|
+
}), dataUriRule = chain.module.rule(CHAIN_ID.RULE.JS_DATA_URI).mimetype({
|
|
4725
4722
|
or: [
|
|
4726
4723
|
'text/javascript',
|
|
4727
4724
|
'application/javascript'
|
|
@@ -5395,6 +5392,7 @@ class SocketServer {
|
|
|
5395
5392
|
errorDetails: !1,
|
|
5396
5393
|
entrypoints: !0,
|
|
5397
5394
|
children: !0,
|
|
5395
|
+
moduleTrace: !0,
|
|
5398
5396
|
...statsOptions
|
|
5399
5397
|
});
|
|
5400
5398
|
}
|
|
@@ -6196,6 +6194,7 @@ async function createCompiler_createCompiler(options) {
|
|
|
6196
6194
|
let done = (stats)=>{
|
|
6197
6195
|
let statsOptions = getStatsOptions(compiler), statsJson = stats.toJson({
|
|
6198
6196
|
children: !0,
|
|
6197
|
+
moduleTrace: !0,
|
|
6199
6198
|
timings: !0,
|
|
6200
6199
|
preset: 'errors-warnings',
|
|
6201
6200
|
...statsOptions
|
|
@@ -6871,11 +6870,11 @@ async function runCLI() {
|
|
|
6871
6870
|
}
|
|
6872
6871
|
}();
|
|
6873
6872
|
let { npm_execpath } = process.env;
|
|
6874
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.greet(` Rsbuild v1.1.
|
|
6873
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.greet(` Rsbuild v1.1.4\n`);
|
|
6875
6874
|
}();
|
|
6876
6875
|
try {
|
|
6877
6876
|
!function() {
|
|
6878
|
-
program.name('rsbuild').usage('<command> [options]').version("1.1.
|
|
6877
|
+
program.name('rsbuild').usage('<command> [options]').version("1.1.4");
|
|
6879
6878
|
let devCommand = program.command('dev'), buildCommand = program.command('build'), previewCommand = program.command('preview'), inspectCommand = program.command('inspect');
|
|
6880
6879
|
[
|
|
6881
6880
|
devCommand,
|
|
@@ -6934,6 +6933,6 @@ async function runCLI() {
|
|
|
6934
6933
|
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.error('Failed to start Rsbuild CLI.'), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.error(err);
|
|
6935
6934
|
}
|
|
6936
6935
|
}
|
|
6937
|
-
let src_version = "1.1.
|
|
6936
|
+
let src_version = "1.1.4";
|
|
6938
6937
|
var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger, __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rspack_core__.rspack;
|
|
6939
6938
|
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, internal_namespaceObject as __internalHelper, createRsbuild, defineConfig, ensureAssetPrefix, config_loadConfig as loadConfig, loadEnv, mergeRsbuildConfig, runCLI, src_version as version, __webpack_exports__logger as logger, __webpack_exports__rspack as rspack };
|
package/dist-types/config.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export type ConfigParams = {
|
|
|
12
12
|
env: string;
|
|
13
13
|
command: string;
|
|
14
14
|
envMode?: string;
|
|
15
|
+
meta?: Record<string, unknown>;
|
|
15
16
|
};
|
|
16
17
|
export type RsbuildConfigAsyncFn = (env: ConfigParams) => Promise<RsbuildConfig>;
|
|
17
18
|
export type RsbuildConfigSyncFn = (env: ConfigParams) => RsbuildConfig;
|
|
@@ -25,14 +26,39 @@ export declare function defineConfig(config: RsbuildConfigSyncFn): RsbuildConfig
|
|
|
25
26
|
export declare function defineConfig(config: RsbuildConfigAsyncFn): RsbuildConfigAsyncFn;
|
|
26
27
|
export declare function defineConfig(config: RsbuildConfigExport): RsbuildConfigExport;
|
|
27
28
|
export declare function watchFilesForRestart(files: string[], root: string, isBuildWatch: boolean, watchOptions?: ChokidarOptions): Promise<void>;
|
|
28
|
-
export
|
|
29
|
+
export type LoadConfigOptions = {
|
|
30
|
+
/**
|
|
31
|
+
* The root path to resolve the config file.
|
|
32
|
+
* @default process.cwd()
|
|
33
|
+
*/
|
|
29
34
|
cwd?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The path to the config file, can be a relative or absolute path.
|
|
37
|
+
* If `path` is not provided, the function will search for the config file in the `cwd`.
|
|
38
|
+
*/
|
|
30
39
|
path?: string;
|
|
40
|
+
/**
|
|
41
|
+
* A custom meta object to be passed into the config function of `defineConfig`.
|
|
42
|
+
*/
|
|
43
|
+
meta?: Record<string, unknown>;
|
|
44
|
+
/**
|
|
45
|
+
* The `envMode` passed into the config function of `defineConfig`.
|
|
46
|
+
* @default process.env.NODE_ENV
|
|
47
|
+
*/
|
|
31
48
|
envMode?: string;
|
|
32
|
-
}
|
|
49
|
+
};
|
|
50
|
+
export type LoadConfigResult = {
|
|
51
|
+
/**
|
|
52
|
+
* The loaded configuration object.
|
|
53
|
+
*/
|
|
33
54
|
content: RsbuildConfig;
|
|
55
|
+
/**
|
|
56
|
+
* The path to the loaded configuration file.
|
|
57
|
+
* Return `null` if the configuration file is not found.
|
|
58
|
+
*/
|
|
34
59
|
filePath: string | null;
|
|
35
|
-
}
|
|
60
|
+
};
|
|
61
|
+
export declare function loadConfig({ cwd, path, envMode, meta, }?: LoadConfigOptions): Promise<LoadConfigResult>;
|
|
36
62
|
export declare const getRsbuildInspectConfig: ({ normalizedConfig, inspectOptions, pluginManager, }: {
|
|
37
63
|
normalizedConfig: NormalizedConfig;
|
|
38
64
|
inspectOptions: InspectConfigOptions;
|
package/dist-types/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type * as Rspack from '@rspack/core';
|
|
|
7
7
|
import * as __internalHelper from './internal';
|
|
8
8
|
export { loadEnv } from './loadEnv';
|
|
9
9
|
export { createRsbuild } from './createRsbuild';
|
|
10
|
-
export { loadConfig, defineConfig } from './config';
|
|
10
|
+
export { loadConfig, defineConfig, type LoadConfigOptions, type LoadConfigResult, } from './config';
|
|
11
11
|
export { runCLI } from './cli';
|
|
12
12
|
export declare const version: string;
|
|
13
13
|
export { rspack };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"types.d.ts"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rspack/core": "1.1.
|
|
49
|
+
"@rspack/core": "~1.1.2",
|
|
50
50
|
"@rspack/lite-tapable": "~1.0.1",
|
|
51
51
|
"@swc/helpers": "^0.5.15",
|
|
52
52
|
"core-js": "~3.39.0"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@rslib/core": "0.0.18",
|
|
56
56
|
"@types/connect": "3.4.38",
|
|
57
57
|
"@types/fs-extra": "^11.0.4",
|
|
58
|
-
"@types/node": "^22.9.
|
|
58
|
+
"@types/node": "^22.9.1",
|
|
59
59
|
"@types/on-finished": "2.3.4",
|
|
60
60
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
61
61
|
"@types/ws": "^8.5.13",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"rimraf": "^6.0.1",
|
|
86
86
|
"rsbuild-dev-middleware": "0.1.2",
|
|
87
87
|
"rslog": "^1.2.3",
|
|
88
|
-
"rspack-chain": "^1.0
|
|
88
|
+
"rspack-chain": "^1.1.0",
|
|
89
89
|
"rspack-manifest-plugin": "5.0.2",
|
|
90
90
|
"sirv": "^3.0.0",
|
|
91
91
|
"style-loader": "3.3.4",
|