37 lines
992 B
JavaScript
37 lines
992 B
JavaScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import path from 'node:path'
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
define: {
|
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
emptyOutDir: false,
|
|
cssCodeSplit: true,
|
|
lib: {
|
|
entry: path.resolve(process.cwd(), 'resources/js/card.js'),
|
|
name: 'NovaFormCard',
|
|
formats: ['iife'],
|
|
fileName: () => 'js/card.js',
|
|
},
|
|
rollupOptions: {
|
|
external: ['vue'],
|
|
output: {
|
|
globals: {
|
|
vue: 'Vue',
|
|
},
|
|
assetFileNames: assetInfo => {
|
|
if (assetInfo.name && assetInfo.name.endsWith('.css')) {
|
|
return 'css/card.css'
|
|
}
|
|
|
|
return 'assets/[name][extname]'
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|