Skip to content

Commit 618f9cb

Browse files
committed
chore: seperate builds
1 parent ce469fb commit 618f9cb

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed

src/SDK/Language/Node.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ public function getFiles(): array
229229
],
230230
[
231231
'scope' => 'default',
232-
'destination' => 'tsup.config.js',
233-
'template' => 'node/tsup.config.js.twig',
232+
'destination' => 'tsup.config.ts',
233+
'template' => 'node/tsup.config.ts.twig',
234234
],
235235
[
236236
'scope' => 'default',

templates/node/tsup.config.js.twig

Lines changed: 0 additions & 16 deletions
This file was deleted.

templates/node/tsup.config.ts.twig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { defineConfig, type Options } from "tsup";
2+
import { esbuildPluginFilePathExtensions } from "esbuild-plugin-file-path-extensions";
3+
4+
const commonConfig: Options = {
5+
sourcemap: true,
6+
clean: true,
7+
dts: true,
8+
treeshake: true,
9+
target: "node16",
10+
entry: ["src/**/*.ts"],
11+
outDir: "dist",
12+
};
13+
14+
export default defineConfig([
15+
{
16+
...commonConfig,
17+
format: "esm",
18+
esbuildPlugins: [esbuildPluginFilePathExtensions({ filter: /^\./ })],
19+
bundle: true,
20+
// Yes, bundle: true => https://github.com/favware/esbuild-plugin-file-path-extensions?tab=readme-ov-file#usage
21+
},
22+
{
23+
...commonConfig,
24+
format: "cjs",
25+
bundle: false,
26+
},
27+
]);

0 commit comments

Comments
 (0)