Skip to content

Commit 5cd23d3

Browse files
committed
build: Update web output filenames
1 parent 6892602 commit 5cd23d3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

js/vite.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// vite.config.js
21
import { resolve } from 'path';
32
import { defineConfig } from 'vite';
43
import dts from 'vite-plugin-dts';
@@ -10,7 +9,12 @@ export default defineConfig({
109
entry: resolve(__dirname, 'src/index.ts'),
1110
name: 'buttplug',
1211
// the proper extensions will be added
13-
fileName: 'buttplug',
12+
fileName: (format): string => {
13+
if (format === 'umd') {
14+
return 'buttplug.js';
15+
}
16+
return 'buttplug.mjs';
17+
},
1418
},
1519
outDir: 'dist/web',
1620
},

0 commit comments

Comments
 (0)