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

Commit

Permalink
Bump to Vite 4 and adding lib name
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumebriday committed Dec 24, 2022
1 parent 4b5773f commit 1907c25
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import path from 'path'
import { resolve } from 'path'
import { defineConfig } from 'vite'

export default ({ mode }) => {
export default defineConfig(({ mode }) => {
if (mode === 'netlify') {
return {
build: {
rollupOptions: {
input: {
index: path.resolve(__dirname, 'index.html'),
card: path.resolve(__dirname, 'card.html')
index: resolve(__dirname, 'index.html'),
card: resolve(__dirname, 'card.html')
}
}
}
Expand All @@ -17,8 +18,9 @@ export default ({ mode }) => {
return {
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'stimulus-popover'
entry: resolve(__dirname, 'src/index.ts'),
name: 'StimulusPopover',
fileName: 'stimulus-popover'
},
rollupOptions: {
external: ['@hotwired/stimulus'],
Expand All @@ -30,4 +32,4 @@ export default ({ mode }) => {
}
}
}
}
})

0 comments on commit 1907c25

Please sign in to comment.