File tree Expand file tree Collapse file tree 1 file changed +21
-13
lines changed Expand file tree Collapse file tree 1 file changed +21
-13
lines changed Original file line number Diff line number Diff line change 1
- const path = require ( 'path' )
1
+ import { resolve } from 'path'
2
+ import { defineConfig } from 'vite'
2
3
3
- module . exports = {
4
- build : {
5
- lib : {
6
- entry : path . resolve ( __dirname , 'src/index.ts' ) ,
7
- name : 'stimulus-rails-nested-form'
8
- } ,
9
- rollupOptions : {
10
- external : [ 'stimulus' ] ,
11
- output : {
12
- globals : {
13
- 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 : 'StimulusRailsNestedForm' ,
14
+ fileName : 'stimulus-rails-nested-form'
15
+ } ,
16
+ rollupOptions : {
17
+ external : [ '@hotwired/stimulus' ] ,
18
+ output : {
19
+ globals : {
20
+ '@hotwired/stimulus' : 'Stimulus'
21
+ }
14
22
}
15
23
}
16
24
}
17
25
}
18
- }
26
+ } )
You can’t perform that action at this time.
0 commit comments