@rsbuild/core 1.2.10 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
7875: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const loader = __nccwpck_require__(
|
|
5
|
+
const loader = __nccwpck_require__(749);
|
|
6
6
|
module.exports = loader.default;
|
|
7
7
|
module.exports.defaultGetLocalIdent =
|
|
8
|
-
__nccwpck_require__(
|
|
8
|
+
__nccwpck_require__(5336).defaultGetLocalIdent;
|
|
9
9
|
},
|
|
10
|
-
|
|
10
|
+
749: (__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__(9409));
|
|
15
|
-
var _plugins = __nccwpck_require__(
|
|
16
|
-
var _utils = __nccwpck_require__(
|
|
15
|
+
var _plugins = __nccwpck_require__(9842);
|
|
16
|
+
var _utils = __nccwpck_require__(5336);
|
|
17
17
|
function _interopRequireDefault(obj) {
|
|
18
18
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
19
19
|
}
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
callback(null, `${importCode}${moduleCode}${exportCode}`);
|
|
237
237
|
}
|
|
238
238
|
},
|
|
239
|
-
|
|
239
|
+
9842: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
240
240
|
"use strict";
|
|
241
241
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
242
242
|
Object.defineProperty(exports, "icssParser", {
|
|
@@ -258,22 +258,22 @@
|
|
|
258
258
|
},
|
|
259
259
|
});
|
|
260
260
|
var _postcssImportParser = _interopRequireDefault(
|
|
261
|
-
__nccwpck_require__(
|
|
261
|
+
__nccwpck_require__(9137),
|
|
262
262
|
);
|
|
263
263
|
var _postcssIcssParser = _interopRequireDefault(
|
|
264
|
-
__nccwpck_require__(
|
|
264
|
+
__nccwpck_require__(4952),
|
|
265
265
|
);
|
|
266
|
-
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(
|
|
266
|
+
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(7935));
|
|
267
267
|
function _interopRequireDefault(obj) {
|
|
268
268
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
269
269
|
}
|
|
270
270
|
},
|
|
271
|
-
|
|
271
|
+
4952: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
272
272
|
"use strict";
|
|
273
273
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
274
274
|
exports["default"] = void 0;
|
|
275
275
|
var _icssUtils = __nccwpck_require__(5032);
|
|
276
|
-
var _utils = __nccwpck_require__(
|
|
276
|
+
var _utils = __nccwpck_require__(5336);
|
|
277
277
|
const plugin = (options = {}) => ({
|
|
278
278
|
postcssPlugin: "postcss-icss-parser",
|
|
279
279
|
async OnceExit(root) {
|
|
@@ -372,14 +372,14 @@
|
|
|
372
372
|
plugin.postcss = true;
|
|
373
373
|
var _default = (exports["default"] = plugin);
|
|
374
374
|
},
|
|
375
|
-
|
|
375
|
+
9137: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
376
376
|
"use strict";
|
|
377
377
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
378
378
|
exports["default"] = void 0;
|
|
379
379
|
var _postcssValueParser = _interopRequireDefault(
|
|
380
380
|
__nccwpck_require__(2948),
|
|
381
381
|
);
|
|
382
|
-
var _utils = __nccwpck_require__(
|
|
382
|
+
var _utils = __nccwpck_require__(5336);
|
|
383
383
|
function _interopRequireDefault(obj) {
|
|
384
384
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
385
385
|
}
|
|
@@ -684,14 +684,14 @@
|
|
|
684
684
|
plugin.postcss = true;
|
|
685
685
|
var _default = (exports["default"] = plugin);
|
|
686
686
|
},
|
|
687
|
-
|
|
687
|
+
7935: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
688
688
|
"use strict";
|
|
689
689
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
690
690
|
exports["default"] = void 0;
|
|
691
691
|
var _postcssValueParser = _interopRequireDefault(
|
|
692
692
|
__nccwpck_require__(2948),
|
|
693
693
|
);
|
|
694
|
-
var _utils = __nccwpck_require__(
|
|
694
|
+
var _utils = __nccwpck_require__(5336);
|
|
695
695
|
function _interopRequireDefault(obj) {
|
|
696
696
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
697
697
|
}
|
|
@@ -1034,7 +1034,7 @@
|
|
|
1034
1034
|
plugin.postcss = true;
|
|
1035
1035
|
var _default = (exports["default"] = plugin);
|
|
1036
1036
|
},
|
|
1037
|
-
|
|
1037
|
+
5336: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1038
1038
|
"use strict";
|
|
1039
1039
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1040
1040
|
exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
|
|
@@ -7984,6 +7984,6 @@
|
|
|
7984
7984
|
}
|
|
7985
7985
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
7986
7986
|
__nccwpck_require__.ab = __dirname + "/";
|
|
7987
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
7987
|
+
var __webpack_exports__ = __nccwpck_require__(7875);
|
|
7988
7988
|
module.exports = __webpack_exports__;
|
|
7989
7989
|
})();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
516: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
"use strict";
|
|
5
|
-
const { HtmlWebpackChildCompiler } = __nccwpck_require__(
|
|
5
|
+
const { HtmlWebpackChildCompiler } = __nccwpck_require__(481);
|
|
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
|
+
481: (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
|
+
327: (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
|
+
130: (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
|
+
641: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
517
517
|
"use strict";
|
|
518
518
|
const { AsyncSeriesWaterfallHook } = __nccwpck_require__(408);
|
|
519
519
|
const htmlWebpackPluginHooksMap = new WeakMap();
|
|
@@ -539,7 +539,7 @@
|
|
|
539
539
|
}
|
|
540
540
|
module.exports = { getHtmlRspackPluginHooks };
|
|
541
541
|
},
|
|
542
|
-
|
|
542
|
+
248: (module) => {
|
|
543
543
|
const voidTags = [
|
|
544
544
|
"area",
|
|
545
545
|
"base",
|
|
@@ -607,19 +607,19 @@
|
|
|
607
607
|
htmlTagObjectToString,
|
|
608
608
|
};
|
|
609
609
|
},
|
|
610
|
-
|
|
610
|
+
181: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
611
611
|
"use strict";
|
|
612
612
|
const promisify = __nccwpck_require__(23).promisify;
|
|
613
613
|
const vm = __nccwpck_require__(154);
|
|
614
614
|
const fs = __nccwpck_require__(896);
|
|
615
615
|
const path = __nccwpck_require__(928);
|
|
616
|
-
const { CachedChildCompilation } = __nccwpck_require__(
|
|
616
|
+
const { CachedChildCompilation } = __nccwpck_require__(516);
|
|
617
617
|
const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
|
|
618
|
-
__nccwpck_require__(
|
|
619
|
-
const prettyError = __nccwpck_require__(
|
|
620
|
-
const chunkSorter = __nccwpck_require__(
|
|
618
|
+
__nccwpck_require__(248);
|
|
619
|
+
const prettyError = __nccwpck_require__(130);
|
|
620
|
+
const chunkSorter = __nccwpck_require__(327);
|
|
621
621
|
const getHtmlRspackPluginHooks =
|
|
622
|
-
__nccwpck_require__(
|
|
622
|
+
__nccwpck_require__(641).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__(181);
|
|
1582
1582
|
module.exports = __webpack_exports__;
|
|
1583
1583
|
})();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
5
|
-
module.exports = __nccwpck_require__(
|
|
4
|
+
639: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5
|
+
module.exports = __nccwpck_require__(185)["default"];
|
|
6
6
|
},
|
|
7
|
-
|
|
7
|
+
185: (__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__(928));
|
|
12
|
-
var _utils = __nccwpck_require__(
|
|
12
|
+
var _utils = __nccwpck_require__(716);
|
|
13
13
|
function _interopRequireDefault(obj) {
|
|
14
14
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
15
15
|
}
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
callback(null, result.css, map, { ast });
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
|
-
|
|
182
|
+
716: (module, exports, __nccwpck_require__) => {
|
|
183
183
|
module = __nccwpck_require__.nmd(module);
|
|
184
184
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
185
185
|
exports.exec = exec;
|
|
@@ -716,6 +716,6 @@
|
|
|
716
716
|
})();
|
|
717
717
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
718
718
|
__nccwpck_require__.ab = __dirname + "/";
|
|
719
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
719
|
+
var __webpack_exports__ = __nccwpck_require__(639);
|
|
720
720
|
module.exports = __webpack_exports__;
|
|
721
721
|
})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __webpack_modules__ = {
|
|
4
|
-
|
|
4
|
+
613: (__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
|
+
600: (__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__(896);
|
|
131
131
|
const path_1 = __nccwpck_require__(928);
|
|
132
132
|
const lite_tapable_1 = __nccwpck_require__(408);
|
|
133
|
-
const helpers_1 = __nccwpck_require__(
|
|
133
|
+
const helpers_1 = __nccwpck_require__(613);
|
|
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__(928);
|
|
315
|
-
const hooks_1 = __nccwpck_require__(
|
|
315
|
+
const hooks_1 = __nccwpck_require__(600);
|
|
316
316
|
Object.defineProperty(exports, "getCompilerHooks", {
|
|
317
317
|
enumerable: true,
|
|
318
318
|
get: function () {
|
package/dist/index.cjs
CHANGED
|
@@ -1739,7 +1739,7 @@ var __webpack_exports__ = {};
|
|
|
1739
1739
|
async function createContext(options, userConfig, bundlerType) {
|
|
1740
1740
|
let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_namespaceObject.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
|
|
1741
1741
|
return {
|
|
1742
|
-
version: "1.2.
|
|
1742
|
+
version: "1.2.11",
|
|
1743
1743
|
rootPath,
|
|
1744
1744
|
distPath: '',
|
|
1745
1745
|
cachePath,
|
|
@@ -2240,7 +2240,7 @@ var __webpack_exports__ = {};
|
|
|
2240
2240
|
};
|
|
2241
2241
|
}
|
|
2242
2242
|
return options;
|
|
2243
|
-
},
|
|
2243
|
+
}, clonePostCSSConfig = (config)=>({
|
|
2244
2244
|
...config,
|
|
2245
2245
|
plugins: config.plugins ? [
|
|
2246
2246
|
...config.plugins
|
|
@@ -2249,18 +2249,18 @@ var __webpack_exports__ = {};
|
|
|
2249
2249
|
let { sourceMap } = config.output;
|
|
2250
2250
|
return 'boolean' == typeof sourceMap ? sourceMap : sourceMap.css;
|
|
2251
2251
|
};
|
|
2252
|
-
async function loadUserPostcssrc(root) {
|
|
2253
|
-
let cached =
|
|
2252
|
+
async function loadUserPostcssrc(root, postcssrcCache) {
|
|
2253
|
+
let cached = postcssrcCache.get(root);
|
|
2254
2254
|
if (cached) return clonePostCSSConfig(await cached);
|
|
2255
2255
|
let { default: postcssrc } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/postcss-load-config/index.js")), promise = postcssrc({}, root).catch((err)=>{
|
|
2256
2256
|
var _err_message;
|
|
2257
2257
|
if (null === (_err_message = err.message) || void 0 === _err_message ? void 0 : _err_message.includes('No PostCSS Config found')) return {};
|
|
2258
2258
|
throw err;
|
|
2259
2259
|
});
|
|
2260
|
-
return
|
|
2260
|
+
return postcssrcCache.set(root, promise), promise.then((config)=>(postcssrcCache.set(root, config), clonePostCSSConfig(config)));
|
|
2261
2261
|
}
|
|
2262
|
-
let isPostcssPluginCreator = (plugin)=>'function' == typeof plugin && !0 === plugin.postcss, getPostcssLoaderOptions = async ({ config, root })=>{
|
|
2263
|
-
let extraPlugins = [], userOptions = await loadUserPostcssrc(root);
|
|
2262
|
+
let isPostcssPluginCreator = (plugin)=>'function' == typeof plugin && !0 === plugin.postcss, getPostcssLoaderOptions = async ({ config, root, postcssrcCache })=>{
|
|
2263
|
+
let extraPlugins = [], userOptions = await loadUserPostcssrc(root, postcssrcCache);
|
|
2264
2264
|
userOptions.plugins ||= [];
|
|
2265
2265
|
let finalOptions = reduceConfigsWithContext({
|
|
2266
2266
|
initial: {
|
|
@@ -2313,6 +2313,7 @@ var __webpack_exports__ = {};
|
|
|
2313
2313
|
}, pluginCss = ()=>({
|
|
2314
2314
|
name: 'rsbuild:css',
|
|
2315
2315
|
setup (api) {
|
|
2316
|
+
let postcssrcCache = new Map();
|
|
2316
2317
|
api.modifyBundlerChain({
|
|
2317
2318
|
order: 'pre',
|
|
2318
2319
|
handler: async (chain, { target, isProd, CHAIN_ID, environment })=>{
|
|
@@ -2340,7 +2341,8 @@ var __webpack_exports__ = {};
|
|
|
2340
2341
|
}
|
|
2341
2342
|
let postcssLoaderOptions = await getPostcssLoaderOptions({
|
|
2342
2343
|
config,
|
|
2343
|
-
root: api.context.rootPath
|
|
2344
|
+
root: api.context.rootPath,
|
|
2345
|
+
postcssrcCache
|
|
2344
2346
|
});
|
|
2345
2347
|
('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));
|
|
2346
2348
|
}
|
|
@@ -6688,12 +6690,12 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
6688
6690
|
}
|
|
6689
6691
|
}(), process.title = 'rsbuild-node';
|
|
6690
6692
|
let { npm_execpath } = process.env;
|
|
6691
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.2.
|
|
6693
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.2.11\n`);
|
|
6692
6694
|
}();
|
|
6693
6695
|
try {
|
|
6694
6696
|
!function() {
|
|
6695
6697
|
let cli = dist('rsbuild');
|
|
6696
|
-
cli.help(), cli.version("1.2.
|
|
6698
|
+
cli.help(), cli.version("1.2.11"), applyCommonOptions(cli);
|
|
6697
6699
|
let devCommand = cli.command('dev', 'starting the dev server'), buildCommand = cli.command('build', 'build the app for production'), previewCommand = cli.command('preview', 'preview the production build locally'), inspectCommand = cli.command('inspect', 'inspect the Rspack and Rsbuild configs');
|
|
6698
6700
|
applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
|
|
6699
6701
|
try {
|
|
@@ -6744,7 +6746,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
6744
6746
|
rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
|
|
6745
6747
|
}
|
|
6746
6748
|
}
|
|
6747
|
-
let src_rslib_entry_version = "1.2.
|
|
6749
|
+
let src_rslib_entry_version = "1.2.11";
|
|
6748
6750
|
})();
|
|
6749
6751
|
var __webpack_export_target__ = exports;
|
|
6750
6752
|
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
package/dist/index.js
CHANGED
|
@@ -1648,7 +1648,7 @@ async function updateEnvironmentContext(context, configs) {
|
|
|
1648
1648
|
async function createContext(options, userConfig, bundlerType) {
|
|
1649
1649
|
let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
|
|
1650
1650
|
return {
|
|
1651
|
-
version: "1.2.
|
|
1651
|
+
version: "1.2.11",
|
|
1652
1652
|
rootPath,
|
|
1653
1653
|
distPath: '',
|
|
1654
1654
|
cachePath,
|
|
@@ -2148,7 +2148,7 @@ let pluginHelper_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.
|
|
|
2148
2148
|
};
|
|
2149
2149
|
}
|
|
2150
2150
|
return options;
|
|
2151
|
-
},
|
|
2151
|
+
}, clonePostCSSConfig = (config)=>({
|
|
2152
2152
|
...config,
|
|
2153
2153
|
plugins: config.plugins ? [
|
|
2154
2154
|
...config.plugins
|
|
@@ -2157,18 +2157,18 @@ let pluginHelper_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.
|
|
|
2157
2157
|
let { sourceMap } = config.output;
|
|
2158
2158
|
return 'boolean' == typeof sourceMap ? sourceMap : sourceMap.css;
|
|
2159
2159
|
};
|
|
2160
|
-
async function loadUserPostcssrc(root) {
|
|
2161
|
-
let cached =
|
|
2160
|
+
async function loadUserPostcssrc(root, postcssrcCache) {
|
|
2161
|
+
let cached = postcssrcCache.get(root);
|
|
2162
2162
|
if (cached) return clonePostCSSConfig(await cached);
|
|
2163
2163
|
let { default: postcssrc } = await import("../compiled/postcss-load-config/index.js"), promise = postcssrc({}, root).catch((err)=>{
|
|
2164
2164
|
var _err_message;
|
|
2165
2165
|
if (null === (_err_message = err.message) || void 0 === _err_message ? void 0 : _err_message.includes('No PostCSS Config found')) return {};
|
|
2166
2166
|
throw err;
|
|
2167
2167
|
});
|
|
2168
|
-
return
|
|
2168
|
+
return postcssrcCache.set(root, promise), promise.then((config)=>(postcssrcCache.set(root, config), clonePostCSSConfig(config)));
|
|
2169
2169
|
}
|
|
2170
|
-
let isPostcssPluginCreator = (plugin)=>'function' == typeof plugin && !0 === plugin.postcss, getPostcssLoaderOptions = async ({ config, root })=>{
|
|
2171
|
-
let extraPlugins = [], userOptions = await loadUserPostcssrc(root);
|
|
2170
|
+
let isPostcssPluginCreator = (plugin)=>'function' == typeof plugin && !0 === plugin.postcss, getPostcssLoaderOptions = async ({ config, root, postcssrcCache })=>{
|
|
2171
|
+
let extraPlugins = [], userOptions = await loadUserPostcssrc(root, postcssrcCache);
|
|
2172
2172
|
userOptions.plugins ||= [];
|
|
2173
2173
|
let finalOptions = reduceConfigsWithContext({
|
|
2174
2174
|
initial: {
|
|
@@ -2221,6 +2221,7 @@ let isPostcssPluginCreator = (plugin)=>'function' == typeof plugin && !0 === plu
|
|
|
2221
2221
|
}, pluginCss = ()=>({
|
|
2222
2222
|
name: 'rsbuild:css',
|
|
2223
2223
|
setup (api) {
|
|
2224
|
+
let postcssrcCache = new Map();
|
|
2224
2225
|
api.modifyBundlerChain({
|
|
2225
2226
|
order: 'pre',
|
|
2226
2227
|
handler: async (chain, { target, isProd, CHAIN_ID, environment })=>{
|
|
@@ -2248,7 +2249,8 @@ let isPostcssPluginCreator = (plugin)=>'function' == typeof plugin && !0 === plu
|
|
|
2248
2249
|
}
|
|
2249
2250
|
let postcssLoaderOptions = await getPostcssLoaderOptions({
|
|
2250
2251
|
config,
|
|
2251
|
-
root: api.context.rootPath
|
|
2252
|
+
root: api.context.rootPath,
|
|
2253
|
+
postcssrcCache
|
|
2252
2254
|
});
|
|
2253
2255
|
('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));
|
|
2254
2256
|
}
|
|
@@ -6576,12 +6578,12 @@ async function runCLI() {
|
|
|
6576
6578
|
}
|
|
6577
6579
|
}(), process.title = 'rsbuild-node';
|
|
6578
6580
|
let { npm_execpath } = process.env;
|
|
6579
|
-
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rsbuild v1.2.
|
|
6581
|
+
(!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rsbuild v1.2.11\n`);
|
|
6580
6582
|
}();
|
|
6581
6583
|
try {
|
|
6582
6584
|
!function() {
|
|
6583
6585
|
let cli = dist('rsbuild');
|
|
6584
|
-
cli.help(), cli.version("1.2.
|
|
6586
|
+
cli.help(), cli.version("1.2.11"), applyCommonOptions(cli);
|
|
6585
6587
|
let devCommand = cli.command('dev', 'starting the dev server'), buildCommand = cli.command('build', 'build the app for production'), previewCommand = cli.command('preview', 'preview the production build locally'), inspectCommand = cli.command('inspect', 'inspect the Rspack and Rsbuild configs');
|
|
6586
6588
|
applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
|
|
6587
6589
|
try {
|
|
@@ -6632,6 +6634,6 @@ async function runCLI() {
|
|
|
6632
6634
|
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error('Failed to start Rsbuild CLI.'), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error(err);
|
|
6633
6635
|
}
|
|
6634
6636
|
}
|
|
6635
|
-
let src_version = "1.2.
|
|
6637
|
+
let src_version = "1.2.11";
|
|
6636
6638
|
var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger, __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack;
|
|
6637
6639
|
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
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.2.
|
|
49
|
+
"@rspack/core": "1.2.3",
|
|
50
50
|
"@rspack/lite-tapable": "~1.0.1",
|
|
51
51
|
"@swc/helpers": "^0.5.15",
|
|
52
52
|
"core-js": "~3.40.0"
|