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 26, 2022
1 parent f274409 commit c23d9e4
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
const path = require('path')
import { resolve } from 'path'
import { defineConfig } from 'vite'

module.exports = {
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: 'stimulus-reveal-controller'
},
rollupOptions: {
external: ['@hotwired/stimulus'],
output: {
globals: {
'@hotwired/stimulus': 'Stimulus'
export default defineConfig(({ mode }) => {
if (mode === 'netlify') {
return {}
}

return {
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'StimulusRevealController',
fileName: 'stimulus-reveal-controller'
},
rollupOptions: {
external: ['@hotwired/stimulus'],
output: {
globals: {
'@hotwired/stimulus': 'Stimulus'
}
}
}
}
}
}
})

0 comments on commit c23d9e4

Please sign in to comment.