@rsbuild/core 1.0.15 → 1.0.17
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.d.ts +5 -0
- package/compiled/html-rspack-plugin/index.js +16 -15
- package/compiled/html-rspack-plugin/package.json +1 -1
- package/compiled/picocolors/index.d.ts +17 -18
- package/compiled/picocolors/index.js +56 -61
- package/compiled/picocolors/package.json +1 -1
- package/compiled/postcss-loader/index.js +8 -8
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/compiled/webpack-bundle-analyzer/index.js +57 -62
- package/dist/index.cjs +60 -15
- package/dist/index.js +62 -17
- package/dist-types/helpers/index.d.ts +3 -1
- package/dist-types/types/config.d.ts +2 -1
- package/dist-types/types/plugin.d.ts +16 -2
- package/package.json +4 -4
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
6754: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const loader = __nccwpck_require__(
|
|
5
|
+
const loader = __nccwpck_require__(7386);
|
|
6
6
|
module.exports = loader.default;
|
|
7
7
|
module.exports.defaultGetLocalIdent =
|
|
8
|
-
__nccwpck_require__(
|
|
8
|
+
__nccwpck_require__(3004).defaultGetLocalIdent;
|
|
9
9
|
},
|
|
10
|
-
|
|
10
|
+
7386: (__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__(3360));
|
|
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__(3087));
|
|
18
|
+
var _plugins = __nccwpck_require__(4077);
|
|
19
|
+
var _utils = __nccwpck_require__(3004);
|
|
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
|
+
4077: (__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__(1252),
|
|
269
269
|
);
|
|
270
270
|
var _postcssIcssParser = _interopRequireDefault(
|
|
271
|
-
__nccwpck_require__(
|
|
271
|
+
__nccwpck_require__(3170),
|
|
272
272
|
);
|
|
273
|
-
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(
|
|
273
|
+
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(4706));
|
|
274
274
|
function _interopRequireDefault(obj) {
|
|
275
275
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
276
276
|
}
|
|
277
277
|
},
|
|
278
|
-
|
|
278
|
+
3170: (__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__(8406);
|
|
283
|
-
var _utils = __nccwpck_require__(
|
|
283
|
+
var _utils = __nccwpck_require__(3004);
|
|
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
|
+
1252: (__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__(3004);
|
|
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
|
+
4706: (__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__(3004);
|
|
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
|
+
3004: (__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;
|
|
@@ -7960,7 +7960,7 @@
|
|
|
7960
7960
|
"use strict";
|
|
7961
7961
|
module.exports = require("util");
|
|
7962
7962
|
},
|
|
7963
|
-
|
|
7963
|
+
3087: (module) => {
|
|
7964
7964
|
"use strict";
|
|
7965
7965
|
module.exports = JSON.parse(
|
|
7966
7966
|
'{"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"}',
|
|
@@ -7995,6 +7995,6 @@
|
|
|
7995
7995
|
}
|
|
7996
7996
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
7997
7997
|
__nccwpck_require__.ab = __dirname + "/";
|
|
7998
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
7998
|
+
var __webpack_exports__ = __nccwpck_require__(6754);
|
|
7999
7999
|
module.exports = __webpack_exports__;
|
|
8000
8000
|
})();
|
|
@@ -16,8 +16,13 @@ declare class HtmlRspackPlugin {
|
|
|
16
16
|
|
|
17
17
|
apply(compiler: Compiler): void;
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated use `getCompilationHooks` instead
|
|
21
|
+
*/
|
|
19
22
|
static getHooks(compilation: Compilation): HtmlRspackPlugin.Hooks;
|
|
20
23
|
|
|
24
|
+
static getCompilationHooks(compilation: Compilation): HtmlRspackPlugin.Hooks;
|
|
25
|
+
|
|
21
26
|
/**
|
|
22
27
|
* Static helper to create a tag object to be get injected into the dom
|
|
23
28
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
909: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const { HtmlWebpackChildCompiler } = __nccwpck_require__(
|
|
5
|
+
const { HtmlWebpackChildCompiler } = __nccwpck_require__(903);
|
|
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
|
+
903: (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
|
+
78: (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
|
+
422: (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
|
+
9: (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
|
+
301: (module) => {
|
|
543
543
|
const voidTags = [
|
|
544
544
|
"area",
|
|
545
545
|
"base",
|
|
@@ -607,19 +607,19 @@
|
|
|
607
607
|
htmlTagObjectToString,
|
|
608
608
|
};
|
|
609
609
|
},
|
|
610
|
-
|
|
610
|
+
541: (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__(909);
|
|
617
617
|
const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
|
|
618
|
-
__nccwpck_require__(
|
|
619
|
-
const prettyError = __nccwpck_require__(
|
|
620
|
-
const chunkSorter = __nccwpck_require__(
|
|
618
|
+
__nccwpck_require__(301);
|
|
619
|
+
const prettyError = __nccwpck_require__(422);
|
|
620
|
+
const chunkSorter = __nccwpck_require__(78);
|
|
621
621
|
const getHtmlRspackPluginHooks =
|
|
622
|
-
__nccwpck_require__(
|
|
622
|
+
__nccwpck_require__(9).getHtmlRspackPluginHooks;
|
|
623
623
|
class HtmlRspackPlugin {
|
|
624
624
|
constructor(userOptions = {}) {
|
|
625
625
|
this.version = HtmlRspackPlugin.version;
|
|
@@ -1265,7 +1265,7 @@
|
|
|
1265
1265
|
fileContent,
|
|
1266
1266
|
compilation,
|
|
1267
1267
|
) {
|
|
1268
|
-
if (/\[
|
|
1268
|
+
if (/\[(?:[\w:]+)\]/.test(filename) === false) {
|
|
1269
1269
|
return { path: filename, info: {} };
|
|
1270
1270
|
}
|
|
1271
1271
|
const hash = compiler.webpack.util.createHash(
|
|
@@ -1530,6 +1530,7 @@
|
|
|
1530
1530
|
};
|
|
1531
1531
|
}
|
|
1532
1532
|
HtmlRspackPlugin.version = 6;
|
|
1533
|
+
HtmlRspackPlugin.getCompilationHooks = getHtmlRspackPluginHooks;
|
|
1533
1534
|
HtmlRspackPlugin.getHooks = getHtmlRspackPluginHooks;
|
|
1534
1535
|
HtmlRspackPlugin.createHtmlTagObject = createHtmlTagObject;
|
|
1535
1536
|
module.exports = HtmlRspackPlugin;
|
|
@@ -1577,6 +1578,6 @@
|
|
|
1577
1578
|
}
|
|
1578
1579
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
1579
1580
|
__nccwpck_require__.ab = __dirname + "/";
|
|
1580
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
1581
|
+
var __webpack_exports__ = __nccwpck_require__(541);
|
|
1581
1582
|
module.exports = __webpack_exports__;
|
|
1582
1583
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"html-rspack-plugin","author":"Jan Nicklas <j.nicklas@me.com> (https://github.com/jantimon)","version":"6.0.
|
|
1
|
+
{"name":"html-rspack-plugin","author":"Jan Nicklas <j.nicklas@me.com> (https://github.com/jantimon)","version":"6.0.2","funding":{"type":"opencollective","url":"https://opencollective.com/html-webpack-plugin"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
|
|
@@ -2,7 +2,7 @@ type Formatter = (input: string | number | null | undefined) => string
|
|
|
2
2
|
|
|
3
3
|
interface Colors {
|
|
4
4
|
isColorSupported: boolean
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
reset: Formatter
|
|
7
7
|
bold: Formatter
|
|
8
8
|
dim: Formatter
|
|
@@ -11,7 +11,7 @@ interface Colors {
|
|
|
11
11
|
inverse: Formatter
|
|
12
12
|
hidden: Formatter
|
|
13
13
|
strikethrough: Formatter
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
black: Formatter
|
|
16
16
|
red: Formatter
|
|
17
17
|
green: Formatter
|
|
@@ -21,7 +21,7 @@ interface Colors {
|
|
|
21
21
|
cyan: Formatter
|
|
22
22
|
white: Formatter
|
|
23
23
|
gray: Formatter
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
bgBlack: Formatter
|
|
26
26
|
bgRed: Formatter
|
|
27
27
|
bgGreen: Formatter
|
|
@@ -32,23 +32,22 @@ interface Colors {
|
|
|
32
32
|
bgWhite: Formatter
|
|
33
33
|
|
|
34
34
|
blackBright: Formatter
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
redBright: Formatter
|
|
36
|
+
greenBright: Formatter
|
|
37
|
+
yellowBright: Formatter
|
|
38
|
+
blueBright: Formatter
|
|
39
|
+
magentaBright: Formatter
|
|
40
|
+
cyanBright: Formatter
|
|
41
|
+
whiteBright: Formatter
|
|
42
42
|
|
|
43
43
|
bgBlackBright: Formatter
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
bgRedBright: Formatter
|
|
45
|
+
bgGreenBright: Formatter
|
|
46
|
+
bgYellowBright: Formatter
|
|
47
|
+
bgBlueBright: Formatter
|
|
48
|
+
bgMagentaBright: Formatter
|
|
49
|
+
bgCyanBright: Formatter
|
|
50
|
+
bgWhiteBright: Formatter
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors }
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
4
|
-
let
|
|
5
|
-
|
|
3
|
+
209: (module) => {
|
|
4
|
+
let p = process || {},
|
|
5
|
+
argv = p.argv || [],
|
|
6
|
+
env = p.env || {};
|
|
6
7
|
let isColorSupported =
|
|
7
|
-
!(
|
|
8
|
-
(
|
|
8
|
+
!(!!env.NO_COLOR || argv.includes("--no-color")) &&
|
|
9
|
+
(!!env.FORCE_COLOR ||
|
|
9
10
|
argv.includes("--color") ||
|
|
10
|
-
|
|
11
|
-
(
|
|
12
|
-
|
|
13
|
-
env.TERM !== "dumb") ||
|
|
14
|
-
"CI" in env);
|
|
11
|
+
p.platform === "win32" ||
|
|
12
|
+
((p.stdout || {}).isTTY && env.TERM !== "dumb") ||
|
|
13
|
+
!!env.CI);
|
|
15
14
|
let formatter =
|
|
16
15
|
(open, close, replace = open) =>
|
|
17
16
|
(input) => {
|
|
18
|
-
let string = "" + input
|
|
19
|
-
|
|
17
|
+
let string = "" + input,
|
|
18
|
+
index = string.indexOf(close, open.length);
|
|
20
19
|
return ~index
|
|
21
20
|
? open + replaceClose(string, close, replace, index) + close
|
|
22
21
|
: open + string + close;
|
|
23
22
|
};
|
|
24
23
|
let replaceClose = (string, close, replace, index) => {
|
|
25
|
-
let result = ""
|
|
26
|
-
|
|
24
|
+
let result = "",
|
|
25
|
+
cursor = 0;
|
|
27
26
|
do {
|
|
28
27
|
result += string.substring(cursor, index) + replace;
|
|
29
28
|
cursor = index + close.length;
|
|
@@ -32,59 +31,55 @@
|
|
|
32
31
|
return result + string.substring(cursor);
|
|
33
32
|
};
|
|
34
33
|
let createColors = (enabled = isColorSupported) => {
|
|
35
|
-
let
|
|
34
|
+
let f = enabled ? formatter : () => String;
|
|
36
35
|
return {
|
|
37
36
|
isColorSupported: enabled,
|
|
38
|
-
reset:
|
|
39
|
-
bold:
|
|
40
|
-
dim:
|
|
41
|
-
italic:
|
|
42
|
-
underline:
|
|
43
|
-
inverse:
|
|
44
|
-
hidden:
|
|
45
|
-
strikethrough:
|
|
46
|
-
black:
|
|
47
|
-
red:
|
|
48
|
-
green:
|
|
49
|
-
yellow:
|
|
50
|
-
blue:
|
|
51
|
-
magenta:
|
|
52
|
-
cyan:
|
|
53
|
-
white:
|
|
54
|
-
gray:
|
|
55
|
-
bgBlack:
|
|
56
|
-
bgRed:
|
|
57
|
-
bgGreen:
|
|
58
|
-
bgYellow:
|
|
59
|
-
bgBlue:
|
|
60
|
-
bgMagenta:
|
|
61
|
-
bgCyan:
|
|
62
|
-
bgWhite:
|
|
63
|
-
blackBright:
|
|
64
|
-
redBright:
|
|
65
|
-
greenBright:
|
|
66
|
-
yellowBright:
|
|
67
|
-
blueBright:
|
|
68
|
-
magentaBright:
|
|
69
|
-
cyanBright:
|
|
70
|
-
whiteBright:
|
|
71
|
-
bgBlackBright:
|
|
72
|
-
bgRedBright:
|
|
73
|
-
bgGreenBright:
|
|
74
|
-
bgYellowBright:
|
|
75
|
-
bgBlueBright:
|
|
76
|
-
bgMagentaBright:
|
|
77
|
-
bgCyanBright:
|
|
78
|
-
bgWhiteBright:
|
|
37
|
+
reset: f("[0m", "[0m"),
|
|
38
|
+
bold: f("[1m", "[22m", "[22m[1m"),
|
|
39
|
+
dim: f("[2m", "[22m", "[22m[2m"),
|
|
40
|
+
italic: f("[3m", "[23m"),
|
|
41
|
+
underline: f("[4m", "[24m"),
|
|
42
|
+
inverse: f("[7m", "[27m"),
|
|
43
|
+
hidden: f("[8m", "[28m"),
|
|
44
|
+
strikethrough: f("[9m", "[29m"),
|
|
45
|
+
black: f("[30m", "[39m"),
|
|
46
|
+
red: f("[31m", "[39m"),
|
|
47
|
+
green: f("[32m", "[39m"),
|
|
48
|
+
yellow: f("[33m", "[39m"),
|
|
49
|
+
blue: f("[34m", "[39m"),
|
|
50
|
+
magenta: f("[35m", "[39m"),
|
|
51
|
+
cyan: f("[36m", "[39m"),
|
|
52
|
+
white: f("[37m", "[39m"),
|
|
53
|
+
gray: f("[90m", "[39m"),
|
|
54
|
+
bgBlack: f("[40m", "[49m"),
|
|
55
|
+
bgRed: f("[41m", "[49m"),
|
|
56
|
+
bgGreen: f("[42m", "[49m"),
|
|
57
|
+
bgYellow: f("[43m", "[49m"),
|
|
58
|
+
bgBlue: f("[44m", "[49m"),
|
|
59
|
+
bgMagenta: f("[45m", "[49m"),
|
|
60
|
+
bgCyan: f("[46m", "[49m"),
|
|
61
|
+
bgWhite: f("[47m", "[49m"),
|
|
62
|
+
blackBright: f("[90m", "[39m"),
|
|
63
|
+
redBright: f("[91m", "[39m"),
|
|
64
|
+
greenBright: f("[92m", "[39m"),
|
|
65
|
+
yellowBright: f("[93m", "[39m"),
|
|
66
|
+
blueBright: f("[94m", "[39m"),
|
|
67
|
+
magentaBright: f("[95m", "[39m"),
|
|
68
|
+
cyanBright: f("[96m", "[39m"),
|
|
69
|
+
whiteBright: f("[97m", "[39m"),
|
|
70
|
+
bgBlackBright: f("[100m", "[49m"),
|
|
71
|
+
bgRedBright: f("[101m", "[49m"),
|
|
72
|
+
bgGreenBright: f("[102m", "[49m"),
|
|
73
|
+
bgYellowBright: f("[103m", "[49m"),
|
|
74
|
+
bgBlueBright: f("[104m", "[49m"),
|
|
75
|
+
bgMagentaBright: f("[105m", "[49m"),
|
|
76
|
+
bgCyanBright: f("[106m", "[49m"),
|
|
77
|
+
bgWhiteBright: f("[107m", "[49m"),
|
|
79
78
|
};
|
|
80
79
|
};
|
|
81
80
|
module.exports = createColors();
|
|
82
81
|
module.exports.createColors = createColors;
|
|
83
82
|
},
|
|
84
|
-
224: (module) => {
|
|
85
|
-
"use strict";
|
|
86
|
-
module.exports = require("tty");
|
|
87
|
-
},
|
|
88
83
|
};
|
|
89
84
|
var __webpack_module_cache__ = {};
|
|
90
85
|
function __nccwpck_require__(moduleId) {
|
|
@@ -108,6 +103,6 @@
|
|
|
108
103
|
}
|
|
109
104
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
110
105
|
__nccwpck_require__.ab = __dirname + "/";
|
|
111
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
106
|
+
var __webpack_exports__ = __nccwpck_require__(209);
|
|
112
107
|
module.exports = __webpack_exports__;
|
|
113
108
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"picocolors","author":"Alexey Raspopov","version":"1.1.
|
|
1
|
+
{"name":"picocolors","author":"Alexey Raspopov","version":"1.1.1","license":"ISC","types":"index.d.ts","type":"commonjs"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
777: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(779)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
779: (__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__(360));
|
|
13
|
-
var _options = _interopRequireDefault(__nccwpck_require__(
|
|
14
|
-
var _utils = __nccwpck_require__(
|
|
13
|
+
var _options = _interopRequireDefault(__nccwpck_require__(723));
|
|
14
|
+
var _utils = __nccwpck_require__(974);
|
|
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
|
+
974: (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
|
+
723: (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__(777);
|
|
740
740
|
module.exports = __webpack_exports__;
|
|
741
741
|
})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
4
|
+
248: (__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
|
+
458: (__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__(248);
|
|
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__(458);
|
|
316
316
|
Object.defineProperty(exports, "getCompilerHooks", {
|
|
317
317
|
enumerable: true,
|
|
318
318
|
get: function () {
|
|
@@ -8903,30 +8903,29 @@
|
|
|
8903
8903
|
return childProcess.execFile(command, args, options, callback);
|
|
8904
8904
|
};
|
|
8905
8905
|
},
|
|
8906
|
-
|
|
8907
|
-
let
|
|
8908
|
-
|
|
8906
|
+
5209: (module) => {
|
|
8907
|
+
let p = process || {},
|
|
8908
|
+
argv = p.argv || [],
|
|
8909
|
+
env = p.env || {};
|
|
8909
8910
|
let isColorSupported =
|
|
8910
|
-
!(
|
|
8911
|
-
(
|
|
8911
|
+
!(!!env.NO_COLOR || argv.includes("--no-color")) &&
|
|
8912
|
+
(!!env.FORCE_COLOR ||
|
|
8912
8913
|
argv.includes("--color") ||
|
|
8913
|
-
|
|
8914
|
-
(
|
|
8915
|
-
|
|
8916
|
-
env.TERM !== "dumb") ||
|
|
8917
|
-
"CI" in env);
|
|
8914
|
+
p.platform === "win32" ||
|
|
8915
|
+
((p.stdout || {}).isTTY && env.TERM !== "dumb") ||
|
|
8916
|
+
!!env.CI);
|
|
8918
8917
|
let formatter =
|
|
8919
8918
|
(open, close, replace = open) =>
|
|
8920
8919
|
(input) => {
|
|
8921
|
-
let string = "" + input
|
|
8922
|
-
|
|
8920
|
+
let string = "" + input,
|
|
8921
|
+
index = string.indexOf(close, open.length);
|
|
8923
8922
|
return ~index
|
|
8924
8923
|
? open + replaceClose(string, close, replace, index) + close
|
|
8925
8924
|
: open + string + close;
|
|
8926
8925
|
};
|
|
8927
8926
|
let replaceClose = (string, close, replace, index) => {
|
|
8928
|
-
let result = ""
|
|
8929
|
-
|
|
8927
|
+
let result = "",
|
|
8928
|
+
cursor = 0;
|
|
8930
8929
|
do {
|
|
8931
8930
|
result += string.substring(cursor, index) + replace;
|
|
8932
8931
|
cursor = index + close.length;
|
|
@@ -8935,50 +8934,50 @@
|
|
|
8935
8934
|
return result + string.substring(cursor);
|
|
8936
8935
|
};
|
|
8937
8936
|
let createColors = (enabled = isColorSupported) => {
|
|
8938
|
-
let
|
|
8937
|
+
let f = enabled ? formatter : () => String;
|
|
8939
8938
|
return {
|
|
8940
8939
|
isColorSupported: enabled,
|
|
8941
|
-
reset:
|
|
8942
|
-
bold:
|
|
8943
|
-
dim:
|
|
8944
|
-
italic:
|
|
8945
|
-
underline:
|
|
8946
|
-
inverse:
|
|
8947
|
-
hidden:
|
|
8948
|
-
strikethrough:
|
|
8949
|
-
black:
|
|
8950
|
-
red:
|
|
8951
|
-
green:
|
|
8952
|
-
yellow:
|
|
8953
|
-
blue:
|
|
8954
|
-
magenta:
|
|
8955
|
-
cyan:
|
|
8956
|
-
white:
|
|
8957
|
-
gray:
|
|
8958
|
-
bgBlack:
|
|
8959
|
-
bgRed:
|
|
8960
|
-
bgGreen:
|
|
8961
|
-
bgYellow:
|
|
8962
|
-
bgBlue:
|
|
8963
|
-
bgMagenta:
|
|
8964
|
-
bgCyan:
|
|
8965
|
-
bgWhite:
|
|
8966
|
-
blackBright:
|
|
8967
|
-
redBright:
|
|
8968
|
-
greenBright:
|
|
8969
|
-
yellowBright:
|
|
8970
|
-
blueBright:
|
|
8971
|
-
magentaBright:
|
|
8972
|
-
cyanBright:
|
|
8973
|
-
whiteBright:
|
|
8974
|
-
bgBlackBright:
|
|
8975
|
-
bgRedBright:
|
|
8976
|
-
bgGreenBright:
|
|
8977
|
-
bgYellowBright:
|
|
8978
|
-
bgBlueBright:
|
|
8979
|
-
bgMagentaBright:
|
|
8980
|
-
bgCyanBright:
|
|
8981
|
-
bgWhiteBright:
|
|
8940
|
+
reset: f("[0m", "[0m"),
|
|
8941
|
+
bold: f("[1m", "[22m", "[22m[1m"),
|
|
8942
|
+
dim: f("[2m", "[22m", "[22m[2m"),
|
|
8943
|
+
italic: f("[3m", "[23m"),
|
|
8944
|
+
underline: f("[4m", "[24m"),
|
|
8945
|
+
inverse: f("[7m", "[27m"),
|
|
8946
|
+
hidden: f("[8m", "[28m"),
|
|
8947
|
+
strikethrough: f("[9m", "[29m"),
|
|
8948
|
+
black: f("[30m", "[39m"),
|
|
8949
|
+
red: f("[31m", "[39m"),
|
|
8950
|
+
green: f("[32m", "[39m"),
|
|
8951
|
+
yellow: f("[33m", "[39m"),
|
|
8952
|
+
blue: f("[34m", "[39m"),
|
|
8953
|
+
magenta: f("[35m", "[39m"),
|
|
8954
|
+
cyan: f("[36m", "[39m"),
|
|
8955
|
+
white: f("[37m", "[39m"),
|
|
8956
|
+
gray: f("[90m", "[39m"),
|
|
8957
|
+
bgBlack: f("[40m", "[49m"),
|
|
8958
|
+
bgRed: f("[41m", "[49m"),
|
|
8959
|
+
bgGreen: f("[42m", "[49m"),
|
|
8960
|
+
bgYellow: f("[43m", "[49m"),
|
|
8961
|
+
bgBlue: f("[44m", "[49m"),
|
|
8962
|
+
bgMagenta: f("[45m", "[49m"),
|
|
8963
|
+
bgCyan: f("[46m", "[49m"),
|
|
8964
|
+
bgWhite: f("[47m", "[49m"),
|
|
8965
|
+
blackBright: f("[90m", "[39m"),
|
|
8966
|
+
redBright: f("[91m", "[39m"),
|
|
8967
|
+
greenBright: f("[92m", "[39m"),
|
|
8968
|
+
yellowBright: f("[93m", "[39m"),
|
|
8969
|
+
blueBright: f("[94m", "[39m"),
|
|
8970
|
+
magentaBright: f("[95m", "[39m"),
|
|
8971
|
+
cyanBright: f("[96m", "[39m"),
|
|
8972
|
+
whiteBright: f("[97m", "[39m"),
|
|
8973
|
+
bgBlackBright: f("[100m", "[49m"),
|
|
8974
|
+
bgRedBright: f("[101m", "[49m"),
|
|
8975
|
+
bgGreenBright: f("[102m", "[49m"),
|
|
8976
|
+
bgYellowBright: f("[103m", "[49m"),
|
|
8977
|
+
bgBlueBright: f("[104m", "[49m"),
|
|
8978
|
+
bgMagentaBright: f("[105m", "[49m"),
|
|
8979
|
+
bgCyanBright: f("[106m", "[49m"),
|
|
8980
|
+
bgWhiteBright: f("[107m", "[49m"),
|
|
8982
8981
|
};
|
|
8983
8982
|
};
|
|
8984
8983
|
module.exports = createColors();
|
|
@@ -9180,7 +9179,7 @@
|
|
|
9180
9179
|
"use strict";
|
|
9181
9180
|
const fs = __nccwpck_require__(7147);
|
|
9182
9181
|
const path = __nccwpck_require__(1017);
|
|
9183
|
-
const { bold } = __nccwpck_require__(
|
|
9182
|
+
const { bold } = __nccwpck_require__(5209);
|
|
9184
9183
|
const Logger = __nccwpck_require__(1283);
|
|
9185
9184
|
const viewer = __nccwpck_require__(7498);
|
|
9186
9185
|
const utils = __nccwpck_require__(5554);
|
|
@@ -10522,7 +10521,7 @@
|
|
|
10522
10521
|
const http = __nccwpck_require__(3685);
|
|
10523
10522
|
const WebSocket = __nccwpck_require__(6057);
|
|
10524
10523
|
const sirv = __nccwpck_require__(2486);
|
|
10525
|
-
const { bold } = __nccwpck_require__(
|
|
10524
|
+
const { bold } = __nccwpck_require__(5209);
|
|
10526
10525
|
const Logger = __nccwpck_require__(1283);
|
|
10527
10526
|
const analyzer = __nccwpck_require__(3377);
|
|
10528
10527
|
const { open } = __nccwpck_require__(5554);
|
|
@@ -13284,10 +13283,6 @@
|
|
|
13284
13283
|
"use strict";
|
|
13285
13284
|
module.exports = require("tls");
|
|
13286
13285
|
},
|
|
13287
|
-
6224: (module) => {
|
|
13288
|
-
"use strict";
|
|
13289
|
-
module.exports = require("tty");
|
|
13290
|
-
},
|
|
13291
13286
|
7310: (module) => {
|
|
13292
13287
|
"use strict";
|
|
13293
13288
|
module.exports = require("url");
|
package/dist/index.cjs
CHANGED
|
@@ -5728,11 +5728,31 @@ function initPluginAPI({
|
|
|
5728
5728
|
let transformId = 0;
|
|
5729
5729
|
const transformer = {};
|
|
5730
5730
|
const processAssetsFns = [];
|
|
5731
|
+
const resolveFns = [];
|
|
5731
5732
|
hooks.modifyBundlerChain.tap((chain, { target, environment }) => {
|
|
5732
5733
|
const pluginName = "RsbuildCorePlugin";
|
|
5733
5734
|
class RsbuildCorePlugin {
|
|
5734
5735
|
apply(compiler) {
|
|
5735
5736
|
compiler.__rsbuildTransformer = transformer;
|
|
5737
|
+
for (const { handler, environment: pluginEnvironment } of resolveFns) {
|
|
5738
|
+
if (pluginEnvironment && !isPluginMatchEnvironment(pluginEnvironment, environment.name)) {
|
|
5739
|
+
return;
|
|
5740
|
+
}
|
|
5741
|
+
compiler.hooks.compilation.tap(
|
|
5742
|
+
pluginName,
|
|
5743
|
+
(compilation, { normalModuleFactory }) => {
|
|
5744
|
+
normalModuleFactory.hooks.resolve.tapPromise(
|
|
5745
|
+
pluginName,
|
|
5746
|
+
async (resolveData) => handler({
|
|
5747
|
+
compiler,
|
|
5748
|
+
compilation,
|
|
5749
|
+
environment,
|
|
5750
|
+
resolveData
|
|
5751
|
+
})
|
|
5752
|
+
);
|
|
5753
|
+
}
|
|
5754
|
+
);
|
|
5755
|
+
}
|
|
5736
5756
|
compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {
|
|
5737
5757
|
compilation.hooks.childCompiler.tap(pluginName, (childCompiler) => {
|
|
5738
5758
|
childCompiler.__rsbuildTransformer = transformer;
|
|
@@ -5800,6 +5820,9 @@ function initPluginAPI({
|
|
|
5800
5820
|
const setProcessAssets = (environment) => (descriptor, handler) => {
|
|
5801
5821
|
processAssetsFns.push({ environment, descriptor, handler });
|
|
5802
5822
|
};
|
|
5823
|
+
const setResolve = (environment) => (handler) => {
|
|
5824
|
+
resolveFns.push({ environment, handler });
|
|
5825
|
+
};
|
|
5803
5826
|
let onExitListened = false;
|
|
5804
5827
|
const onExit = (cb) => {
|
|
5805
5828
|
if (!onExitListened) {
|
|
@@ -5816,6 +5839,7 @@ function initPluginAPI({
|
|
|
5816
5839
|
transform: getTransformFn(environment),
|
|
5817
5840
|
useExposed,
|
|
5818
5841
|
processAssets: setProcessAssets(environment),
|
|
5842
|
+
resolve: setResolve(environment),
|
|
5819
5843
|
getRsbuildConfig,
|
|
5820
5844
|
getNormalizedConfig,
|
|
5821
5845
|
isPluginExists: pluginManager.isPluginExists,
|
|
@@ -6018,7 +6042,7 @@ async function createContext(options, userConfig, bundlerType) {
|
|
|
6018
6042
|
const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
|
|
6019
6043
|
const cachePath = (0, import_node_path10.join)(rootPath, "node_modules", ".cache");
|
|
6020
6044
|
return {
|
|
6021
|
-
version: "1.0.
|
|
6045
|
+
version: "1.0.17",
|
|
6022
6046
|
rootPath,
|
|
6023
6047
|
distPath: "",
|
|
6024
6048
|
cachePath,
|
|
@@ -6504,6 +6528,16 @@ async function getConfigUtils(config, chainUtils) {
|
|
|
6504
6528
|
}
|
|
6505
6529
|
config.module.rules.unshift(...ruleArr);
|
|
6506
6530
|
},
|
|
6531
|
+
appendRules(rules) {
|
|
6532
|
+
const ruleArr = castArray(rules);
|
|
6533
|
+
if (!config.module) {
|
|
6534
|
+
config.module = {};
|
|
6535
|
+
}
|
|
6536
|
+
if (!config.module.rules) {
|
|
6537
|
+
config.module.rules = [];
|
|
6538
|
+
}
|
|
6539
|
+
config.module.rules.push(...ruleArr);
|
|
6540
|
+
},
|
|
6507
6541
|
prependPlugins(plugins) {
|
|
6508
6542
|
const pluginArr = castArray(plugins);
|
|
6509
6543
|
if (!config.plugins) {
|
|
@@ -9767,7 +9801,7 @@ function getPublicPath({
|
|
|
9767
9801
|
config,
|
|
9768
9802
|
context
|
|
9769
9803
|
}) {
|
|
9770
|
-
const { dev, output } = config;
|
|
9804
|
+
const { dev, output, server } = config;
|
|
9771
9805
|
let publicPath = DEFAULT_ASSET_PREFIX;
|
|
9772
9806
|
const port = context.devServer?.port || DEFAULT_PORT;
|
|
9773
9807
|
if (isProd) {
|
|
@@ -9785,6 +9819,9 @@ function getPublicPath({
|
|
|
9785
9819
|
} else {
|
|
9786
9820
|
publicPath = `${protocol}://${hostname}:<port>/`;
|
|
9787
9821
|
}
|
|
9822
|
+
if (server.base && server.base !== "/") {
|
|
9823
|
+
publicPath = urlJoin(publicPath, server.base);
|
|
9824
|
+
}
|
|
9788
9825
|
}
|
|
9789
9826
|
return formatPublicPath(replacePortPlaceholder(publicPath, port));
|
|
9790
9827
|
}
|
|
@@ -9853,11 +9890,18 @@ var init_output = __esm({
|
|
|
9853
9890
|
const extractPluginOptions = config.tools.cssExtract.pluginOptions;
|
|
9854
9891
|
const cssPath = config.output.distPath.css;
|
|
9855
9892
|
const cssFilename = getFilename(config, "css", isProd);
|
|
9893
|
+
const isCssFilenameFn = typeof cssFilename === "function";
|
|
9856
9894
|
const cssAsyncPath = config.output.distPath.cssAsync ?? (cssPath ? `${cssPath}/async` : "async");
|
|
9857
9895
|
chain.plugin(CHAIN_ID2.PLUGIN.MINI_CSS_EXTRACT).use(getCssExtractPlugin(), [
|
|
9858
9896
|
{
|
|
9859
|
-
filename:
|
|
9860
|
-
|
|
9897
|
+
filename: isCssFilenameFn ? (...args) => {
|
|
9898
|
+
const name = cssFilename(...args);
|
|
9899
|
+
return import_node_path22.posix.join(cssPath, name);
|
|
9900
|
+
} : import_node_path22.posix.join(cssPath, cssFilename),
|
|
9901
|
+
chunkFilename: isCssFilenameFn ? (...args) => {
|
|
9902
|
+
const name = cssFilename(...args);
|
|
9903
|
+
return import_node_path22.posix.join(cssAsyncPath, name);
|
|
9904
|
+
} : import_node_path22.posix.join(cssAsyncPath, cssFilename),
|
|
9861
9905
|
...extractPluginOptions
|
|
9862
9906
|
}
|
|
9863
9907
|
]);
|
|
@@ -12599,10 +12643,16 @@ function pluginModuleFederation() {
|
|
|
12599
12643
|
if (!moduleFederation?.options) {
|
|
12600
12644
|
return;
|
|
12601
12645
|
}
|
|
12602
|
-
if (moduleFederation.options.exposes
|
|
12646
|
+
if (moduleFederation.options.exposes) {
|
|
12603
12647
|
config.dev ||= {};
|
|
12604
|
-
config.dev.client
|
|
12605
|
-
|
|
12648
|
+
if (config.server?.port && !config.dev.client?.port) {
|
|
12649
|
+
config.dev.client ||= {};
|
|
12650
|
+
config.dev.client.port = config.server.port;
|
|
12651
|
+
}
|
|
12652
|
+
const originalConfig = api.getRsbuildConfig("original");
|
|
12653
|
+
if (originalConfig.dev?.assetPrefix === void 0 && config.dev.assetPrefix === config.server?.base) {
|
|
12654
|
+
config.dev.assetPrefix = true;
|
|
12655
|
+
}
|
|
12606
12656
|
}
|
|
12607
12657
|
});
|
|
12608
12658
|
api.modifyEnvironmentConfig((config) => {
|
|
@@ -12637,10 +12687,6 @@ function pluginModuleFederation() {
|
|
|
12637
12687
|
chain.output.set("uniqueName", options.name);
|
|
12638
12688
|
}
|
|
12639
12689
|
}
|
|
12640
|
-
const publicPath = chain.output.get("publicPath");
|
|
12641
|
-
if (publicPath === DEFAULT_ASSET_PREFIX) {
|
|
12642
|
-
chain.output.set("publicPath", "auto");
|
|
12643
|
-
}
|
|
12644
12690
|
}
|
|
12645
12691
|
);
|
|
12646
12692
|
}
|
|
@@ -12652,7 +12698,6 @@ var init_moduleFederation = __esm({
|
|
|
12652
12698
|
"use strict";
|
|
12653
12699
|
import_types2 = require("util/types");
|
|
12654
12700
|
import_core8 = require("@rspack/core");
|
|
12655
|
-
init_constants();
|
|
12656
12701
|
PatchSplitChunksPlugin = class {
|
|
12657
12702
|
constructor(name) {
|
|
12658
12703
|
__publicField(this, "name");
|
|
@@ -13564,7 +13609,7 @@ var init_init = __esm({
|
|
|
13564
13609
|
|
|
13565
13610
|
// src/cli/commands.ts
|
|
13566
13611
|
function runCli() {
|
|
13567
|
-
program.name("rsbuild").usage("<command> [options]").version("1.0.
|
|
13612
|
+
program.name("rsbuild").usage("<command> [options]").version("1.0.17");
|
|
13568
13613
|
const devCommand = program.command("dev");
|
|
13569
13614
|
const buildCommand = program.command("build");
|
|
13570
13615
|
const previewCommand = program.command("preview");
|
|
@@ -13673,7 +13718,7 @@ function prepareCli() {
|
|
|
13673
13718
|
if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
|
|
13674
13719
|
console.log();
|
|
13675
13720
|
}
|
|
13676
|
-
import_rslog.logger.greet(` ${`Rsbuild v${"1.0.
|
|
13721
|
+
import_rslog.logger.greet(` ${`Rsbuild v${"1.0.17"}`}
|
|
13677
13722
|
`);
|
|
13678
13723
|
}
|
|
13679
13724
|
var import_node_module;
|
|
@@ -13759,7 +13804,7 @@ init_logger();
|
|
|
13759
13804
|
init_mergeConfig();
|
|
13760
13805
|
init_helpers();
|
|
13761
13806
|
init_constants();
|
|
13762
|
-
var version = "1.0.
|
|
13807
|
+
var version = "1.0.17";
|
|
13763
13808
|
// Annotate the CommonJS export names for ESM import in node:
|
|
13764
13809
|
0 && (module.exports = {
|
|
13765
13810
|
PLUGIN_CSS_NAME,
|
package/dist/index.js
CHANGED
|
@@ -46,12 +46,12 @@ var __publicField = (obj, key, value) => {
|
|
|
46
46
|
return value;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
// ../../node_modules/.pnpm/@modern-js+module-tools@2.60.
|
|
49
|
+
// ../../node_modules/.pnpm/@modern-js+module-tools@2.60.4_typescript@5.6.3/node_modules/@modern-js/module-tools/shims/esm.js
|
|
50
50
|
import path from "path";
|
|
51
51
|
import { fileURLToPath } from "url";
|
|
52
52
|
var getFilename, getDirname, __dirname, __filename;
|
|
53
53
|
var init_esm = __esm({
|
|
54
|
-
"../../node_modules/.pnpm/@modern-js+module-tools@2.60.
|
|
54
|
+
"../../node_modules/.pnpm/@modern-js+module-tools@2.60.4_typescript@5.6.3/node_modules/@modern-js/module-tools/shims/esm.js"() {
|
|
55
55
|
"use strict";
|
|
56
56
|
getFilename = () => fileURLToPath(import.meta.url);
|
|
57
57
|
getDirname = () => path.dirname(getFilename());
|
|
@@ -5776,11 +5776,31 @@ function initPluginAPI({
|
|
|
5776
5776
|
let transformId = 0;
|
|
5777
5777
|
const transformer = {};
|
|
5778
5778
|
const processAssetsFns = [];
|
|
5779
|
+
const resolveFns = [];
|
|
5779
5780
|
hooks.modifyBundlerChain.tap((chain, { target, environment }) => {
|
|
5780
5781
|
const pluginName = "RsbuildCorePlugin";
|
|
5781
5782
|
class RsbuildCorePlugin {
|
|
5782
5783
|
apply(compiler) {
|
|
5783
5784
|
compiler.__rsbuildTransformer = transformer;
|
|
5785
|
+
for (const { handler, environment: pluginEnvironment } of resolveFns) {
|
|
5786
|
+
if (pluginEnvironment && !isPluginMatchEnvironment(pluginEnvironment, environment.name)) {
|
|
5787
|
+
return;
|
|
5788
|
+
}
|
|
5789
|
+
compiler.hooks.compilation.tap(
|
|
5790
|
+
pluginName,
|
|
5791
|
+
(compilation, { normalModuleFactory }) => {
|
|
5792
|
+
normalModuleFactory.hooks.resolve.tapPromise(
|
|
5793
|
+
pluginName,
|
|
5794
|
+
async (resolveData) => handler({
|
|
5795
|
+
compiler,
|
|
5796
|
+
compilation,
|
|
5797
|
+
environment,
|
|
5798
|
+
resolveData
|
|
5799
|
+
})
|
|
5800
|
+
);
|
|
5801
|
+
}
|
|
5802
|
+
);
|
|
5803
|
+
}
|
|
5784
5804
|
compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {
|
|
5785
5805
|
compilation.hooks.childCompiler.tap(pluginName, (childCompiler) => {
|
|
5786
5806
|
childCompiler.__rsbuildTransformer = transformer;
|
|
@@ -5848,6 +5868,9 @@ function initPluginAPI({
|
|
|
5848
5868
|
const setProcessAssets = (environment) => (descriptor, handler) => {
|
|
5849
5869
|
processAssetsFns.push({ environment, descriptor, handler });
|
|
5850
5870
|
};
|
|
5871
|
+
const setResolve = (environment) => (handler) => {
|
|
5872
|
+
resolveFns.push({ environment, handler });
|
|
5873
|
+
};
|
|
5851
5874
|
let onExitListened = false;
|
|
5852
5875
|
const onExit = (cb) => {
|
|
5853
5876
|
if (!onExitListened) {
|
|
@@ -5864,6 +5887,7 @@ function initPluginAPI({
|
|
|
5864
5887
|
transform: getTransformFn(environment),
|
|
5865
5888
|
useExposed,
|
|
5866
5889
|
processAssets: setProcessAssets(environment),
|
|
5890
|
+
resolve: setResolve(environment),
|
|
5867
5891
|
getRsbuildConfig,
|
|
5868
5892
|
getNormalizedConfig,
|
|
5869
5893
|
isPluginExists: pluginManager.isPluginExists,
|
|
@@ -6067,7 +6091,7 @@ async function createContext(options, userConfig, bundlerType) {
|
|
|
6067
6091
|
const rsbuildConfig = await withDefaultConfig(rootPath, userConfig);
|
|
6068
6092
|
const cachePath = join6(rootPath, "node_modules", ".cache");
|
|
6069
6093
|
return {
|
|
6070
|
-
version: "1.0.
|
|
6094
|
+
version: "1.0.17",
|
|
6071
6095
|
rootPath,
|
|
6072
6096
|
distPath: "",
|
|
6073
6097
|
cachePath,
|
|
@@ -6559,6 +6583,16 @@ async function getConfigUtils(config, chainUtils) {
|
|
|
6559
6583
|
}
|
|
6560
6584
|
config.module.rules.unshift(...ruleArr);
|
|
6561
6585
|
},
|
|
6586
|
+
appendRules(rules) {
|
|
6587
|
+
const ruleArr = castArray(rules);
|
|
6588
|
+
if (!config.module) {
|
|
6589
|
+
config.module = {};
|
|
6590
|
+
}
|
|
6591
|
+
if (!config.module.rules) {
|
|
6592
|
+
config.module.rules = [];
|
|
6593
|
+
}
|
|
6594
|
+
config.module.rules.push(...ruleArr);
|
|
6595
|
+
},
|
|
6562
6596
|
prependPlugins(plugins) {
|
|
6563
6597
|
const pluginArr = castArray(plugins);
|
|
6564
6598
|
if (!config.plugins) {
|
|
@@ -9850,7 +9884,7 @@ function getPublicPath({
|
|
|
9850
9884
|
config,
|
|
9851
9885
|
context
|
|
9852
9886
|
}) {
|
|
9853
|
-
const { dev, output } = config;
|
|
9887
|
+
const { dev, output, server } = config;
|
|
9854
9888
|
let publicPath = DEFAULT_ASSET_PREFIX;
|
|
9855
9889
|
const port = context.devServer?.port || DEFAULT_PORT;
|
|
9856
9890
|
if (isProd) {
|
|
@@ -9868,6 +9902,9 @@ function getPublicPath({
|
|
|
9868
9902
|
} else {
|
|
9869
9903
|
publicPath = `${protocol}://${hostname}:<port>/`;
|
|
9870
9904
|
}
|
|
9905
|
+
if (server.base && server.base !== "/") {
|
|
9906
|
+
publicPath = urlJoin(publicPath, server.base);
|
|
9907
|
+
}
|
|
9871
9908
|
}
|
|
9872
9909
|
return formatPublicPath(replacePortPlaceholder(publicPath, port));
|
|
9873
9910
|
}
|
|
@@ -9935,11 +9972,18 @@ var init_output = __esm({
|
|
|
9935
9972
|
const extractPluginOptions = config.tools.cssExtract.pluginOptions;
|
|
9936
9973
|
const cssPath = config.output.distPath.css;
|
|
9937
9974
|
const cssFilename = getFilename2(config, "css", isProd);
|
|
9975
|
+
const isCssFilenameFn = typeof cssFilename === "function";
|
|
9938
9976
|
const cssAsyncPath = config.output.distPath.cssAsync ?? (cssPath ? `${cssPath}/async` : "async");
|
|
9939
9977
|
chain.plugin(CHAIN_ID2.PLUGIN.MINI_CSS_EXTRACT).use(getCssExtractPlugin(), [
|
|
9940
9978
|
{
|
|
9941
|
-
filename:
|
|
9942
|
-
|
|
9979
|
+
filename: isCssFilenameFn ? (...args) => {
|
|
9980
|
+
const name = cssFilename(...args);
|
|
9981
|
+
return posix4.join(cssPath, name);
|
|
9982
|
+
} : posix4.join(cssPath, cssFilename),
|
|
9983
|
+
chunkFilename: isCssFilenameFn ? (...args) => {
|
|
9984
|
+
const name = cssFilename(...args);
|
|
9985
|
+
return posix4.join(cssAsyncPath, name);
|
|
9986
|
+
} : posix4.join(cssAsyncPath, cssFilename),
|
|
9943
9987
|
...extractPluginOptions
|
|
9944
9988
|
}
|
|
9945
9989
|
]);
|
|
@@ -12711,10 +12755,16 @@ function pluginModuleFederation() {
|
|
|
12711
12755
|
if (!moduleFederation?.options) {
|
|
12712
12756
|
return;
|
|
12713
12757
|
}
|
|
12714
|
-
if (moduleFederation.options.exposes
|
|
12758
|
+
if (moduleFederation.options.exposes) {
|
|
12715
12759
|
config.dev ||= {};
|
|
12716
|
-
config.dev.client
|
|
12717
|
-
|
|
12760
|
+
if (config.server?.port && !config.dev.client?.port) {
|
|
12761
|
+
config.dev.client ||= {};
|
|
12762
|
+
config.dev.client.port = config.server.port;
|
|
12763
|
+
}
|
|
12764
|
+
const originalConfig = api.getRsbuildConfig("original");
|
|
12765
|
+
if (originalConfig.dev?.assetPrefix === void 0 && config.dev.assetPrefix === config.server?.base) {
|
|
12766
|
+
config.dev.assetPrefix = true;
|
|
12767
|
+
}
|
|
12718
12768
|
}
|
|
12719
12769
|
});
|
|
12720
12770
|
api.modifyEnvironmentConfig((config) => {
|
|
@@ -12749,10 +12799,6 @@ function pluginModuleFederation() {
|
|
|
12749
12799
|
chain.output.set("uniqueName", options.name);
|
|
12750
12800
|
}
|
|
12751
12801
|
}
|
|
12752
|
-
const publicPath = chain.output.get("publicPath");
|
|
12753
|
-
if (publicPath === DEFAULT_ASSET_PREFIX) {
|
|
12754
|
-
chain.output.set("publicPath", "auto");
|
|
12755
|
-
}
|
|
12756
12802
|
}
|
|
12757
12803
|
);
|
|
12758
12804
|
}
|
|
@@ -12763,7 +12809,6 @@ var init_moduleFederation = __esm({
|
|
|
12763
12809
|
"src/plugins/moduleFederation.ts"() {
|
|
12764
12810
|
"use strict";
|
|
12765
12811
|
init_esm();
|
|
12766
|
-
init_constants();
|
|
12767
12812
|
PatchSplitChunksPlugin = class {
|
|
12768
12813
|
constructor(name) {
|
|
12769
12814
|
__publicField(this, "name");
|
|
@@ -13682,7 +13727,7 @@ var init_init = __esm({
|
|
|
13682
13727
|
|
|
13683
13728
|
// src/cli/commands.ts
|
|
13684
13729
|
function runCli() {
|
|
13685
|
-
program.name("rsbuild").usage("<command> [options]").version("1.0.
|
|
13730
|
+
program.name("rsbuild").usage("<command> [options]").version("1.0.17");
|
|
13686
13731
|
const devCommand = program.command("dev");
|
|
13687
13732
|
const buildCommand = program.command("build");
|
|
13688
13733
|
const previewCommand = program.command("preview");
|
|
@@ -13793,7 +13838,7 @@ function prepareCli() {
|
|
|
13793
13838
|
if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
|
|
13794
13839
|
console.log();
|
|
13795
13840
|
}
|
|
13796
|
-
logger.greet(` ${`Rsbuild v${"1.0.
|
|
13841
|
+
logger.greet(` ${`Rsbuild v${"1.0.17"}`}
|
|
13797
13842
|
`);
|
|
13798
13843
|
}
|
|
13799
13844
|
var init_prepare = __esm({
|
|
@@ -13864,7 +13909,7 @@ init_mergeConfig();
|
|
|
13864
13909
|
init_helpers();
|
|
13865
13910
|
init_constants();
|
|
13866
13911
|
import { rspack as rspack10 } from "@rspack/core";
|
|
13867
|
-
var version = "1.0.
|
|
13912
|
+
var version = "1.0.17";
|
|
13868
13913
|
export {
|
|
13869
13914
|
PLUGIN_CSS_NAME,
|
|
13870
13915
|
PLUGIN_SWC_NAME,
|
|
@@ -20,10 +20,12 @@ export declare const addTrailingSlash: (s: string) => string;
|
|
|
20
20
|
export declare const formatPublicPath: (publicPath: string, withSlash?: boolean) => string;
|
|
21
21
|
export declare const getPublicPathFromChain: (chain: RspackChain, withSlash?: boolean) => string;
|
|
22
22
|
export declare const getPublicPathFromCompiler: (compiler: Rspack.Compiler | Rspack.Compilation) => string;
|
|
23
|
+
export declare const urlJoin: (base: string, path: string) => string;
|
|
23
24
|
export declare const canParse: (url: string) => boolean;
|
|
24
25
|
export declare const ensureAssetPrefix: (url: string, assetPrefix?: Rspack.PublicPath) => string;
|
|
25
26
|
export declare function getFilename(config: NormalizedConfig | NormalizedEnvironmentConfig, type: 'js', isProd: boolean, isServer?: boolean): NonNullable<FilenameConfig['js']>;
|
|
26
|
-
export declare function getFilename(config: NormalizedConfig | NormalizedEnvironmentConfig, type:
|
|
27
|
+
export declare function getFilename(config: NormalizedConfig | NormalizedEnvironmentConfig, type: 'css', isProd: boolean): NonNullable<FilenameConfig['css']>;
|
|
28
|
+
export declare function getFilename(config: NormalizedConfig | NormalizedEnvironmentConfig, type: Exclude<keyof FilenameConfig, 'js' | 'css'>, isProd: boolean, isServer?: boolean): string;
|
|
27
29
|
export declare function partition<T>(array: T[], predicate: (value: T) => boolean): [T[], T[]];
|
|
28
30
|
export declare const applyToCompiler: (compiler: Rspack.Compiler | Rspack.MultiCompiler, apply: (c: Rspack.Compiler, index: number) => void) => void;
|
|
29
31
|
export declare const upperFirst: (str: string) => string;
|
|
@@ -25,6 +25,7 @@ export type ToolsHtmlPluginConfig = ConfigChainWithContext<HtmlRspackPlugin.Opti
|
|
|
25
25
|
}>;
|
|
26
26
|
export type ModifyRspackConfigUtils = ModifyChainUtils & {
|
|
27
27
|
addRules: (rules: RspackRule | RspackRule[]) => void;
|
|
28
|
+
appendRules: (rules: RspackRule | RspackRule[]) => void;
|
|
28
29
|
prependPlugins: (plugins: BundlerPluginInstance | BundlerPluginInstance[]) => void;
|
|
29
30
|
appendPlugins: (plugins: BundlerPluginInstance | BundlerPluginInstance[]) => void;
|
|
30
31
|
removePlugin: (pluginName: string) => void;
|
|
@@ -495,7 +496,7 @@ export type FilenameConfig = {
|
|
|
495
496
|
* - dev: '[name].css'
|
|
496
497
|
* - prod: '[name].[contenthash:8].css'
|
|
497
498
|
*/
|
|
498
|
-
css?:
|
|
499
|
+
css?: NonNullable<Rspack.Configuration['output']>['cssFilename'];
|
|
499
500
|
/**
|
|
500
501
|
* The name of the SVG images.
|
|
501
502
|
* @default '[name].[contenthash:8].svg'
|
|
@@ -51,6 +51,7 @@ export type ModifyWebpackChainUtils = ModifyChainUtils & {
|
|
|
51
51
|
};
|
|
52
52
|
export type ModifyWebpackConfigUtils = ModifyWebpackChainUtils & {
|
|
53
53
|
addRules: (rules: RuleSetRule | RuleSetRule[]) => void;
|
|
54
|
+
appendRules: (rules: RuleSetRule | RuleSetRule[]) => void;
|
|
54
55
|
prependPlugins: (plugins: WebpackPluginInstance | WebpackPluginInstance[]) => void;
|
|
55
56
|
appendPlugins: (plugins: WebpackPluginInstance | WebpackPluginInstance[]) => void;
|
|
56
57
|
removePlugin: (pluginName: string) => void;
|
|
@@ -193,7 +194,7 @@ export type TransformDescriptor = {
|
|
|
193
194
|
resourceQuery?: Rspack.RuleSetCondition;
|
|
194
195
|
/**
|
|
195
196
|
* Match based on the Rsbuild targets and only apply the transform to certain targets.
|
|
196
|
-
* @see https://rsbuild.dev/config/output/
|
|
197
|
+
* @see https://rsbuild.dev/config/output/target
|
|
197
198
|
*/
|
|
198
199
|
targets?: RsbuildTarget[];
|
|
199
200
|
/**
|
|
@@ -216,7 +217,7 @@ export type ProcessAssetsDescriptor = {
|
|
|
216
217
|
stage: ProcessAssetsStage;
|
|
217
218
|
/**
|
|
218
219
|
* Match based on the Rsbuild targets and only process the assets of certain targets.
|
|
219
|
-
* @see https://rsbuild.dev/config/output/
|
|
220
|
+
* @see https://rsbuild.dev/config/output/target
|
|
220
221
|
*/
|
|
221
222
|
targets?: RsbuildTarget[];
|
|
222
223
|
/**
|
|
@@ -239,6 +240,15 @@ export type ProcessAssetsHandler = (context: {
|
|
|
239
240
|
*/
|
|
240
241
|
sources: RspackSources;
|
|
241
242
|
}) => Promise<void> | void;
|
|
243
|
+
export type ResolveHandler = (context: {
|
|
244
|
+
/** Module request information */
|
|
245
|
+
resolveData: Rspack.ResolveData;
|
|
246
|
+
/** The environment context for current build. */
|
|
247
|
+
environment: EnvironmentContext;
|
|
248
|
+
compiler: Rspack.Compiler;
|
|
249
|
+
compilation: Rspack.Compilation;
|
|
250
|
+
}) => Promise<void> | void;
|
|
251
|
+
export type ResolveFn = (handler: ResolveHandler) => void;
|
|
242
252
|
export type ProcessAssetsFn = (descriptor: ProcessAssetsDescriptor, handler: ProcessAssetsHandler) => void;
|
|
243
253
|
declare function getNormalizedConfig(): NormalizedConfig;
|
|
244
254
|
declare function getNormalizedConfig(options: {
|
|
@@ -288,5 +298,9 @@ export type RsbuildPluginAPI = Readonly<{
|
|
|
288
298
|
* Process all the asset generated by Rspack.
|
|
289
299
|
*/
|
|
290
300
|
processAssets: ProcessAssetsFn;
|
|
301
|
+
/**
|
|
302
|
+
* Defines a custom resolver. A resolver can be useful for e.g. locating third-party dependencies.
|
|
303
|
+
*/
|
|
304
|
+
resolve: ResolveFn;
|
|
291
305
|
}>;
|
|
292
306
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
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.0.
|
|
49
|
+
"@rspack/core": "~1.0.14",
|
|
50
50
|
"@rspack/lite-tapable": "~1.0.1",
|
|
51
51
|
"@swc/helpers": "^0.5.13",
|
|
52
52
|
"core-js": "~3.38.1"
|
|
@@ -68,14 +68,14 @@
|
|
|
68
68
|
"dotenv": "16.4.5",
|
|
69
69
|
"dotenv-expand": "11.0.6",
|
|
70
70
|
"fs-extra": "^11.2.0",
|
|
71
|
-
"html-rspack-plugin": "6.0.
|
|
71
|
+
"html-rspack-plugin": "6.0.2",
|
|
72
72
|
"http-proxy-middleware": "^2.0.6",
|
|
73
73
|
"jiti": "^1.21.6",
|
|
74
74
|
"launch-editor-middleware": "^2.9.1",
|
|
75
75
|
"mrmime": "^2.0.0",
|
|
76
76
|
"on-finished": "2.4.1",
|
|
77
77
|
"open": "^8.4.0",
|
|
78
|
-
"picocolors": "^1.1.
|
|
78
|
+
"picocolors": "^1.1.1",
|
|
79
79
|
"postcss": "^8.4.47",
|
|
80
80
|
"postcss-load-config": "6.0.1",
|
|
81
81
|
"postcss-loader": "8.1.1",
|