Switch from snowpack to vite for frontend tooling

Closes: #3
This commit is contained in:
Edward Betts 2024-05-03 18:51:22 +00:00
parent 030e0af610
commit b0a53645e6
3 changed files with 42 additions and 45 deletions

29
vite.config.js Normal file
View file

@ -0,0 +1,29 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
define: { 'process.env.NODE_ENV': '"production"' },
build: {
target: 'esnext',
lib: {
entry: path.resolve(__dirname, 'src/main.js'),
name: 'OWL',
fileName: (format) => `owl.${format}.js`
},
},
/* rollupOptions: {
external: ['vue', 'leaflet'],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
vue: 'Vue',
leaflet: 'L',
}
}
}, */
// },
})