@rslib/core 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/commander/index.d.ts +88 -12
- package/compiled/commander/index.js +511 -151
- package/compiled/commander/package.json +1 -1
- package/dist/entryModuleLoader.js +3 -3
- package/dist/index.js +255 -183
- package/dist/libCssExtractLoader.js +5 -5
- package/dist-types/config.d.ts +3 -2
- package/dist-types/constant.d.ts +0 -3
- package/dist-types/css/cssConfig.d.ts +1 -1
- package/dist-types/plugins/EntryChunkPlugin.d.ts +2 -1
- package/dist-types/types/config.d.ts +13 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__ from "../compiled/rslog/index.js";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_fs__ from "node:fs";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_promises__ from "node:fs/promises";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_path__ from "node:path";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__ from "../compiled/picocolors/index.js";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__ from "../compiled/commander/index.js";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_core__ from "@rsbuild/core";
|
|
8
8
|
import * as __WEBPACK_EXTERNAL_MODULE_tinyglobby__ from "tinyglobby";
|
|
9
|
-
import * as
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_module__ from "node:module";
|
|
10
10
|
import * as __WEBPACK_EXTERNAL_MODULE_module__ from "module";
|
|
11
11
|
const nodeBuiltInModules = [
|
|
12
12
|
'assert',
|
|
@@ -68,7 +68,7 @@ const nodeBuiltInModules = [
|
|
|
68
68
|
];
|
|
69
69
|
async function calcLongestCommonPath(absPaths) {
|
|
70
70
|
if (0 === absPaths.length) return null;
|
|
71
|
-
const sep =
|
|
71
|
+
const sep = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].posix.sep;
|
|
72
72
|
const splitPaths = absPaths.map((p)=>p.split(sep));
|
|
73
73
|
let lcaFragments = splitPaths[0];
|
|
74
74
|
for(let i = 1; i < splitPaths.length; i++){
|
|
@@ -79,23 +79,23 @@ async function calcLongestCommonPath(absPaths) {
|
|
|
79
79
|
lcaFragments = lcaFragments.slice(0, j);
|
|
80
80
|
}
|
|
81
81
|
let lca = lcaFragments.length > 0 ? lcaFragments.join(sep) : sep;
|
|
82
|
-
const stats = await
|
|
83
|
-
if (stats?.isFile()) lca =
|
|
82
|
+
const stats = await __WEBPACK_EXTERNAL_MODULE_node_fs_promises__["default"].stat(lca);
|
|
83
|
+
if (stats?.isFile()) lca = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].dirname(lca);
|
|
84
84
|
return lca;
|
|
85
85
|
}
|
|
86
86
|
function getAbsolutePath(base, filepath) {
|
|
87
|
-
return (0,
|
|
87
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_node_path__.isAbsolute)(filepath) ? filepath : (0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(base, filepath);
|
|
88
88
|
}
|
|
89
89
|
const readPackageJson = (rootPath)=>{
|
|
90
|
-
const pkgJsonPath =
|
|
91
|
-
if (!
|
|
92
|
-
|
|
90
|
+
const pkgJsonPath = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].join(rootPath, './package.json');
|
|
91
|
+
if (!__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].existsSync(pkgJsonPath)) {
|
|
92
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.warn(`package.json does not exist in the ${rootPath} directory`);
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
try {
|
|
96
|
-
return JSON.parse(
|
|
96
|
+
return JSON.parse(__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].readFileSync(pkgJsonPath, 'utf8'));
|
|
97
97
|
} catch (err) {
|
|
98
|
-
|
|
98
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.warn(`Failed to parse ${pkgJsonPath}, it might not be valid JSON`);
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
};
|
|
@@ -127,7 +127,7 @@ function checkMFPlugin(config, sharedPlugins) {
|
|
|
127
127
|
...config.plugins || []
|
|
128
128
|
]);
|
|
129
129
|
if (!added) {
|
|
130
|
-
|
|
130
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.warn(`${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].green('format: "mf"')} should be used with ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].blue('@module-federation/rsbuild-plugin')}", consider installing and adding it to plugins. Check the documentation (https://module-federation.io/guide/basic/rsbuild.html#rslib-module) to get started with "mf" output.`);
|
|
131
131
|
process.exit(1);
|
|
132
132
|
}
|
|
133
133
|
return added;
|
|
@@ -147,7 +147,7 @@ const windowsSlashRegex = /\\/g;
|
|
|
147
147
|
function normalizeSlash(p) {
|
|
148
148
|
return p.replace(windowsSlashRegex, '/');
|
|
149
149
|
}
|
|
150
|
-
if (process.env.DEBUG)
|
|
150
|
+
if (process.env.DEBUG) __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.level = 'verbose';
|
|
151
151
|
function initNodeEnv() {
|
|
152
152
|
if (!process.env.NODE_ENV) {
|
|
153
153
|
const command = process.argv[2] ?? '';
|
|
@@ -160,7 +160,7 @@ function prepareCli() {
|
|
|
160
160
|
initNodeEnv();
|
|
161
161
|
const { npm_execpath } = process.env;
|
|
162
162
|
if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
|
|
163
|
-
|
|
163
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.greet(` Rslib v0.3.0\n`);
|
|
164
164
|
}
|
|
165
165
|
const composeAssetConfig = (bundle, format)=>{
|
|
166
166
|
if ('esm' === format || 'cjs' === format) {
|
|
@@ -190,14 +190,14 @@ const JS_EXTENSIONS = [
|
|
|
190
190
|
'js',
|
|
191
191
|
'mjs',
|
|
192
192
|
'jsx',
|
|
193
|
-
'ts',
|
|
194
|
-
'mts',
|
|
193
|
+
'(?<!d.)ts',
|
|
194
|
+
'(?<!d.)mts',
|
|
195
|
+
'(?<!d.)cts',
|
|
195
196
|
'tsx',
|
|
196
197
|
'cjs',
|
|
197
198
|
'cjsx',
|
|
198
199
|
'mjsx',
|
|
199
200
|
'mtsx',
|
|
200
|
-
'cts',
|
|
201
201
|
'ctsx'
|
|
202
202
|
];
|
|
203
203
|
const CSS_EXTENSIONS = [
|
|
@@ -255,7 +255,7 @@ class LibCssExtractPlugin {
|
|
|
255
255
|
const chunkAsset = Object.keys(assets).filter((name)=>/\.css/.test(name));
|
|
256
256
|
for (const name of chunkAsset)compilation.updateAsset(name, (old)=>{
|
|
257
257
|
const oldSource = old.source().toString();
|
|
258
|
-
const replaceSource = new
|
|
258
|
+
const replaceSource = new __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.sources.ReplaceSource(old);
|
|
259
259
|
function replace(searchValue, replaceValue) {
|
|
260
260
|
let start = oldSource.indexOf(searchValue);
|
|
261
261
|
while(-1 !== start){
|
|
@@ -273,7 +273,7 @@ class LibCssExtractPlugin {
|
|
|
273
273
|
});
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
const cssConfig_require = (0,
|
|
276
|
+
const cssConfig_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module__.createRequire)(import.meta.url);
|
|
277
277
|
const RSLIB_CSS_ENTRY_FLAG = '__rslib_css__';
|
|
278
278
|
function isCssFile(filepath) {
|
|
279
279
|
return CSS_EXTENSIONS_PATTERN.test(filepath);
|
|
@@ -289,7 +289,7 @@ function parsePathQueryFragment(str) {
|
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
291
|
function isCssModulesFile(filepath, auto) {
|
|
292
|
-
const filename =
|
|
292
|
+
const filename = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].basename(filepath);
|
|
293
293
|
if (true === auto) return CSS_MODULE_REG.test(filename);
|
|
294
294
|
if (auto instanceof RegExp) return auto.test(filepath);
|
|
295
295
|
if ('function' == typeof auto) {
|
|
@@ -304,15 +304,20 @@ function isCssGlobalFile(filepath, auto) {
|
|
|
304
304
|
const isCssModules = isCssModulesFile(filepath, auto);
|
|
305
305
|
return !isCssModules;
|
|
306
306
|
}
|
|
307
|
-
function cssExternalHandler(request, callback, jsExtension, auto,
|
|
308
|
-
const isCssModulesRequest = isCssModulesFile(request, auto);
|
|
307
|
+
async function cssExternalHandler(request, callback, jsExtension, auto, styleRedirectPath, styleRedirectExtension, redirectPath) {
|
|
309
308
|
if (/compiled\/css-loader\//.test(request)) return callback();
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
309
|
+
let resolvedRequest = request;
|
|
310
|
+
if (styleRedirectPath) {
|
|
311
|
+
const resolved = await redirectPath(resolvedRequest);
|
|
312
|
+
if (resolved) resolvedRequest = resolved;
|
|
314
313
|
}
|
|
315
|
-
return false;
|
|
314
|
+
if (!isCssFile(resolvedRequest)) return false;
|
|
315
|
+
if (styleRedirectExtension) {
|
|
316
|
+
const isCssModulesRequest = isCssModulesFile(resolvedRequest, auto);
|
|
317
|
+
if (isCssModulesRequest) return callback(void 0, resolvedRequest.replace(/\.[^.]+$/, jsExtension));
|
|
318
|
+
return callback(void 0, resolvedRequest.replace(/\.[^.]+$/, '.css'));
|
|
319
|
+
}
|
|
320
|
+
return callback(void 0, resolvedRequest);
|
|
316
321
|
}
|
|
317
322
|
const PLUGIN_NAME = 'rsbuild:lib-css';
|
|
318
323
|
const pluginLibCss = (rootDir)=>({
|
|
@@ -382,16 +387,16 @@ const pluginEsmRequireShim = ()=>({
|
|
|
382
387
|
setup (api) {
|
|
383
388
|
api.modifyRspackConfig((config)=>{
|
|
384
389
|
config.plugins ??= [];
|
|
385
|
-
config.plugins.push(new
|
|
390
|
+
config.plugins.push(new __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.BannerPlugin({
|
|
386
391
|
banner: requireShim,
|
|
387
|
-
stage:
|
|
392
|
+
stage: __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE - 1,
|
|
388
393
|
raw: true,
|
|
389
394
|
include: /\.(js|cjs)$/
|
|
390
395
|
}));
|
|
391
396
|
});
|
|
392
397
|
}
|
|
393
398
|
});
|
|
394
|
-
const EntryChunkPlugin_require = (0,
|
|
399
|
+
const EntryChunkPlugin_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module__.createRequire)(import.meta.url);
|
|
395
400
|
const EntryChunkPlugin_PLUGIN_NAME = 'rsbuild:lib-entry-chunk';
|
|
396
401
|
const EntryChunkPlugin_LOADER_NAME = 'rsbuild:lib-entry-module';
|
|
397
402
|
const matchFirstLine = (source, regex)=>{
|
|
@@ -407,19 +412,28 @@ class EntryChunkPlugin {
|
|
|
407
412
|
shebangEntries = {};
|
|
408
413
|
shebangInjectedAssets = new Set();
|
|
409
414
|
enabledImportMetaUrlShim;
|
|
410
|
-
|
|
415
|
+
contextToWatch = null;
|
|
416
|
+
contextWatched = false;
|
|
417
|
+
constructor({ enabledImportMetaUrlShim = true, contextToWatch }){
|
|
411
418
|
this.enabledImportMetaUrlShim = enabledImportMetaUrlShim;
|
|
419
|
+
this.contextToWatch = contextToWatch;
|
|
412
420
|
}
|
|
413
421
|
apply(compiler) {
|
|
414
|
-
compiler.hooks.
|
|
422
|
+
compiler.hooks.afterCompile.tap(EntryChunkPlugin_PLUGIN_NAME, (compilation)=>{
|
|
423
|
+
if (this.contextWatched || null === this.contextToWatch) return;
|
|
424
|
+
const contextDep = compilation.contextDependencies;
|
|
425
|
+
contextDep.add(this.contextToWatch);
|
|
426
|
+
this.contextWatched = true;
|
|
427
|
+
});
|
|
428
|
+
compiler.hooks.make.tap(EntryChunkPlugin_PLUGIN_NAME, (compilation)=>{
|
|
429
|
+
const entries = {};
|
|
430
|
+
for (const [key, value] of compilation.entries){
|
|
431
|
+
const firstDep = value.dependencies[0];
|
|
432
|
+
if (firstDep?.request) entries[key] = firstDep.request;
|
|
433
|
+
}
|
|
415
434
|
for(const name in entries){
|
|
416
|
-
const
|
|
417
|
-
if (!
|
|
418
|
-
let first;
|
|
419
|
-
if (Array.isArray(entry)) first = entry[0];
|
|
420
|
-
else if (Array.isArray(entry.import)) first = entry.import[0];
|
|
421
|
-
else if ('string' == typeof entry) first = entry;
|
|
422
|
-
if ('string' != typeof first) continue;
|
|
435
|
+
const first = entries[name];
|
|
436
|
+
if (!first) continue;
|
|
423
437
|
const filename = first.split('?')[0];
|
|
424
438
|
const isJs = JS_EXTENSIONS_PATTERN.test(filename);
|
|
425
439
|
if (!isJs) continue;
|
|
@@ -434,7 +448,7 @@ class EntryChunkPlugin {
|
|
|
434
448
|
if (reactDirective) this.reactDirectives[name] = reactDirective;
|
|
435
449
|
}
|
|
436
450
|
});
|
|
437
|
-
compiler.hooks.
|
|
451
|
+
compiler.hooks.make.tap(EntryChunkPlugin_PLUGIN_NAME, (compilation)=>{
|
|
438
452
|
compilation.hooks.chunkAsset.tap(EntryChunkPlugin_PLUGIN_NAME, (chunk, filename)=>{
|
|
439
453
|
const isJs = JS_EXTENSIONS_PATTERN.test(filename);
|
|
440
454
|
if (!isJs) return;
|
|
@@ -452,7 +466,7 @@ class EntryChunkPlugin {
|
|
|
452
466
|
const chunkAsset = Object.keys(assets).filter((name)=>JS_EXTENSIONS_PATTERN.test(name));
|
|
453
467
|
for (const name of chunkAsset)compilation.updateAsset(name, (old)=>{
|
|
454
468
|
const oldSource = old.source().toString();
|
|
455
|
-
const replaceSource = new
|
|
469
|
+
const replaceSource = new __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.sources.ReplaceSource(old);
|
|
456
470
|
if (oldSource.startsWith('use strict;') || oldSource.startsWith('"use strict";')) replaceSource.replace(0, 11, `"use strict";\n${importMetaUrlShim}`);
|
|
457
471
|
else replaceSource.insert(0, importMetaUrlShim);
|
|
458
472
|
return replaceSource;
|
|
@@ -460,14 +474,14 @@ class EntryChunkPlugin {
|
|
|
460
474
|
});
|
|
461
475
|
compilation.hooks.processAssets.tap({
|
|
462
476
|
name: EntryChunkPlugin_PLUGIN_NAME,
|
|
463
|
-
stage:
|
|
477
|
+
stage: __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.Compilation.PROCESS_ASSETS_STAGE_DEV_TOOLING - 1
|
|
464
478
|
}, (assets)=>{
|
|
465
479
|
const chunkAsset = Object.keys(assets);
|
|
466
480
|
for (const name of chunkAsset){
|
|
467
481
|
const shebangValue = this.shebangEntries[name];
|
|
468
482
|
const reactDirectiveValue = this.reactDirectives[name];
|
|
469
483
|
if (shebangValue || reactDirectiveValue) compilation.updateAsset(name, (old)=>{
|
|
470
|
-
const replaceSource = new
|
|
484
|
+
const replaceSource = new __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.sources.ReplaceSource(old);
|
|
471
485
|
if (shebangValue) {
|
|
472
486
|
replaceSource.insert(0, `${shebangValue}\n`);
|
|
473
487
|
this.shebangInjectedAssets.add(name);
|
|
@@ -479,7 +493,7 @@ class EntryChunkPlugin {
|
|
|
479
493
|
});
|
|
480
494
|
});
|
|
481
495
|
compiler.hooks.assetEmitted.tap(EntryChunkPlugin_PLUGIN_NAME, (file, { targetPath })=>{
|
|
482
|
-
if (this.shebangInjectedAssets.has(file)) (0,
|
|
496
|
+
if (this.shebangInjectedAssets.has(file)) (0, __WEBPACK_EXTERNAL_MODULE_node_fs__.chmodSync)(targetPath, this.shebangChmod);
|
|
483
497
|
});
|
|
484
498
|
}
|
|
485
499
|
}
|
|
@@ -491,7 +505,7 @@ const entryModuleLoaderRsbuildPlugin = ()=>({
|
|
|
491
505
|
});
|
|
492
506
|
}
|
|
493
507
|
});
|
|
494
|
-
const composeEntryChunkConfig = ({ enabledImportMetaUrlShim })=>({
|
|
508
|
+
const composeEntryChunkConfig = ({ enabledImportMetaUrlShim, contextToWatch = null })=>({
|
|
495
509
|
plugins: [
|
|
496
510
|
entryModuleLoaderRsbuildPlugin()
|
|
497
511
|
],
|
|
@@ -499,7 +513,8 @@ const composeEntryChunkConfig = ({ enabledImportMetaUrlShim })=>({
|
|
|
499
513
|
rspack: {
|
|
500
514
|
plugins: [
|
|
501
515
|
new EntryChunkPlugin({
|
|
502
|
-
enabledImportMetaUrlShim
|
|
516
|
+
enabledImportMetaUrlShim,
|
|
517
|
+
contextToWatch
|
|
503
518
|
})
|
|
504
519
|
]
|
|
505
520
|
}
|
|
@@ -514,7 +529,7 @@ const getDefaultExtension = (options)=>{
|
|
|
514
529
|
dtsExtension
|
|
515
530
|
};
|
|
516
531
|
if (!pkgJson) {
|
|
517
|
-
|
|
532
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.warn('autoExtension configuration will not be applied due to read package.json failed');
|
|
518
533
|
return {
|
|
519
534
|
jsExtension,
|
|
520
535
|
dtsExtension
|
|
@@ -699,8 +714,8 @@ function transformSyntaxToBrowserslist(syntax, target) {
|
|
|
699
714
|
if (Array.isArray(syntax)) return syntax.flatMap(handleSyntaxItem);
|
|
700
715
|
return handleSyntaxItem(syntax);
|
|
701
716
|
}
|
|
702
|
-
const POSIX_SEP_RE = new RegExp('\\' +
|
|
703
|
-
const NATIVE_SEP_RE = new RegExp('\\' +
|
|
717
|
+
const POSIX_SEP_RE = new RegExp('\\' + __WEBPACK_EXTERNAL_MODULE_node_path__["default"].posix.sep, 'g');
|
|
718
|
+
const NATIVE_SEP_RE = new RegExp('\\' + __WEBPACK_EXTERNAL_MODULE_node_path__["default"].sep, 'g');
|
|
704
719
|
const PATTERN_REGEX_CACHE = new Map();
|
|
705
720
|
const GLOB_ALL_PATTERN = "**/*";
|
|
706
721
|
const TS_EXTENSIONS = [
|
|
@@ -718,7 +733,7 @@ const util_JS_EXTENSIONS = [
|
|
|
718
733
|
const TSJS_EXTENSIONS = TS_EXTENSIONS.concat(util_JS_EXTENSIONS);
|
|
719
734
|
const TS_EXTENSIONS_RE_GROUP = `\\.(?:${TS_EXTENSIONS.map((ext)=>ext.substring(1)).join('|')})`;
|
|
720
735
|
const TSJS_EXTENSIONS_RE_GROUP = `\\.(?:${TSJS_EXTENSIONS.map((ext)=>ext.substring(1)).join('|')})`;
|
|
721
|
-
const IS_POSIX =
|
|
736
|
+
const IS_POSIX = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].posix.sep === __WEBPACK_EXTERNAL_MODULE_node_path__["default"].sep;
|
|
722
737
|
function util_makePromise() {
|
|
723
738
|
let resolve, reject;
|
|
724
739
|
const promise = new Promise((res, rej)=>{
|
|
@@ -732,22 +747,22 @@ function util_makePromise() {
|
|
|
732
747
|
};
|
|
733
748
|
}
|
|
734
749
|
async function util_resolveTSConfigJson(filename, cache) {
|
|
735
|
-
if ('.json' !==
|
|
736
|
-
const tsconfig =
|
|
750
|
+
if ('.json' !== __WEBPACK_EXTERNAL_MODULE_node_path__["default"].extname(filename)) return;
|
|
751
|
+
const tsconfig = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(filename);
|
|
737
752
|
if (cache && (cache.hasParseResult(tsconfig) || cache.hasParseResult(filename))) return tsconfig;
|
|
738
|
-
return
|
|
753
|
+
return __WEBPACK_EXTERNAL_MODULE_node_fs__.promises.stat(tsconfig).then((stat)=>{
|
|
739
754
|
if (stat.isFile() || stat.isFIFO()) return tsconfig;
|
|
740
755
|
throw new Error(`${filename} exists but is not a regular file.`);
|
|
741
756
|
});
|
|
742
757
|
}
|
|
743
758
|
const util_isInNodeModules = IS_POSIX ? (dir)=>dir.includes('/node_modules/') : (dir)=>dir.match(/[/\\]node_modules[/\\]/);
|
|
744
|
-
const posix2native = IS_POSIX ? (filename)=>filename : (filename)=>filename.replace(POSIX_SEP_RE,
|
|
745
|
-
const util_native2posix = IS_POSIX ? (filename)=>filename : (filename)=>filename.replace(NATIVE_SEP_RE,
|
|
746
|
-
const resolve2posix = IS_POSIX ? (dir, filename)=>dir ?
|
|
759
|
+
const posix2native = IS_POSIX ? (filename)=>filename : (filename)=>filename.replace(POSIX_SEP_RE, __WEBPACK_EXTERNAL_MODULE_node_path__["default"].sep);
|
|
760
|
+
const util_native2posix = IS_POSIX ? (filename)=>filename : (filename)=>filename.replace(NATIVE_SEP_RE, __WEBPACK_EXTERNAL_MODULE_node_path__["default"].posix.sep);
|
|
761
|
+
const resolve2posix = IS_POSIX ? (dir, filename)=>dir ? __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(dir, filename) : __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(filename) : (dir, filename)=>util_native2posix(dir ? __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(posix2native(dir), posix2native(filename)) : __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(posix2native(filename)));
|
|
747
762
|
function util_resolveReferencedTSConfigFiles(result, options) {
|
|
748
|
-
const dir =
|
|
763
|
+
const dir = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].dirname(result.tsconfigFile);
|
|
749
764
|
return result.tsconfig.references.map((ref)=>{
|
|
750
|
-
const refPath = ref.path.endsWith('.json') ? ref.path :
|
|
765
|
+
const refPath = ref.path.endsWith('.json') ? ref.path : __WEBPACK_EXTERNAL_MODULE_node_path__["default"].join(ref.path, options?.configName ?? 'tsconfig.json');
|
|
751
766
|
return resolve2posix(dir, refPath);
|
|
752
767
|
});
|
|
753
768
|
}
|
|
@@ -761,7 +776,7 @@ function util_resolveSolutionTSConfig(filename, result) {
|
|
|
761
776
|
return result;
|
|
762
777
|
}
|
|
763
778
|
function util_isIncluded(filename, result) {
|
|
764
|
-
const dir = util_native2posix(
|
|
779
|
+
const dir = util_native2posix(__WEBPACK_EXTERNAL_MODULE_node_path__["default"].dirname(result.tsconfigFile));
|
|
765
780
|
const files = (result.tsconfig.files || []).map((file)=>resolve2posix(dir, file));
|
|
766
781
|
const absoluteFilename = resolve2posix(null, filename);
|
|
767
782
|
if (files.includes(filename)) return true;
|
|
@@ -852,13 +867,13 @@ function util_replaceTokens(tsconfig, configDir) {
|
|
|
852
867
|
return JSON.parse(JSON.stringify(tsconfig).replaceAll(/"\${configDir}/g, `"${util_native2posix(configDir)}`));
|
|
853
868
|
}
|
|
854
869
|
async function find(filename, options) {
|
|
855
|
-
let dir =
|
|
870
|
+
let dir = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].dirname(__WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(filename));
|
|
856
871
|
if (options?.ignoreNodeModules && util_isInNodeModules(dir)) return null;
|
|
857
872
|
const cache = options?.cache;
|
|
858
873
|
const configName = options?.configName ?? 'tsconfig.json';
|
|
859
874
|
if (cache?.hasConfigPath(dir, configName)) return cache.getConfigPath(dir, configName);
|
|
860
875
|
const { promise, resolve, reject } = util_makePromise();
|
|
861
|
-
if (options?.root && !
|
|
876
|
+
if (options?.root && !__WEBPACK_EXTERNAL_MODULE_node_path__["default"].isAbsolute(options.root)) options.root = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(options.root);
|
|
862
877
|
findUp(dir, {
|
|
863
878
|
promise,
|
|
864
879
|
resolve,
|
|
@@ -881,13 +896,13 @@ function findUp(dir, { resolve, reject, promise }, options) {
|
|
|
881
896
|
else resolve(cached);
|
|
882
897
|
} else cache.setConfigPath(dir, promise, configName);
|
|
883
898
|
}
|
|
884
|
-
const tsconfig =
|
|
885
|
-
|
|
899
|
+
const tsconfig = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].join(dir, options?.configName ?? 'tsconfig.json');
|
|
900
|
+
__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].stat(tsconfig, (err, stats)=>{
|
|
886
901
|
if (stats && (stats.isFile() || stats.isFIFO())) resolve(tsconfig);
|
|
887
902
|
else if (err?.code !== 'ENOENT') reject(err);
|
|
888
903
|
else {
|
|
889
904
|
let parent;
|
|
890
|
-
if (root === dir || (parent =
|
|
905
|
+
if (root === dir || (parent = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].dirname(dir)) === dir) resolve(null);
|
|
891
906
|
else findUp(parent, {
|
|
892
907
|
promise,
|
|
893
908
|
resolve,
|
|
@@ -896,7 +911,7 @@ function findUp(dir, { resolve, reject, promise }, options) {
|
|
|
896
911
|
}
|
|
897
912
|
});
|
|
898
913
|
}
|
|
899
|
-
|
|
914
|
+
__WEBPACK_EXTERNAL_MODULE_node_path__["default"].sep;
|
|
900
915
|
function toJson(tsconfigJson) {
|
|
901
916
|
const stripped = stripDanglingComma(stripJsonComments(stripBom(tsconfigJson)));
|
|
902
917
|
if ('' === stripped.trim()) return '{}';
|
|
@@ -1017,7 +1032,7 @@ async function parse(filename, options) {
|
|
|
1017
1032
|
parseReferences(result, options)
|
|
1018
1033
|
]);
|
|
1019
1034
|
}
|
|
1020
|
-
result.tsconfig = util_replaceTokens(result.tsconfig,
|
|
1035
|
+
result.tsconfig = util_replaceTokens(result.tsconfig, __WEBPACK_EXTERNAL_MODULE_node_path__["default"].dirname(tsconfigFile));
|
|
1021
1036
|
resolve(util_resolveSolutionTSConfig(filename, result));
|
|
1022
1037
|
} catch (e) {
|
|
1023
1038
|
reject(e);
|
|
@@ -1038,12 +1053,12 @@ async function getParsedDeep(filename, cache, options) {
|
|
|
1038
1053
|
}
|
|
1039
1054
|
async function parseFile(tsconfigFile, cache, skipCache) {
|
|
1040
1055
|
if (!skipCache && cache?.hasParseResult(tsconfigFile) && !cache.getParseResult(tsconfigFile)._isRootFile_) return cache.getParseResult(tsconfigFile);
|
|
1041
|
-
const promise =
|
|
1056
|
+
const promise = __WEBPACK_EXTERNAL_MODULE_node_fs__.promises.readFile(tsconfigFile, 'utf-8').then(toJson).then((json)=>{
|
|
1042
1057
|
const parsed = JSON.parse(json);
|
|
1043
1058
|
applyDefaults(parsed, tsconfigFile);
|
|
1044
1059
|
return {
|
|
1045
1060
|
tsconfigFile,
|
|
1046
|
-
tsconfig: normalizeTSConfig(parsed,
|
|
1061
|
+
tsconfig: normalizeTSConfig(parsed, __WEBPACK_EXTERNAL_MODULE_node_path__["default"].dirname(tsconfigFile))
|
|
1047
1062
|
};
|
|
1048
1063
|
}).catch((e)=>{
|
|
1049
1064
|
throw new TSConfckParseError(`parsing ${tsconfigFile} failed: ${e}`, 'PARSE_FILE', tsconfigFile, e);
|
|
@@ -1053,7 +1068,7 @@ async function parseFile(tsconfigFile, cache, skipCache) {
|
|
|
1053
1068
|
}
|
|
1054
1069
|
function normalizeTSConfig(tsconfig, dir) {
|
|
1055
1070
|
const baseUrl = tsconfig.compilerOptions?.baseUrl;
|
|
1056
|
-
if (baseUrl && !baseUrl.startsWith('${') && !
|
|
1071
|
+
if (baseUrl && !baseUrl.startsWith('${') && !__WEBPACK_EXTERNAL_MODULE_node_path__["default"].isAbsolute(baseUrl)) tsconfig.compilerOptions.baseUrl = resolve2posix(dir, baseUrl);
|
|
1057
1072
|
return tsconfig;
|
|
1058
1073
|
}
|
|
1059
1074
|
async function parseReferences(result, options) {
|
|
@@ -1112,7 +1127,7 @@ function resolveExtends(extended, from) {
|
|
|
1112
1127
|
} catch (e) {
|
|
1113
1128
|
error = e;
|
|
1114
1129
|
}
|
|
1115
|
-
if ('.' !== extended[0] && !
|
|
1130
|
+
if ('.' !== extended[0] && !__WEBPACK_EXTERNAL_MODULE_node_path__["default"].isAbsolute(extended)) try {
|
|
1116
1131
|
return req.resolve(`${extended}/tsconfig.json`);
|
|
1117
1132
|
} catch (e) {
|
|
1118
1133
|
error = e;
|
|
@@ -1132,7 +1147,7 @@ const EXTENDABLE_KEYS = [
|
|
|
1132
1147
|
function extendTSConfig(extending, extended) {
|
|
1133
1148
|
const extendingConfig = extending.tsconfig;
|
|
1134
1149
|
const extendedConfig = extended.tsconfig;
|
|
1135
|
-
const relativePath = util_native2posix(
|
|
1150
|
+
const relativePath = util_native2posix(__WEBPACK_EXTERNAL_MODULE_node_path__["default"].relative(__WEBPACK_EXTERNAL_MODULE_node_path__["default"].dirname(extending.tsconfigFile), __WEBPACK_EXTERNAL_MODULE_node_path__["default"].dirname(extended.tsconfigFile)));
|
|
1136
1151
|
for (const key of Object.keys(extendedConfig).filter((key)=>EXTENDABLE_KEYS.includes(key)))if ('compilerOptions' === key) {
|
|
1137
1152
|
if (!extendingConfig.compilerOptions) extendingConfig.compilerOptions = {};
|
|
1138
1153
|
for (const option of Object.keys(extendedConfig.compilerOptions)){
|
|
@@ -1165,8 +1180,8 @@ function rebaseRelative(key, value, prependPath) {
|
|
|
1165
1180
|
return rebasePath(value, prependPath);
|
|
1166
1181
|
}
|
|
1167
1182
|
function rebasePath(value, prependPath) {
|
|
1168
|
-
if (
|
|
1169
|
-
return
|
|
1183
|
+
if (__WEBPACK_EXTERNAL_MODULE_node_path__["default"].isAbsolute(value) || value.startsWith('${configDir}')) return value;
|
|
1184
|
+
return __WEBPACK_EXTERNAL_MODULE_node_path__["default"].posix.normalize(__WEBPACK_EXTERNAL_MODULE_node_path__["default"].posix.join(prependPath, value));
|
|
1170
1185
|
}
|
|
1171
1186
|
class TSConfckParseError extends Error {
|
|
1172
1187
|
code;
|
|
@@ -1195,12 +1210,12 @@ const DEFAULT_JSCONFIG_COMPILER_OPTIONS = {
|
|
|
1195
1210
|
noEmit: true
|
|
1196
1211
|
};
|
|
1197
1212
|
function isJSConfig(configFileName) {
|
|
1198
|
-
return 'jsconfig.json' ===
|
|
1213
|
+
return 'jsconfig.json' === __WEBPACK_EXTERNAL_MODULE_node_path__["default"].basename(configFileName);
|
|
1199
1214
|
}
|
|
1200
1215
|
async function loadTsconfig(root, tsconfigPath = 'tsconfig.json') {
|
|
1201
|
-
const tsconfigFileName = await find((0,
|
|
1216
|
+
const tsconfigFileName = await find((0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(root, tsconfigPath), {
|
|
1202
1217
|
root,
|
|
1203
|
-
configName: (0,
|
|
1218
|
+
configName: (0, __WEBPACK_EXTERNAL_MODULE_node_path__.basename)(tsconfigPath)
|
|
1204
1219
|
});
|
|
1205
1220
|
if (tsconfigFileName) {
|
|
1206
1221
|
const { tsconfig } = await parse(tsconfigFileName);
|
|
@@ -1211,21 +1226,21 @@ async function loadTsconfig(root, tsconfigPath = 'tsconfig.json') {
|
|
|
1211
1226
|
function defineConfig(config) {
|
|
1212
1227
|
return config;
|
|
1213
1228
|
}
|
|
1214
|
-
const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(
|
|
1229
|
+
const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].existsSync);
|
|
1215
1230
|
const resolveConfigPath = (root, customConfig)=>{
|
|
1216
1231
|
if (customConfig) {
|
|
1217
|
-
const customConfigPath = (0,
|
|
1218
|
-
if (
|
|
1219
|
-
|
|
1232
|
+
const customConfigPath = (0, __WEBPACK_EXTERNAL_MODULE_node_path__.isAbsolute)(customConfig) ? customConfig : (0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(root, customConfig);
|
|
1233
|
+
if (__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].existsSync(customConfigPath)) return customConfigPath;
|
|
1234
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.warn(`Cannot find config file: ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].dim(customConfigPath)}\n`);
|
|
1220
1235
|
}
|
|
1221
|
-
const configFilePath = findConfig((0,
|
|
1236
|
+
const configFilePath = findConfig((0, __WEBPACK_EXTERNAL_MODULE_node_path__.join)(root, DEFAULT_CONFIG_NAME));
|
|
1222
1237
|
if (configFilePath) return configFilePath;
|
|
1223
1238
|
throw new Error(`${DEFAULT_CONFIG_NAME} not found in ${root}`);
|
|
1224
1239
|
};
|
|
1225
1240
|
async function loadConfig({ cwd = process.cwd(), path, envMode }) {
|
|
1226
1241
|
const configFilePath = resolveConfigPath(cwd, path);
|
|
1227
|
-
const { content } = await (0,
|
|
1228
|
-
cwd: (0,
|
|
1242
|
+
const { content } = await (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.loadConfig)({
|
|
1243
|
+
cwd: (0, __WEBPACK_EXTERNAL_MODULE_node_path__.dirname)(configFilePath),
|
|
1229
1244
|
path: configFilePath,
|
|
1230
1245
|
envMode
|
|
1231
1246
|
});
|
|
@@ -1292,7 +1307,7 @@ const composeExternalsWarnConfig = (format, ...externalsArray)=>{
|
|
|
1292
1307
|
};
|
|
1293
1308
|
if (contextInfo.issuer && 'commonjs' === dependencyType) {
|
|
1294
1309
|
matchUserExternals(externals, request, _callback);
|
|
1295
|
-
if (externalized)
|
|
1310
|
+
if (externalized) __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.warn(composeModuleImportWarn(request));
|
|
1296
1311
|
}
|
|
1297
1312
|
callback();
|
|
1298
1313
|
}
|
|
@@ -1302,11 +1317,12 @@ const composeExternalsWarnConfig = (format, ...externalsArray)=>{
|
|
|
1302
1317
|
};
|
|
1303
1318
|
const getAutoExternalDefaultValue = (format, autoExternal)=>autoExternal ?? isIntermediateOutputFormat(format);
|
|
1304
1319
|
const composeAutoExternalConfig = (options)=>{
|
|
1305
|
-
const { format, pkgJson, userExternals } = options;
|
|
1320
|
+
const { bundle, format, pkgJson, userExternals } = options;
|
|
1321
|
+
if (false === bundle) return {};
|
|
1306
1322
|
const autoExternal = getAutoExternalDefaultValue(format, options.autoExternal);
|
|
1307
1323
|
if (false === autoExternal) return {};
|
|
1308
1324
|
if (!pkgJson) {
|
|
1309
|
-
|
|
1325
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.warn('autoExternal configuration will not be applied due to read package.json failed');
|
|
1310
1326
|
return {};
|
|
1311
1327
|
}
|
|
1312
1328
|
const userExternalKeys = userExternals && isObject(userExternals) ? Object.keys(userExternals) : [];
|
|
@@ -1377,30 +1393,30 @@ function composeBannerFooterConfig(banner, footer) {
|
|
|
1377
1393
|
if (isEmptyObject(bannerConfig) && isEmptyObject(footerConfig)) return {};
|
|
1378
1394
|
const plugins = [];
|
|
1379
1395
|
if (!isEmptyObject(bannerConfig)) {
|
|
1380
|
-
if (bannerConfig.js) plugins.push(new
|
|
1396
|
+
if (bannerConfig.js) plugins.push(new __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.BannerPlugin({
|
|
1381
1397
|
banner: bannerConfig.js,
|
|
1382
|
-
stage:
|
|
1398
|
+
stage: __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE + 1,
|
|
1383
1399
|
raw: true,
|
|
1384
1400
|
include: /\.(js|mjs|cjs)$/
|
|
1385
1401
|
}));
|
|
1386
|
-
if (bannerConfig.css) plugins.push(new
|
|
1402
|
+
if (bannerConfig.css) plugins.push(new __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.BannerPlugin({
|
|
1387
1403
|
banner: bannerConfig.css,
|
|
1388
|
-
stage:
|
|
1404
|
+
stage: __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE + 1,
|
|
1389
1405
|
raw: true,
|
|
1390
1406
|
include: /\.(css)$/
|
|
1391
1407
|
}));
|
|
1392
1408
|
}
|
|
1393
1409
|
if (!isEmptyObject(footerConfig)) {
|
|
1394
|
-
if (footerConfig.js) plugins.push(new
|
|
1410
|
+
if (footerConfig.js) plugins.push(new __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.BannerPlugin({
|
|
1395
1411
|
banner: footerConfig.js,
|
|
1396
|
-
stage:
|
|
1412
|
+
stage: __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE + 1,
|
|
1397
1413
|
raw: true,
|
|
1398
1414
|
footer: true,
|
|
1399
1415
|
include: /\.(js|mjs|cjs)$/
|
|
1400
1416
|
}));
|
|
1401
|
-
if (footerConfig.css) plugins.push(new
|
|
1417
|
+
if (footerConfig.css) plugins.push(new __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.BannerPlugin({
|
|
1402
1418
|
banner: footerConfig.css,
|
|
1403
|
-
stage:
|
|
1419
|
+
stage: __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE + 1,
|
|
1404
1420
|
raw: true,
|
|
1405
1421
|
footer: true,
|
|
1406
1422
|
include: /\.(css)$/
|
|
@@ -1425,7 +1441,7 @@ function composeDecoratorsConfig(compilerOptions, version) {
|
|
|
1425
1441
|
};
|
|
1426
1442
|
}
|
|
1427
1443
|
async function createConstantRsbuildConfig() {
|
|
1428
|
-
return (0,
|
|
1444
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.defineConfig)({
|
|
1429
1445
|
dev: {
|
|
1430
1446
|
progressBar: false
|
|
1431
1447
|
},
|
|
@@ -1681,7 +1697,7 @@ const composeShimsConfig = (format, shims)=>{
|
|
|
1681
1697
|
enabledShims
|
|
1682
1698
|
};
|
|
1683
1699
|
};
|
|
1684
|
-
const composeModuleImportWarn = (request)=>`The externalized commonjs request ${
|
|
1700
|
+
const composeModuleImportWarn = (request)=>`The externalized commonjs request ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].green(`"${request}"`)} will use ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].blue('"module"')} external type in ESM format. If you want to specify other external type, consider setting the request and type with ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].blue('"output.externals"')}.`;
|
|
1685
1701
|
const composeExternalsConfig = (format, externals)=>{
|
|
1686
1702
|
const externalsTypeMap = {
|
|
1687
1703
|
esm: 'module-import',
|
|
@@ -1722,7 +1738,7 @@ const composeAutoExtensionConfig = (config, autoExtension, pkgJson)=>{
|
|
|
1722
1738
|
}
|
|
1723
1739
|
}
|
|
1724
1740
|
};
|
|
1725
|
-
const updatedJsExtension = 'string' == typeof updatedConfig.output?.filename?.js && updatedConfig.output?.filename?.js ? (0,
|
|
1741
|
+
const updatedJsExtension = 'string' == typeof updatedConfig.output?.filename?.js && updatedConfig.output?.filename?.js ? (0, __WEBPACK_EXTERNAL_MODULE_node_path__.extname)(updatedConfig.output.filename.js) : jsExtension;
|
|
1726
1742
|
return {
|
|
1727
1743
|
config: updatedConfig,
|
|
1728
1744
|
jsExtension: updatedJsExtension,
|
|
@@ -1754,62 +1770,99 @@ const composeSyntaxConfig = (target, syntax)=>{
|
|
|
1754
1770
|
}
|
|
1755
1771
|
};
|
|
1756
1772
|
};
|
|
1757
|
-
const
|
|
1773
|
+
const traverseEntryQuery = (entry, callback)=>{
|
|
1758
1774
|
const newEntry = {};
|
|
1759
1775
|
for (const [key, value] of Object.entries(entry)){
|
|
1760
1776
|
let result = value;
|
|
1761
|
-
result = 'string' == typeof value ?
|
|
1777
|
+
result = 'string' == typeof value ? callback(value) : Array.isArray(value) ? value.map(callback) : {
|
|
1762
1778
|
...value,
|
|
1763
|
-
import: 'string' == typeof value.import ?
|
|
1779
|
+
import: 'string' == typeof value.import ? callback(value.import) : value.import.map(callback)
|
|
1764
1780
|
};
|
|
1765
1781
|
newEntry[key] = result;
|
|
1766
1782
|
}
|
|
1767
1783
|
return newEntry;
|
|
1768
1784
|
};
|
|
1769
|
-
const
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1785
|
+
const appendEntryQuery = (entries)=>traverseEntryQuery(entries, (item)=>`${item}?${RSLIB_ENTRY_QUERY}`);
|
|
1786
|
+
const composeEntryConfig = async (rawEntry, bundle, root, cssModulesAuto)=>{
|
|
1787
|
+
let entries = rawEntry;
|
|
1788
|
+
if (!entries) {
|
|
1789
|
+
if (false !== bundle) return {
|
|
1790
|
+
entryConfig: {},
|
|
1791
|
+
lcp: null
|
|
1792
|
+
};
|
|
1793
|
+
entries = {
|
|
1794
|
+
index: 'src/**'
|
|
1795
|
+
};
|
|
1796
|
+
}
|
|
1797
|
+
if (false !== bundle) {
|
|
1798
|
+
let isFileEntry = false;
|
|
1799
|
+
traverseEntryQuery(entries, (entry)=>{
|
|
1800
|
+
const entryAbsPath = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].isAbsolute(entry) ? entry : __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(root, entry);
|
|
1801
|
+
if (__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].existsSync(entryAbsPath)) {
|
|
1802
|
+
const stats = __WEBPACK_EXTERNAL_MODULE_node_fs__["default"].statSync(entryAbsPath);
|
|
1803
|
+
isFileEntry = stats.isFile();
|
|
1778
1804
|
}
|
|
1779
|
-
|
|
1780
|
-
lcp: null
|
|
1781
|
-
};
|
|
1782
|
-
const resolvedEntries = {};
|
|
1783
|
-
for (const key of Object.keys(entries)){
|
|
1784
|
-
const entry = entries[key];
|
|
1785
|
-
const entryFiles = Array.isArray(entry) ? entry : 'string' == typeof entry ? [
|
|
1786
|
-
entry
|
|
1787
|
-
] : null;
|
|
1788
|
-
if (!entryFiles) throw new Error('Entry can only be a string or an array of strings for now');
|
|
1789
|
-
const globEntryFiles = await (0, __WEBPACK_EXTERNAL_MODULE_tinyglobby__.glob)(entryFiles, {
|
|
1790
|
-
cwd: root,
|
|
1791
|
-
absolute: true
|
|
1805
|
+
return entry;
|
|
1792
1806
|
});
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1807
|
+
if (!isFileEntry) throw new Error(`Glob pattern is not supported when "bundle" is "true", considering ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].green('set "bundle" to "false"')} to use bundleless mode. See ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].green('https://lib.rsbuild.dev/guide/basic/output-structure')} for more details.`);
|
|
1808
|
+
return {
|
|
1809
|
+
entryConfig: {
|
|
1810
|
+
source: {
|
|
1811
|
+
entry: appendEntryQuery(entries)
|
|
1812
|
+
}
|
|
1813
|
+
},
|
|
1814
|
+
lcp: null
|
|
1815
|
+
};
|
|
1816
|
+
}
|
|
1817
|
+
const scanGlobEntries = async (calcLcp)=>{
|
|
1818
|
+
const resolvedEntries = {};
|
|
1819
|
+
for (const key of Object.keys(entries)){
|
|
1820
|
+
const entry = entries[key];
|
|
1821
|
+
const entryFiles = Array.isArray(entry) ? entry : 'string' == typeof entry ? [
|
|
1822
|
+
entry
|
|
1823
|
+
] : null;
|
|
1824
|
+
if (!entryFiles) throw new Error('Entry can only be a string or an array of strings for now');
|
|
1825
|
+
const globEntryFiles = await (0, __WEBPACK_EXTERNAL_MODULE_tinyglobby__.glob)(entryFiles, {
|
|
1826
|
+
cwd: root,
|
|
1827
|
+
absolute: true
|
|
1828
|
+
});
|
|
1829
|
+
const resolvedEntryFiles = globEntryFiles.filter((file)=>ENTRY_EXTENSIONS_PATTERN.test(file));
|
|
1830
|
+
if (0 === resolvedEntryFiles.length) throw new Error(`Cannot find ${resolvedEntryFiles}`);
|
|
1831
|
+
const lcp = await calcLongestCommonPath(resolvedEntryFiles);
|
|
1832
|
+
const outBase = null === lcp ? root : lcp;
|
|
1833
|
+
function getEntryName(file) {
|
|
1834
|
+
const { dir, name } = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].parse(__WEBPACK_EXTERNAL_MODULE_node_path__["default"].relative(outBase, file));
|
|
1835
|
+
const entryFileName = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].join(dir, name);
|
|
1836
|
+
if (isCssGlobalFile(file, cssModulesAuto)) return `${RSLIB_CSS_ENTRY_FLAG}/${entryFileName}`;
|
|
1837
|
+
return entryFileName;
|
|
1838
|
+
}
|
|
1839
|
+
for (const file of resolvedEntryFiles){
|
|
1840
|
+
const entryName = getEntryName(file);
|
|
1841
|
+
if (resolvedEntries[entryName]) __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.warn(`duplicate entry: ${entryName}, this may lead to the incorrect output, please rename the file`);
|
|
1842
|
+
resolvedEntries[entryName] = file;
|
|
1843
|
+
}
|
|
1802
1844
|
}
|
|
1803
|
-
|
|
1804
|
-
const
|
|
1805
|
-
|
|
1806
|
-
|
|
1845
|
+
if (calcLcp) {
|
|
1846
|
+
const lcp = await calcLongestCommonPath(Object.values(resolvedEntries));
|
|
1847
|
+
return {
|
|
1848
|
+
resolvedEntries,
|
|
1849
|
+
lcp
|
|
1850
|
+
};
|
|
1807
1851
|
}
|
|
1808
|
-
|
|
1809
|
-
|
|
1852
|
+
return {
|
|
1853
|
+
resolvedEntries,
|
|
1854
|
+
lcp: null
|
|
1855
|
+
};
|
|
1856
|
+
};
|
|
1857
|
+
const { lcp } = await scanGlobEntries(true);
|
|
1810
1858
|
const entryConfig = {
|
|
1811
|
-
|
|
1812
|
-
|
|
1859
|
+
tools: {
|
|
1860
|
+
rspack: {
|
|
1861
|
+
entry: async ()=>{
|
|
1862
|
+
const { resolvedEntries } = await scanGlobEntries(false);
|
|
1863
|
+
return appendEntryQuery(resolvedEntries);
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1813
1866
|
}
|
|
1814
1867
|
};
|
|
1815
1868
|
return {
|
|
@@ -1821,7 +1874,8 @@ const composeBundlelessExternalConfig = (jsExtension, redirect, cssModulesAuto,
|
|
|
1821
1874
|
if (bundle) return {
|
|
1822
1875
|
config: {}
|
|
1823
1876
|
};
|
|
1824
|
-
const
|
|
1877
|
+
const styleRedirectPath = redirect.style?.path ?? true;
|
|
1878
|
+
const styleRedirectExtension = redirect.style?.extension ?? true;
|
|
1825
1879
|
const jsRedirectPath = redirect.js?.path ?? true;
|
|
1826
1880
|
const jsRedirectExtension = redirect.js?.extension ?? true;
|
|
1827
1881
|
let resolver;
|
|
@@ -1836,20 +1890,34 @@ const composeBundlelessExternalConfig = (jsExtension, redirect, cssModulesAuto,
|
|
|
1836
1890
|
async (data, callback)=>{
|
|
1837
1891
|
const { request, getResolve, context, contextInfo } = data;
|
|
1838
1892
|
if (!request || !getResolve || !context || !contextInfo) return callback();
|
|
1893
|
+
const { issuer } = contextInfo;
|
|
1839
1894
|
if (!resolver) resolver = await getResolve();
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
if (false !== cssExternal) return cssExternal;
|
|
1844
|
-
if (jsRedirectPath) try {
|
|
1895
|
+
async function redirectPath(request) {
|
|
1896
|
+
try {
|
|
1897
|
+
let resolvedRequest = request;
|
|
1845
1898
|
resolvedRequest = await resolver(context, resolvedRequest);
|
|
1846
|
-
|
|
1847
|
-
|
|
1899
|
+
if (!resolvedRequest.includes('node_modules')) {
|
|
1900
|
+
resolvedRequest = normalizeSlash(__WEBPACK_EXTERNAL_MODULE_node_path__["default"].relative(__WEBPACK_EXTERNAL_MODULE_node_path__["default"].dirname(issuer), resolvedRequest));
|
|
1901
|
+
if ('.' !== resolvedRequest[0]) resolvedRequest = `./${resolvedRequest}`;
|
|
1902
|
+
return resolvedRequest;
|
|
1903
|
+
}
|
|
1904
|
+
return;
|
|
1848
1905
|
} catch (e) {
|
|
1849
|
-
|
|
1906
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.debug(`Failed to resolve module ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].green(`"${request}"`)} from ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].green(issuer)}. If it's an npm package, consider adding it to dependencies or peerDependencies in package.json to make it externalized.`);
|
|
1907
|
+
return request;
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
if (issuer) {
|
|
1911
|
+
let resolvedRequest = request;
|
|
1912
|
+
const cssExternal = await cssExternalHandler(resolvedRequest, callback, jsExtension, cssModulesAuto, styleRedirectPath, styleRedirectExtension, redirectPath);
|
|
1913
|
+
if (false !== cssExternal) return cssExternal;
|
|
1914
|
+
if (jsRedirectPath) {
|
|
1915
|
+
const redirectedPath = await redirectPath(resolvedRequest);
|
|
1916
|
+
if (void 0 === redirectedPath) return callback(void 0, request);
|
|
1917
|
+
resolvedRequest = redirectedPath;
|
|
1850
1918
|
}
|
|
1851
1919
|
if (jsRedirectExtension && resolvedRequest.startsWith('.')) {
|
|
1852
|
-
const ext = (0,
|
|
1920
|
+
const ext = (0, __WEBPACK_EXTERNAL_MODULE_node_path__.extname)(resolvedRequest);
|
|
1853
1921
|
if (ext) {
|
|
1854
1922
|
if (!JS_EXTENSIONS_PATTERN.test(resolvedRequest)) return callback();
|
|
1855
1923
|
resolvedRequest = resolvedRequest.replace(/\.[^.]+$/, jsExtension);
|
|
@@ -1945,7 +2013,7 @@ const composeExternalHelpersConfig = (externalHelpers, pkgJson)=>{
|
|
|
1945
2013
|
...Object.keys(pkgJson?.devDependencies ?? [])
|
|
1946
2014
|
];
|
|
1947
2015
|
if (!deps.includes(SWC_HELPERS)) {
|
|
1948
|
-
|
|
2016
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.error(`${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].green('externalHelpers')} is enabled, but the ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].blue(SWC_HELPERS)} dependency declaration was not found in package.json.`);
|
|
1949
2017
|
process.exit(1);
|
|
1950
2018
|
}
|
|
1951
2019
|
defaultConfig = Object.assign(defaultConfig, {
|
|
@@ -1978,6 +2046,7 @@ async function composeLibRsbuildConfig(config, root, sharedPlugins) {
|
|
|
1978
2046
|
const { config: targetConfig, externalsConfig: targetExternalsConfig, target } = composeTargetConfig(config.output?.target, format);
|
|
1979
2047
|
const syntaxConfig = composeSyntaxConfig(target, config?.syntax);
|
|
1980
2048
|
const autoExternalConfig = composeAutoExternalConfig({
|
|
2049
|
+
bundle,
|
|
1981
2050
|
format: format,
|
|
1982
2051
|
autoExternal,
|
|
1983
2052
|
pkgJson,
|
|
@@ -1987,21 +2056,22 @@ async function composeLibRsbuildConfig(config, root, sharedPlugins) {
|
|
|
1987
2056
|
const cssConfig = composeCssConfig(lcp, config.bundle);
|
|
1988
2057
|
const assetConfig = composeAssetConfig(bundle, format);
|
|
1989
2058
|
const entryChunkConfig = composeEntryChunkConfig({
|
|
1990
|
-
enabledImportMetaUrlShim: enabledShims.cjs['import.meta.url']
|
|
2059
|
+
enabledImportMetaUrlShim: enabledShims.cjs['import.meta.url'],
|
|
2060
|
+
contextToWatch: lcp
|
|
1991
2061
|
});
|
|
1992
2062
|
const dtsConfig = await composeDtsConfig(config, dtsExtension);
|
|
1993
2063
|
const externalsWarnConfig = composeExternalsWarnConfig(format, autoExternalConfig?.output?.externals, userExternalsConfig?.output?.externals);
|
|
1994
2064
|
const minifyConfig = composeMinifyConfig(config);
|
|
1995
2065
|
const bannerFooterConfig = composeBannerFooterConfig(banner, footer);
|
|
1996
2066
|
const decoratorsConfig = composeDecoratorsConfig(compilerOptions, config.source?.decorators?.version);
|
|
1997
|
-
return (0,
|
|
2067
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.mergeRsbuildConfig)(formatConfig, shimsConfig, syntaxConfig, externalHelpersConfig, autoExtensionConfig, targetConfig, externalsWarnConfig, autoExternalConfig, targetExternalsConfig, userExternalsConfig, bundlelessExternalConfig, entryConfig, cssConfig, assetConfig, entryChunkConfig, minifyConfig, dtsConfig, bannerFooterConfig, decoratorsConfig);
|
|
1998
2068
|
}
|
|
1999
2069
|
async function composeCreateRsbuildConfig(rslibConfig) {
|
|
2000
2070
|
const constantRsbuildConfig = await createConstantRsbuildConfig();
|
|
2001
2071
|
const { lib: libConfigsArray, mode, root, plugins: sharedPlugins, dev, server, ...sharedRsbuildConfig } = rslibConfig;
|
|
2002
2072
|
if (!libConfigsArray) throw new Error(`Expect lib field to be an array, but got ${libConfigsArray}.`);
|
|
2003
2073
|
const libConfigPromises = libConfigsArray.map(async (libConfig)=>{
|
|
2004
|
-
const userConfig = (0,
|
|
2074
|
+
const userConfig = (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.mergeRsbuildConfig)(sharedRsbuildConfig, libConfig);
|
|
2005
2075
|
const libRsbuildConfig = await composeLibRsbuildConfig(userConfig, root, sharedPlugins);
|
|
2006
2076
|
userConfig.source ??= {};
|
|
2007
2077
|
userConfig.source.entry = {};
|
|
@@ -2009,7 +2079,7 @@ async function composeCreateRsbuildConfig(rslibConfig) {
|
|
|
2009
2079
|
delete userConfig.output.externals;
|
|
2010
2080
|
const config = {
|
|
2011
2081
|
format: libConfig.format,
|
|
2012
|
-
config: (0,
|
|
2082
|
+
config: (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.mergeRsbuildConfig)(constantRsbuildConfig, libRsbuildConfig, omit(userConfig, {
|
|
2013
2083
|
id: true,
|
|
2014
2084
|
bundle: true,
|
|
2015
2085
|
format: true,
|
|
@@ -2066,7 +2136,9 @@ async function composeRsbuildEnvironments(rslibConfig) {
|
|
|
2066
2136
|
}
|
|
2067
2137
|
const pruneEnvironments = (environments, libs)=>{
|
|
2068
2138
|
if (!libs) return environments;
|
|
2069
|
-
|
|
2139
|
+
const filteredEnvironments = Object.fromEntries(Object.entries(environments).filter(([name])=>libs.includes(name)));
|
|
2140
|
+
if (0 === Object.keys(filteredEnvironments).length) throw new Error(`The following libs are not found: ${libs.map((lib)=>`"${lib}"`).join(', ')}.`);
|
|
2141
|
+
return filteredEnvironments;
|
|
2070
2142
|
};
|
|
2071
2143
|
async function watchFilesForRestart(files, restart) {
|
|
2072
2144
|
if (!files.length) return;
|
|
@@ -2096,15 +2168,15 @@ const clearConsole = ()=>{
|
|
|
2096
2168
|
const beforeRestart = async ({ filePath, clear = true } = {})=>{
|
|
2097
2169
|
if (clear) clearConsole();
|
|
2098
2170
|
if (filePath) {
|
|
2099
|
-
const filename =
|
|
2100
|
-
|
|
2101
|
-
} else
|
|
2171
|
+
const filename = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].basename(filePath);
|
|
2172
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.info(`Restart because ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js__["default"].yellow(filename)} is changed.\n`);
|
|
2173
|
+
} else __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.info('Restarting...\n');
|
|
2102
2174
|
for (const cleaner of cleaners)await cleaner();
|
|
2103
2175
|
cleaners = [];
|
|
2104
2176
|
};
|
|
2105
2177
|
async function build(config, options = {}) {
|
|
2106
2178
|
const { environments } = await composeRsbuildEnvironments(config);
|
|
2107
|
-
const rsbuildInstance = await (0,
|
|
2179
|
+
const rsbuildInstance = await (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.createRsbuild)({
|
|
2108
2180
|
rsbuildConfig: {
|
|
2109
2181
|
mode: 'production',
|
|
2110
2182
|
root: config.root,
|
|
@@ -2122,13 +2194,13 @@ async function build(config, options = {}) {
|
|
|
2122
2194
|
return rsbuildInstance;
|
|
2123
2195
|
}
|
|
2124
2196
|
const getEnvDir = (cwd, envDir)=>{
|
|
2125
|
-
if (envDir) return
|
|
2197
|
+
if (envDir) return __WEBPACK_EXTERNAL_MODULE_node_path__["default"].isAbsolute(envDir) ? envDir : __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(cwd, envDir);
|
|
2126
2198
|
return cwd;
|
|
2127
2199
|
};
|
|
2128
2200
|
async function init(options) {
|
|
2129
2201
|
const cwd = process.cwd();
|
|
2130
2202
|
const root = options.root ? getAbsolutePath(cwd, options.root) : cwd;
|
|
2131
|
-
const envs = (0,
|
|
2203
|
+
const envs = (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.loadEnv)({
|
|
2132
2204
|
cwd: getEnvDir(root, options.envDir),
|
|
2133
2205
|
mode: options.envMode
|
|
2134
2206
|
});
|
|
@@ -2155,7 +2227,7 @@ async function init(options) {
|
|
|
2155
2227
|
}
|
|
2156
2228
|
async function inspect(config, options = {}) {
|
|
2157
2229
|
const { environments } = await composeRsbuildEnvironments(config);
|
|
2158
|
-
const rsbuildInstance = await (0,
|
|
2230
|
+
const rsbuildInstance = await (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.createRsbuild)({
|
|
2159
2231
|
rsbuildConfig: {
|
|
2160
2232
|
mode: 'production',
|
|
2161
2233
|
root: config.root,
|
|
@@ -2184,9 +2256,9 @@ async function initMFRsbuild(config, options = {}) {
|
|
|
2184
2256
|
if (!options?.lib) return isMf;
|
|
2185
2257
|
return env.id && options.lib.includes(env.id);
|
|
2186
2258
|
}).map((env)=>env.id);
|
|
2187
|
-
if (!selectedEnvironmentIds.length) throw new Error(
|
|
2259
|
+
if (!selectedEnvironmentIds.length) throw new Error(`No mf format found in ${options.lib ? `libs ${options.lib.map((lib)=>`"${lib}"`).join(', ')}` : 'your config'}, please check your config to ensure that the mf format is enabled correctly.`);
|
|
2188
2260
|
const selectedEnvironments = pruneEnvironments(environments, selectedEnvironmentIds);
|
|
2189
|
-
const rsbuildInstance = await (0,
|
|
2261
|
+
const rsbuildInstance = await (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.createRsbuild)({
|
|
2190
2262
|
rsbuildConfig: {
|
|
2191
2263
|
mode: 'development',
|
|
2192
2264
|
root: config.root,
|
|
@@ -2207,10 +2279,10 @@ const repeatableOption = (value, previous)=>(previous ?? []).concat([
|
|
|
2207
2279
|
value
|
|
2208
2280
|
]);
|
|
2209
2281
|
function runCli() {
|
|
2210
|
-
|
|
2211
|
-
const buildCommand =
|
|
2212
|
-
const inspectCommand =
|
|
2213
|
-
const mfDevCommand =
|
|
2282
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.name('rslib').usage('<command> [options]').version("0.3.0");
|
|
2283
|
+
const buildCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.command('build');
|
|
2284
|
+
const inspectCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.command('inspect');
|
|
2285
|
+
const mfDevCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.command('mf-dev');
|
|
2214
2286
|
[
|
|
2215
2287
|
buildCommand,
|
|
2216
2288
|
inspectCommand,
|
|
@@ -2227,8 +2299,8 @@ function runCli() {
|
|
|
2227
2299
|
};
|
|
2228
2300
|
await cliBuild();
|
|
2229
2301
|
} catch (err) {
|
|
2230
|
-
|
|
2231
|
-
|
|
2302
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.error('Failed to build.');
|
|
2303
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.error(err);
|
|
2232
2304
|
process.exit(1);
|
|
2233
2305
|
}
|
|
2234
2306
|
});
|
|
@@ -2242,8 +2314,8 @@ function runCli() {
|
|
|
2242
2314
|
verbose: options.verbose
|
|
2243
2315
|
});
|
|
2244
2316
|
} catch (err) {
|
|
2245
|
-
|
|
2246
|
-
|
|
2317
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.error('Failed to inspect config.');
|
|
2318
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.error(err);
|
|
2247
2319
|
process.exit(1);
|
|
2248
2320
|
}
|
|
2249
2321
|
});
|
|
@@ -2260,13 +2332,13 @@ function runCli() {
|
|
|
2260
2332
|
};
|
|
2261
2333
|
await cliMfDev();
|
|
2262
2334
|
} catch (err) {
|
|
2263
|
-
|
|
2264
|
-
|
|
2335
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.error('Failed to start mf-dev.');
|
|
2336
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.error(err);
|
|
2265
2337
|
process.exit(1);
|
|
2266
2338
|
}
|
|
2267
2339
|
});
|
|
2268
|
-
|
|
2340
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.parse();
|
|
2269
2341
|
}
|
|
2270
|
-
const src_rslib_entry_version = "0.
|
|
2271
|
-
var __webpack_exports__logger =
|
|
2342
|
+
const src_rslib_entry_version = "0.3.0";
|
|
2343
|
+
var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger;
|
|
2272
2344
|
export { build, defineConfig, inspect, loadConfig, prepareCli, runCli, startMFDevServer, composeCreateRsbuildConfig as unstable_composeCreateRsbuildConfig, src_rslib_entry_version as version, __webpack_exports__logger as logger };
|