@rslib/core 0.0.8 → 0.0.9

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.
Files changed (2) hide show
  1. package/dist/index.js +30 -33
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -133,7 +133,7 @@ function prepareCli() {
133
133
  // Some package managers automatically output a blank line, some do not.
134
134
  const { npm_execpath } = process.env;
135
135
  if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
136
- __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.greet(` Rslib v0.0.8\n`);
136
+ __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger.greet(` Rslib v0.0.9\n`);
137
137
  }
138
138
  const DEFAULT_CONFIG_NAME = 'rslib.config';
139
139
  const DEFAULT_CONFIG_EXTENSIONS = [
@@ -1403,27 +1403,36 @@ async function createConstantRsbuildConfig() {
1403
1403
  });
1404
1404
  }
1405
1405
  const composeFormatConfig = (format)=>{
1406
+ const jsParserOptions = {
1407
+ importMeta: false,
1408
+ requireResolve: false,
1409
+ requireDynamic: false,
1410
+ requireAsExpression: false,
1411
+ importDynamic: false
1412
+ };
1406
1413
  switch(format){
1407
1414
  case 'esm':
1408
1415
  return {
1409
1416
  tools: {
1410
1417
  rspack: {
1411
- output: {
1412
- module: true,
1413
- chunkFormat: 'module',
1414
- library: {
1415
- type: 'modern-module'
1416
- }
1417
- },
1418
1418
  module: {
1419
1419
  parser: {
1420
- javascript: {
1421
- importMeta: false
1422
- }
1420
+ javascript: jsParserOptions
1423
1421
  }
1424
1422
  },
1425
1423
  optimization: {
1426
- concatenateModules: true
1424
+ concatenateModules: true,
1425
+ sideEffects: 'flag'
1426
+ },
1427
+ output: {
1428
+ module: true,
1429
+ chunkFormat: 'module',
1430
+ library: {
1431
+ type: 'modern-module'
1432
+ },
1433
+ chunkLoading: 'import',
1434
+ workerChunkLoading: 'import',
1435
+ wasmLoading: 'fetch'
1427
1436
  },
1428
1437
  experiments: {
1429
1438
  outputModule: true
@@ -1440,9 +1449,7 @@ const composeFormatConfig = (format)=>{
1440
1449
  rspack: {
1441
1450
  module: {
1442
1451
  parser: {
1443
- javascript: {
1444
- importMeta: false
1445
- }
1452
+ javascript: jsParserOptions
1446
1453
  }
1447
1454
  },
1448
1455
  output: {
@@ -1450,7 +1457,10 @@ const composeFormatConfig = (format)=>{
1450
1457
  chunkFormat: 'commonjs',
1451
1458
  library: {
1452
1459
  type: 'commonjs'
1453
- }
1460
+ },
1461
+ chunkLoading: 'require',
1462
+ workerChunkLoading: 'async-node',
1463
+ wasmLoading: 'async-node'
1454
1464
  }
1455
1465
  }
1456
1466
  }
@@ -1652,12 +1662,7 @@ const composeTargetConfig = (target = 'web')=>{
1652
1662
  rspack: {
1653
1663
  target: [
1654
1664
  'web'
1655
- ],
1656
- output: {
1657
- chunkLoading: 'import',
1658
- workerChunkLoading: 'import',
1659
- wasmLoading: 'fetch'
1660
- }
1665
+ ]
1661
1666
  }
1662
1667
  }
1663
1668
  };
@@ -1667,15 +1672,7 @@ const composeTargetConfig = (target = 'web')=>{
1667
1672
  rspack: {
1668
1673
  target: [
1669
1674
  'node'
1670
- ],
1671
- // "__dirname" and "__filename" shims will automatically be enabled when `output.module` is `true`,
1672
- // and leave them as-is in the rest of the cases.
1673
- // { node: { __dirname: ..., __filename: ... } }
1674
- output: {
1675
- chunkLoading: 'require',
1676
- workerChunkLoading: 'async-node',
1677
- wasmLoading: 'async-node'
1678
- }
1675
+ ]
1679
1676
  }
1680
1677
  },
1681
1678
  output: {
@@ -1830,7 +1827,7 @@ const applyCommonOptions = (command)=>{
1830
1827
  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');
1831
1828
  };
1832
1829
  function runCli() {
1833
- __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.name('rslib').usage('<command> [options]').version("0.0.8");
1830
+ __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.name('rslib').usage('<command> [options]').version("0.0.9");
1834
1831
  const buildCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.command('build');
1835
1832
  const inspectCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.command('inspect');
1836
1833
  [
@@ -1872,6 +1869,6 @@ function runCli() {
1872
1869
  });
1873
1870
  __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js__.program.parse();
1874
1871
  }
1875
- const src_version = "0.0.8";
1872
+ const src_version = "0.0.9";
1876
1873
  var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js__.logger;
1877
1874
  export { build, defineConfig, loadConfig, prepareCli, runCli, src_version as version, __webpack_exports__logger as logger };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslib/core",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "The Rspack-based library build tool.",
5
5
  "homepage": "https://lib.rsbuild.dev",
6
6
  "bugs": {
@@ -32,18 +32,18 @@
32
32
  "compiled"
33
33
  ],
34
34
  "dependencies": {
35
- "@rsbuild/core": "1.0.7",
36
- "rsbuild-plugin-dts": "0.0.8"
35
+ "@rsbuild/core": "1.0.10",
36
+ "rsbuild-plugin-dts": "0.0.9"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/fs-extra": "^11.0.4",
40
40
  "commander": "^12.1.0",
41
41
  "fast-glob": "^3.3.2",
42
42
  "fs-extra": "^11.2.0",
43
- "memfs": "^4.12.0",
43
+ "memfs": "^4.13.0",
44
44
  "picocolors": "1.1.0",
45
45
  "prebundle": "1.2.2",
46
- "rslib": "npm:@rslib/core@0.0.7",
46
+ "rslib": "npm:@rslib/core@0.0.8",
47
47
  "rslog": "^1.2.3",
48
48
  "tsconfck": "3.1.3",
49
49
  "typescript": "^5.6.2",