11// @ts -check
22
3+ import { esbuildPluginFilePathExtensions } from 'esbuild-plugin-file-path-extensions'
4+
35/**
46 * @param {Object } opts - Options for building configurations.
57 * @param {string[] } opts.entry - The entry array.
6- * @param {boolean } [opts.bundle] - Whether to bundle the output.
78 * @returns {import('tsup').Options }
89 */
910export function modernConfig ( opts ) {
@@ -12,18 +13,16 @@ export function modernConfig(opts) {
1213 format : [ 'cjs' , 'esm' ] ,
1314 target : [ 'chrome91' , 'firefox90' , 'edge91' , 'safari15' , 'ios15' , 'opera77' ] ,
1415 outDir : 'build/modern' ,
15- bundle : opts . bundle || false ,
16- splitting : opts . bundle || false ,
1716 dts : true ,
1817 sourcemap : true ,
1918 clean : true ,
19+ esbuildPlugins : [ esbuildPluginFilePathExtensions ( { esmExtension : 'js' } ) ] ,
2020 }
2121}
2222
2323/**
2424 * @param {Object } opts - Options for building configurations.
2525 * @param {string[] } opts.entry - The entry array.
26- * @param {boolean } [opts.bundle] - Whether to bundle the output.
2726 * @returns {import('tsup').Options }
2827 */
2928export function legacyConfig ( opts ) {
@@ -32,10 +31,9 @@ export function legacyConfig(opts) {
3231 format : [ 'cjs' , 'esm' ] ,
3332 target : [ 'es2020' , 'node16' ] ,
3433 outDir : 'build/legacy' ,
35- bundle : opts . bundle || false ,
36- splitting : opts . bundle || false ,
3734 dts : true ,
3835 sourcemap : true ,
3936 clean : true ,
37+ esbuildPlugins : [ esbuildPluginFilePathExtensions ( { esmExtension : 'js' } ) ] ,
4038 }
4139}
0 commit comments