Skip to content

Commit d25c501

Browse files
committed
Change tooling to vite build
1 parent 508fd70 commit d25c501

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

ts/examples/simple-example-ts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"type": "module",
88
"main": "index.js",
99
"scripts": {
10-
"build": "tsc -p tsconfig.json",
11-
"dev": "cd ../.. && npm install && npm run build && npm pack && cd examples/simple-example-ts && npm install ../../code0-tech-hercules-0.0.0.tgz && npx tsx index.ts"
10+
"build": "vite build .",
11+
"dev": "cd ../.. && npm install && npm run build && npm pack && cd examples/simple-example-ts && npm install ../../code0-tech-hercules-0.0.0.tgz && npm run build && node dist/index.js"
1212
},
1313
"dependencies": {
1414
"@code0-tech/hercules": "file:../../code0-tech-hercules-0.0.0.tgz"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { defineConfig } from 'vite';
2+
import { resolve } from 'path';
3+
4+
export default defineConfig({
5+
build: {
6+
target: "node18",
7+
ssr: true,
8+
lib: {
9+
entry: resolve(__dirname, 'index.ts'),
10+
name: 'hercules/examples/simple-example-ts',
11+
fileName: 'hercules/examples/simple-example-ts',
12+
formats: ['es', 'cjs']
13+
},
14+
rollupOptions: {
15+
external: (id) =>
16+
['fs', 'path', 'typescript'].includes(id) || id.startsWith('node:')
17+
}
18+
}
19+
});

0 commit comments

Comments
 (0)