From 1907c25e6f8020513eb42582bb44259f28d8650d Mon Sep 17 00:00:00 2001 From: Guillaume Briday Date: Fri, 23 Dec 2022 22:22:33 -0500 Subject: [PATCH] Bump to Vite 4 and adding lib name --- vite.config.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/vite.config.js b/vite.config.js index 39cd778..11c61e1 100644 --- a/vite.config.js +++ b/vite.config.js @@ -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') } } } @@ -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'], @@ -30,4 +32,4 @@ export default ({ mode }) => { } } } -} +})