@rslib/core 0.14.0 → 0.15.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/dist/index.js +38 -5
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1521,6 +1521,7 @@ function composeMinifyConfig(config) {
|
|
|
1521
1521
|
js: true,
|
|
1522
1522
|
css: false,
|
|
1523
1523
|
jsOptions: {
|
|
1524
|
+
test: /\.[cm]?jsx?(\?.*)?$/,
|
|
1524
1525
|
minimizerOptions: {
|
|
1525
1526
|
mangle: false,
|
|
1526
1527
|
minify: 'mf' === format,
|
|
@@ -1879,6 +1880,34 @@ const fixJsModuleTypePlugin = ()=>({
|
|
|
1879
1880
|
});
|
|
1880
1881
|
}
|
|
1881
1882
|
});
|
|
1883
|
+
const BundlePlugin = ()=>({
|
|
1884
|
+
name: 'rslib:bundle',
|
|
1885
|
+
setup (api) {
|
|
1886
|
+
api.onBeforeBuild({
|
|
1887
|
+
order: 'post',
|
|
1888
|
+
handler: ({ bundlerConfigs })=>{
|
|
1889
|
+
if (bundlerConfigs) {
|
|
1890
|
+
for (const config of bundlerConfigs)if (config?.module?.parser?.javascript?.jsx === true) {
|
|
1891
|
+
logger.error('Bundle mode does not support preserving JSX syntax. Set "bundle" to "false" or change the JSX runtime to `automatic` or `classic`. Check out ' + picocolors.green('https://rslib.rs/guide/solution/react#jsx-transform') + ' for more details.');
|
|
1892
|
+
process.exit(1);
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
});
|
|
1897
|
+
}
|
|
1898
|
+
});
|
|
1899
|
+
const composeBundleConfig = (bundle)=>{
|
|
1900
|
+
if (bundle) return {
|
|
1901
|
+
rsbuildConfig: {
|
|
1902
|
+
plugins: [
|
|
1903
|
+
BundlePlugin()
|
|
1904
|
+
]
|
|
1905
|
+
}
|
|
1906
|
+
};
|
|
1907
|
+
return {
|
|
1908
|
+
rsbuildConfig: {}
|
|
1909
|
+
};
|
|
1910
|
+
};
|
|
1882
1911
|
const composeShimsConfig = (format, shims)=>{
|
|
1883
1912
|
const resolvedShims = {
|
|
1884
1913
|
cjs: {
|
|
@@ -2344,6 +2373,7 @@ async function composeLibRsbuildConfig(config, multiCompilerIndex, root, sharedP
|
|
|
2344
2373
|
const { compilerOptions } = await loadTsconfig(rootPath, config.source?.tsconfigPath);
|
|
2345
2374
|
const cssModulesAuto = config.output?.cssModules?.auto ?? true;
|
|
2346
2375
|
const { format = 'esm', shims, bundle = true, banner = {}, footer = {}, autoExtension = true, autoExternal, externalHelpers = false, redirect = {}, umdName } = config;
|
|
2376
|
+
const { rsbuildConfig: bundleConfig } = composeBundleConfig(bundle);
|
|
2347
2377
|
const { rsbuildConfig: shimsConfig, enabledShims } = composeShimsConfig(format, shims);
|
|
2348
2378
|
const formatConfig = composeFormatConfig({
|
|
2349
2379
|
format,
|
|
@@ -2377,7 +2407,7 @@ async function composeLibRsbuildConfig(config, multiCompilerIndex, root, sharedP
|
|
|
2377
2407
|
const bannerFooterConfig = composeBannerFooterConfig(banner, footer);
|
|
2378
2408
|
const decoratorsConfig = composeDecoratorsConfig(compilerOptions, config.source?.decorators?.version);
|
|
2379
2409
|
const printFileSizeConfig = composePrintFileSizeConfig(bundle, target);
|
|
2380
|
-
return (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.mergeRsbuildConfig)(formatConfig, shimsConfig, syntaxConfig, externalHelpersConfig, outputFilenameConfig, targetConfig, externalsWarnConfig, userExternalsConfig, autoExternalConfig, targetExternalsConfig, bundlelessExternalConfig, entryConfig, cssConfig, assetConfig, entryChunkConfig, minifyConfig, dtsConfig, bannerFooterConfig, decoratorsConfig, printFileSizeConfig);
|
|
2410
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.mergeRsbuildConfig)(bundleConfig, formatConfig, shimsConfig, syntaxConfig, externalHelpersConfig, outputFilenameConfig, targetConfig, externalsWarnConfig, userExternalsConfig, autoExternalConfig, targetExternalsConfig, bundlelessExternalConfig, entryConfig, cssConfig, assetConfig, entryChunkConfig, minifyConfig, dtsConfig, bannerFooterConfig, decoratorsConfig, printFileSizeConfig);
|
|
2381
2411
|
}
|
|
2382
2412
|
async function composeCreateRsbuildConfig(rslibConfig) {
|
|
2383
2413
|
const constantRsbuildConfig = await createConstantRsbuildConfig();
|
|
@@ -3047,7 +3077,10 @@ async function inspect(config, options = {}) {
|
|
|
3047
3077
|
mode: options.mode,
|
|
3048
3078
|
verbose: options.verbose,
|
|
3049
3079
|
outputPath: options.output,
|
|
3050
|
-
writeToDisk: true
|
|
3080
|
+
writeToDisk: true,
|
|
3081
|
+
extraConfigs: {
|
|
3082
|
+
rslib: config
|
|
3083
|
+
}
|
|
3051
3084
|
});
|
|
3052
3085
|
return rsbuildInstance;
|
|
3053
3086
|
}
|
|
@@ -3093,7 +3126,7 @@ const applyCommonOptions = (cli)=>{
|
|
|
3093
3126
|
function runCli() {
|
|
3094
3127
|
const cli = dist('rslib');
|
|
3095
3128
|
cli.help();
|
|
3096
|
-
cli.version("0.
|
|
3129
|
+
cli.version("0.15.0");
|
|
3097
3130
|
applyCommonOptions(cli);
|
|
3098
3131
|
const buildCommand = cli.command('build', 'build the library for production');
|
|
3099
3132
|
const inspectCommand = cli.command('inspect', 'inspect the Rsbuild / Rspack configs of Rslib projects');
|
|
@@ -3176,8 +3209,8 @@ function prepareCli() {
|
|
|
3176
3209
|
setupLogLevel();
|
|
3177
3210
|
const { npm_execpath } = process.env;
|
|
3178
3211
|
if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) logger.log();
|
|
3179
|
-
logger.greet(` Rslib v0.
|
|
3212
|
+
logger.greet(` Rslib v0.15.0\n`);
|
|
3180
3213
|
}
|
|
3181
|
-
const src_version = "0.
|
|
3214
|
+
const src_version = "0.15.0";
|
|
3182
3215
|
var __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.rspack;
|
|
3183
3216
|
export { build, defineConfig, inspect, loadConfig, logger, prepareCli, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__ as rsbuild, runCli, startMFDevServer, composeCreateRsbuildConfig as unstable_composeCreateRsbuildConfig, src_version as version, __webpack_exports__rspack as rspack };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rslib/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "The Rsbuild-based library development tool.",
|
|
5
5
|
"homepage": "https://rslib.rs",
|
|
6
6
|
"bugs": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"types.d.ts"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@rsbuild/core": "~1.5.
|
|
40
|
-
"rsbuild-plugin-dts": "0.
|
|
39
|
+
"@rsbuild/core": "~1.5.13",
|
|
40
|
+
"rsbuild-plugin-dts": "0.15.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@module-federation/rsbuild-plugin": "^0.19.1",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"cac": "^6.7.14",
|
|
46
46
|
"chokidar": "^4.0.3",
|
|
47
47
|
"fs-extra": "^11.3.2",
|
|
48
|
-
"memfs": "^4.
|
|
48
|
+
"memfs": "^4.47.0",
|
|
49
49
|
"path-serializer": "0.5.1",
|
|
50
50
|
"picocolors": "1.1.1",
|
|
51
51
|
"prebundle": "1.4.2",
|
|
52
52
|
"rsbuild-plugin-publint": "^0.3.3",
|
|
53
|
-
"rslib": "npm:@rslib/core@0.
|
|
53
|
+
"rslib": "npm:@rslib/core@0.14.0",
|
|
54
54
|
"rslog": "^1.2.11",
|
|
55
55
|
"tinyglobby": "0.2.14",
|
|
56
56
|
"tsconfck": "3.1.6",
|