@rslib/core 0.6.9 → 0.7.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 +14 -13
- package/dist-types/types/config.d.ts +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -181,7 +181,7 @@ function prepareCli() {
|
|
|
181
181
|
initNodeEnv();
|
|
182
182
|
const { npm_execpath } = process.env;
|
|
183
183
|
if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
|
|
184
|
-
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rslib v0.
|
|
184
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rslib v0.7.0\n`);
|
|
185
185
|
}
|
|
186
186
|
const DEFAULT_CONFIG_NAME = 'rslib.config';
|
|
187
187
|
const DEFAULT_CONFIG_EXTENSIONS = [
|
|
@@ -1765,6 +1765,7 @@ const composeFormatConfig = ({ format, bundle = true, umdName, pkgJson })=>{
|
|
|
1765
1765
|
return config;
|
|
1766
1766
|
}
|
|
1767
1767
|
case 'mf':
|
|
1768
|
+
if (false === bundle) throw new Error('When using "mf" format, "bundle" must be set to "true". Since the default value for "bundle" is "true", so you can either explicitly set it to "true" or remove the field entirely.');
|
|
1768
1769
|
return {
|
|
1769
1770
|
dev: {
|
|
1770
1771
|
writeToDisk: true
|
|
@@ -1885,9 +1886,9 @@ const composeExternalsConfig = (format, externals)=>{
|
|
|
1885
1886
|
throw new Error(`Unsupported format: ${format}`);
|
|
1886
1887
|
}
|
|
1887
1888
|
};
|
|
1888
|
-
const composeAutoExtensionConfig = (config, autoExtension, pkgJson)=>{
|
|
1889
|
+
const composeAutoExtensionConfig = (config, format, autoExtension, pkgJson)=>{
|
|
1889
1890
|
const { jsExtension, dtsExtension } = getDefaultExtension({
|
|
1890
|
-
format
|
|
1891
|
+
format,
|
|
1891
1892
|
pkgJson,
|
|
1892
1893
|
autoExtension
|
|
1893
1894
|
});
|
|
@@ -2112,8 +2113,8 @@ const composeBundlelessExternalConfig = (jsExtension, redirect, cssModulesAuto,
|
|
|
2112
2113
|
}
|
|
2113
2114
|
};
|
|
2114
2115
|
};
|
|
2115
|
-
const composeDtsConfig = async (libConfig, dtsExtension)=>{
|
|
2116
|
-
const {
|
|
2116
|
+
const composeDtsConfig = async (libConfig, format, dtsExtension)=>{
|
|
2117
|
+
const { autoExternal, banner, footer, redirect } = libConfig;
|
|
2117
2118
|
let { dts } = libConfig;
|
|
2118
2119
|
if (false === dts || void 0 === dts) return {};
|
|
2119
2120
|
if (true === dts) dts = {
|
|
@@ -2212,24 +2213,24 @@ async function composeLibRsbuildConfig(config, root, sharedPlugins) {
|
|
|
2212
2213
|
const pkgJson = readPackageJson(rootPath);
|
|
2213
2214
|
const { compilerOptions } = await loadTsconfig(rootPath, config.source?.tsconfigPath);
|
|
2214
2215
|
const cssModulesAuto = config.output?.cssModules?.auto ?? true;
|
|
2215
|
-
const { format, shims, bundle = true, banner = {}, footer = {}, autoExtension = true, autoExternal, externalHelpers = false, redirect = {}, umdName } = config;
|
|
2216
|
+
const { format = 'esm', shims, bundle = true, banner = {}, footer = {}, autoExtension = true, autoExternal, externalHelpers = false, redirect = {}, umdName } = config;
|
|
2216
2217
|
const { rsbuildConfig: shimsConfig, enabledShims } = composeShimsConfig(format, shims);
|
|
2217
2218
|
const formatConfig = composeFormatConfig({
|
|
2218
|
-
format
|
|
2219
|
+
format,
|
|
2219
2220
|
pkgJson: pkgJson,
|
|
2220
2221
|
bundle,
|
|
2221
2222
|
umdName
|
|
2222
2223
|
});
|
|
2223
2224
|
const externalHelpersConfig = composeExternalHelpersConfig(externalHelpers, pkgJson);
|
|
2224
2225
|
const userExternalsConfig = composeExternalsConfig(format, config.output?.externals);
|
|
2225
|
-
const { config: autoExtensionConfig, jsExtension, dtsExtension } = composeAutoExtensionConfig(config, autoExtension, pkgJson);
|
|
2226
|
+
const { config: autoExtensionConfig, jsExtension, dtsExtension } = composeAutoExtensionConfig(config, format, autoExtension, pkgJson);
|
|
2226
2227
|
const { entryConfig, outBase } = await composeEntryConfig(config.source?.entry, config.bundle, rootPath, cssModulesAuto, config.outBase);
|
|
2227
2228
|
const { config: bundlelessExternalConfig } = composeBundlelessExternalConfig(jsExtension, redirect, cssModulesAuto, bundle, outBase);
|
|
2228
2229
|
const { config: targetConfig, externalsConfig: targetExternalsConfig, target } = composeTargetConfig(config.output?.target, format);
|
|
2229
2230
|
const syntaxConfig = composeSyntaxConfig(target, config?.syntax);
|
|
2230
2231
|
const autoExternalConfig = composeAutoExternalConfig({
|
|
2231
2232
|
bundle,
|
|
2232
|
-
format
|
|
2233
|
+
format,
|
|
2233
2234
|
autoExternal,
|
|
2234
2235
|
pkgJson,
|
|
2235
2236
|
userExternals: config.output?.externals
|
|
@@ -2240,7 +2241,7 @@ async function composeLibRsbuildConfig(config, root, sharedPlugins) {
|
|
|
2240
2241
|
enabledImportMetaUrlShim: enabledShims.cjs['import.meta.url'],
|
|
2241
2242
|
contextToWatch: outBase
|
|
2242
2243
|
});
|
|
2243
|
-
const dtsConfig = await composeDtsConfig(config, dtsExtension);
|
|
2244
|
+
const dtsConfig = await composeDtsConfig(config, format, dtsExtension);
|
|
2244
2245
|
const externalsWarnConfig = composeExternalsWarnConfig(format, userExternalsConfig?.output?.externals, autoExternalConfig?.output?.externals);
|
|
2245
2246
|
const minifyConfig = composeMinifyConfig(config);
|
|
2246
2247
|
const bannerFooterConfig = composeBannerFooterConfig(banner, footer);
|
|
@@ -2259,7 +2260,7 @@ async function composeCreateRsbuildConfig(rslibConfig) {
|
|
|
2259
2260
|
userConfig.output ??= {};
|
|
2260
2261
|
delete userConfig.output.externals;
|
|
2261
2262
|
const config = {
|
|
2262
|
-
format: libConfig.format,
|
|
2263
|
+
format: libConfig.format ?? 'esm',
|
|
2263
2264
|
config: (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.mergeRsbuildConfig)(constantRsbuildConfig, libRsbuildConfig, omit(userConfig, {
|
|
2264
2265
|
id: true,
|
|
2265
2266
|
bundle: true,
|
|
@@ -2464,7 +2465,7 @@ const repeatableOption = (value, previous)=>(previous ?? []).concat([
|
|
|
2464
2465
|
value
|
|
2465
2466
|
]);
|
|
2466
2467
|
function runCli() {
|
|
2467
|
-
__WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js_bca3ceaa__.program.name('rslib').usage('<command> [options]').version("0.
|
|
2468
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js_bca3ceaa__.program.name('rslib').usage('<command> [options]').version("0.7.0");
|
|
2468
2469
|
const buildCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js_bca3ceaa__.program.command('build');
|
|
2469
2470
|
const inspectCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js_bca3ceaa__.program.command('inspect');
|
|
2470
2471
|
const mfDevCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js_bca3ceaa__.program.command('mf-dev');
|
|
@@ -2525,7 +2526,7 @@ function runCli() {
|
|
|
2525
2526
|
});
|
|
2526
2527
|
__WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js_bca3ceaa__.program.parse();
|
|
2527
2528
|
}
|
|
2528
|
-
const src_version = "0.
|
|
2529
|
+
const src_version = "0.7.0";
|
|
2529
2530
|
var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger;
|
|
2530
2531
|
var __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.rspack;
|
|
2531
2532
|
export { build, defineConfig, inspect, loadConfig, prepareCli, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__ as rsbuild, runCli, startMFDevServer, composeCreateRsbuildConfig as unstable_composeCreateRsbuildConfig, src_version as version, __webpack_exports__logger as logger, __webpack_exports__rspack as rspack };
|
|
@@ -170,7 +170,7 @@ export interface LibConfig extends EnvironmentConfig {
|
|
|
170
170
|
id?: string;
|
|
171
171
|
/**
|
|
172
172
|
* Output format for the generated JavaScript files.
|
|
173
|
-
* @defaultValue `
|
|
173
|
+
* @defaultValue `'esm'`
|
|
174
174
|
* @see {@link https://lib.rsbuild.dev/config/lib/format}
|
|
175
175
|
*/
|
|
176
176
|
format?: Format;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rslib/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "The Rsbuild-based library development tool.",
|
|
5
5
|
"homepage": "https://lib.rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"types.d.ts"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@rsbuild/core": "1.3.
|
|
39
|
+
"@rsbuild/core": "1.3.19",
|
|
40
40
|
"tinyglobby": "^0.2.13",
|
|
41
|
-
"rsbuild-plugin-dts": "0.
|
|
41
|
+
"rsbuild-plugin-dts": "0.7.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@module-federation/rsbuild-plugin": "^0.13.1",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"memfs": "^4.17.1",
|
|
50
50
|
"picocolors": "1.1.1",
|
|
51
51
|
"prebundle": "1.3.3",
|
|
52
|
-
"rsbuild-plugin-publint": "^0.3.
|
|
53
|
-
"rslib": "npm:@rslib/core@0.6.
|
|
52
|
+
"rsbuild-plugin-publint": "^0.3.2",
|
|
53
|
+
"rslib": "npm:@rslib/core@0.6.9",
|
|
54
54
|
"rslog": "^1.2.3",
|
|
55
55
|
"tsconfck": "3.1.5",
|
|
56
56
|
"typescript": "^5.8.3",
|