@rslib/core 0.0.10 → 0.0.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.
- package/dist/index.js +6 -18
- package/dist-types/plugins/cjsShim.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -134,7 +134,7 @@ function prepareCli() {
|
|
|
134
134
|
// Some package managers automatically output a blank line, some do not.
|
|
135
135
|
const { npm_execpath } = process.env;
|
|
136
136
|
if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
|
|
137
|
-
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.greet(` Rslib v0.0.
|
|
137
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.greet(` Rslib v0.0.11\n`);
|
|
138
138
|
}
|
|
139
139
|
const DEFAULT_CONFIG_NAME = 'rslib.config';
|
|
140
140
|
const DEFAULT_CONFIG_EXTENSIONS = [
|
|
@@ -289,13 +289,12 @@ const composeCssConfig = (rootDir, bundle = true)=>{
|
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
291
|
};
|
|
292
|
-
const importMetaUrlShim =
|
|
292
|
+
const importMetaUrlShim = `/*#__PURE__*/ (function () {
|
|
293
293
|
return typeof document === 'undefined'
|
|
294
294
|
? new (require('url'.replace('', '')).URL)('file:' + __filename).href
|
|
295
295
|
: (document.currentScript && document.currentScript.src) ||
|
|
296
296
|
new URL('main.js', document.baseURI).href;
|
|
297
|
-
})()
|
|
298
|
-
`;
|
|
297
|
+
})()`;
|
|
299
298
|
// This Rsbuild plugin will shim `import.meta.url` for CommonJS modules.
|
|
300
299
|
// - Replace `import.meta.url` with `importMetaUrl`.
|
|
301
300
|
// - Inject `importMetaUrl` to the end of the module (can't inject at the beginning because of `"use strict";`).
|
|
@@ -306,20 +305,9 @@ const pluginCjsShim = ()=>({
|
|
|
306
305
|
api.modifyEnvironmentConfig((config)=>{
|
|
307
306
|
config.source.define = {
|
|
308
307
|
...config.source.define,
|
|
309
|
-
'import.meta.url':
|
|
308
|
+
'import.meta.url': importMetaUrlShim
|
|
310
309
|
};
|
|
311
310
|
});
|
|
312
|
-
api.modifyRspackConfig((config)=>{
|
|
313
|
-
config.plugins ??= [];
|
|
314
|
-
config.plugins.push(new __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.BannerPlugin({
|
|
315
|
-
banner: importMetaUrlShim,
|
|
316
|
-
// Just before minify stage, to perform tree shaking.
|
|
317
|
-
stage: __WEBPACK_EXTERNAL_MODULE__rsbuild_core__.rspack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE - 1,
|
|
318
|
-
raw: true,
|
|
319
|
-
footer: true,
|
|
320
|
-
include: /\.(js|cjs)$/
|
|
321
|
-
}));
|
|
322
|
-
});
|
|
323
311
|
}
|
|
324
312
|
});
|
|
325
313
|
const getDefaultExtension = (options)=>{
|
|
@@ -1996,7 +1984,7 @@ const applyCommonOptions = (command)=>{
|
|
|
1996
1984
|
command.option('-c --config <config>', 'specify the configuration file, can be a relative or absolute path').option('--env-mode <mode>', 'specify the env mode to load the `.env.[mode]` file');
|
|
1997
1985
|
};
|
|
1998
1986
|
function runCli() {
|
|
1999
|
-
__WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.name('rslib').usage('<command> [options]').version("0.0.
|
|
1987
|
+
__WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.name('rslib').usage('<command> [options]').version("0.0.11");
|
|
2000
1988
|
const buildCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.command('build');
|
|
2001
1989
|
const inspectCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.command('inspect');
|
|
2002
1990
|
[
|
|
@@ -2038,6 +2026,6 @@ function runCli() {
|
|
|
2038
2026
|
});
|
|
2039
2027
|
__WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.parse();
|
|
2040
2028
|
}
|
|
2041
|
-
const src_version = "0.0.
|
|
2029
|
+
const src_version = "0.0.11";
|
|
2042
2030
|
var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger;
|
|
2043
2031
|
export { build, defineConfig, loadConfig, prepareCli, runCli, src_version as version, __webpack_exports__logger as logger };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
2
2
|
export declare const pluginCjsShim: () => RsbuildPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rslib/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "The Rspack-based library build tool.",
|
|
5
5
|
"homepage": "https://lib.rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@rsbuild/core": "1.0.12",
|
|
36
|
-
"rsbuild-plugin-dts": "0.0.
|
|
36
|
+
"rsbuild-plugin-dts": "0.0.11"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@rspack/core": "1.0.8",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"memfs": "^4.13.0",
|
|
45
45
|
"picocolors": "1.1.0",
|
|
46
46
|
"prebundle": "1.2.2",
|
|
47
|
-
"rslib": "npm:@rslib/core@0.0.
|
|
47
|
+
"rslib": "npm:@rslib/core@0.0.10",
|
|
48
48
|
"rslog": "^1.2.3",
|
|
49
49
|
"tsconfck": "3.1.4",
|
|
50
50
|
"typescript": "^5.6.3",
|