Skip to content
This repository was archived by the owner on Oct 26, 2024. It is now read-only.

Commit 5c8bcd3

Browse files
Bump to Vite 4 and adding lib name
1 parent c277ba6 commit 5c8bcd3

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

vite.config.js

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
const path = require('path')
1+
import { resolve } from 'path'
2+
import { defineConfig } from 'vite'
23

3-
module.exports = {
4-
build: {
5-
lib: {
6-
entry: path.resolve(__dirname, 'src/index.ts'),
7-
name: 'stimulus-checkbox-select-all'
8-
},
9-
rollupOptions: {
10-
external: ['@hotwired/stimulus'],
11-
output: {
12-
globals: {
13-
'@hotwired/stimulus': 'Stimulus'
4+
export default defineConfig(({ mode }) => {
5+
if (mode === 'netlify') {
6+
return {}
7+
}
8+
9+
return {
10+
build: {
11+
lib: {
12+
entry: resolve(__dirname, 'src/index.ts'),
13+
name: 'StimulusCheckboxSelectAll',
14+
fileName: 'stimulus-checkbox-select-all'
15+
},
16+
rollupOptions: {
17+
external: ['@hotwired/stimulus'],
18+
output: {
19+
globals: {
20+
'@hotwired/stimulus': 'Stimulus'
21+
}
1422
}
1523
}
1624
}
1725
}
18-
}
26+
})

0 commit comments

Comments
 (0)