53 lines
1.3 KiB
JavaScript
53 lines
1.3 KiB
JavaScript
|
import path from 'path'
|
||
|
import { defineConfig } from 'vite'
|
||
|
import vue from '@vitejs/plugin-vue'
|
||
|
|
||
|
// https://vitejs.dev/config/
|
||
|
export default defineConfig({
|
||
|
plugins: [vue()],
|
||
|
resolve: {
|
||
|
alias: {
|
||
|
'@/': `${path.resolve(__dirname, 'src/vue')}/`,
|
||
|
'@src/': `${path.resolve(__dirname, 'src')}/`,
|
||
|
}
|
||
|
},
|
||
|
css: {
|
||
|
preprocessorOptions: {
|
||
|
less: {
|
||
|
additionalData: '@import "src/styles/compendium-browser.less";'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
build: {
|
||
|
sourcemap: true,
|
||
|
outDir: './src/components',
|
||
|
lib: {
|
||
|
entry: path.resolve(__dirname, 'src/vue/index.js'),
|
||
|
name: 'v3ArchmageVueComponents',
|
||
|
formats: ['es'], // also supports 'umd'
|
||
|
fileName: (format) => `components.vue.${format}.js`,
|
||
|
},
|
||
|
rollupOptions: {
|
||
|
external: [
|
||
|
'vue',
|
||
|
],
|
||
|
output: {
|
||
|
// Provide global variables to use in the UMD build
|
||
|
// Add external deps here
|
||
|
globals: {
|
||
|
vue: 'Vue',
|
||
|
},
|
||
|
// Map the external dependency to a local copy of Vue 3 esm.
|
||
|
paths: {
|
||
|
vue: `../lib/vue.esm-browser.js`
|
||
|
},
|
||
|
assetFileNames: (assetInfo) => {
|
||
|
if (assetInfo.name == 'style.css')
|
||
|
return `styles.vue.css`;
|
||
|
return assetInfo.name;
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
});
|