bunchee 6.5.2 → 6.5.4

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/bin/cli.js CHANGED
@@ -646,7 +646,7 @@ function lint$1(pkg) {
646
646
  }
647
647
  }
648
648
 
649
- var version = "6.5.2";
649
+ var version = "6.5.4";
650
650
 
651
651
  async function writeDefaultTsconfig(tsConfigPath) {
652
652
  await fs.promises.writeFile(tsConfigPath, JSON.stringify(DEFAULT_TS_CONFIG, null, 2), 'utf-8');
package/dist/index.js CHANGED
@@ -1448,7 +1448,6 @@ async function createDtsPlugin(tsCompilerOptions, tsConfigPath, respectExternal,
1448
1448
  noEmitOnError: true,
1449
1449
  emitDeclarationOnly: true,
1450
1450
  checkJs: false,
1451
- declarationMap: false,
1452
1451
  skipLibCheck: true,
1453
1452
  // preserveSymlinks should always be set to false to avoid issues with
1454
1453
  // resolving types from <reference> from node_modules
@@ -1721,8 +1720,21 @@ async function buildOutputConfigs(bundleConfig, exportCondition, buildContext, d
1721
1720
  const jsDir = path.dirname(absoluteOutputFile);
1722
1721
  const outputFile = dts ? dtsFile : absoluteOutputFile;
1723
1722
  const entryFiles = new Set(Object.values(entries).map((entry)=>entry.source));
1723
+ // By default, respect the original bunchee sourcemap option
1724
+ let sourcemap = !!bundleConfig.sourcemap;
1725
+ // If it's typescript, checking if declaration map is enabled,
1726
+ // otherwise we don't enable sourcemap for type files.
1727
+ // cases:
1728
+ // sourcemap (✓) + declarationMap (✓) => sourcemap for dts
1729
+ // sourcemap (✗) + declarationMap (✓) => sourcemap for dts
1730
+ // sourcemap (✓) + declarationMap (✗) => no sourcemap for dts
1731
+ // sourcemap (✗) + declarationMap (✗) => no sourcemap for dts
1732
+ if (dts) {
1733
+ sourcemap = !!(tsCompilerOptions == null ? void 0 : tsCompilerOptions.declarationMap);
1734
+ }
1724
1735
  const outputOptions = {
1725
1736
  name: pkg.name || name,
1737
+ extend: true,
1726
1738
  dir: dts ? typesDir : jsDir,
1727
1739
  format,
1728
1740
  exports: 'named',
@@ -1730,7 +1742,7 @@ async function buildOutputConfigs(bundleConfig, exportCondition, buildContext, d
1730
1742
  interop: 'auto',
1731
1743
  freeze: false,
1732
1744
  strict: false,
1733
- sourcemap: bundleConfig.sourcemap && !dts,
1745
+ sourcemap,
1734
1746
  manualChunks: createSplitChunks(pluginContext.moduleDirectiveLayerMap, entryFiles),
1735
1747
  chunkFileNames () {
1736
1748
  const isCjsFormat = format === 'cjs';
@@ -1757,8 +1769,13 @@ async function buildEntryConfig(bundleConfig, pluginContext, bundleEntryOptions)
1757
1769
  async function buildRollupConfigs(entry, bundleConfig, exportCondition, buildContext, dts) {
1758
1770
  const inputOptions = await buildInputConfig(entry, bundleConfig, exportCondition, buildContext, dts);
1759
1771
  const outputOptions = await buildOutputConfigs(bundleConfig, exportCondition, buildContext, dts);
1772
+ const { input, external, plugins, treeshake, onwarn } = inputOptions;
1760
1773
  return {
1761
- input: inputOptions,
1774
+ input,
1775
+ external,
1776
+ plugins,
1777
+ treeshake,
1778
+ onwarn,
1762
1779
  output: outputOptions
1763
1780
  };
1764
1781
  }
@@ -1887,15 +1904,15 @@ async function bundleOrWatch(options, rollupConfig) {
1887
1904
  }
1888
1905
  return runBundle(rollupConfig);
1889
1906
  }
1890
- function runBundle({ input, output }) {
1891
- return rollup.rollup(input).then((bundle)=>{
1907
+ function runBundle({ output, ...restOptions }) {
1908
+ return rollup.rollup(restOptions).then((bundle)=>{
1892
1909
  return bundle.write(output);
1893
1910
  }, catchErrorHandler);
1894
1911
  }
1895
- function runWatch({ input, output }) {
1912
+ function runWatch({ output, ...restOptions }) {
1896
1913
  const watchOptions = [
1897
1914
  {
1898
- ...input,
1915
+ ...restOptions,
1899
1916
  output: output,
1900
1917
  watch: {
1901
1918
  exclude: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunchee",
3
- "version": "6.5.2",
3
+ "version": "6.5.4",
4
4
  "description": "zero config bundler for js/ts/jsx libraries",
5
5
  "bin": "./dist/bin/cli.js",
6
6
  "main": "./dist/index.js",
@@ -73,6 +73,7 @@
73
73
  "@huozhi/testing-package": "1.0.0",
74
74
  "@swc-node/register": "^1.10.9",
75
75
  "@swc/types": "^0.1.17",
76
+ "@tailwindcss/postcss": "^4.1.8",
76
77
  "@types/clean-css": "^4.2.11",
77
78
  "@types/node": "^22.9.3",
78
79
  "@types/picomatch": "^3.0.1",
@@ -82,11 +83,13 @@
82
83
  "cross-env": "^7.0.3",
83
84
  "husky": "^9.0.11",
84
85
  "lint-staged": "^15.2.2",
85
- "next": "^15.0.4",
86
+ "next": "^15.3.3",
86
87
  "picocolors": "^1.0.0",
88
+ "postcss": "^8.5.4",
87
89
  "prettier": "3.4.2",
88
90
  "react": "^19.0.0",
89
91
  "react-dom": "^19.0.0",
92
+ "tailwindcss": "^4.1.8",
90
93
  "typescript": "^5.7.2",
91
94
  "vitest": "^3.0.4"
92
95
  },