You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1023 B
JavaScript
38 lines
1023 B
JavaScript
|
1 day ago
|
import {defineConfig} from 'vite'
|
||
|
|
import vue from '@vitejs/plugin-vue'
|
||
|
|
import path from 'path'
|
||
|
|
|
||
|
|
export default defineConfig({
|
||
|
|
plugins: [vue()],
|
||
|
|
resolve: {
|
||
|
|
alias: {
|
||
|
|
// @ 指向 src 目录
|
||
|
|
'@': path.resolve(__dirname, 'src')
|
||
|
|
}
|
||
|
|
},
|
||
|
|
build: {
|
||
|
|
lib: {
|
||
|
|
entry: path.resolve(__dirname, 'src/index.js'),
|
||
|
|
name: 'ScrinVisualEditor',
|
||
|
|
fileName: (format) => {
|
||
|
|
if (format === 'es') return 'scrin-visual-editor.es.js'
|
||
|
|
if (format === 'umd') return 'scrin-visual-editor.umd.js'
|
||
|
|
return `scrin-visual-editor.${format}.js`
|
||
|
|
},
|
||
|
|
cssFileName: 'style'
|
||
|
|
},
|
||
|
|
preserveModules: false,
|
||
|
|
assetsInlineLimit: 0,
|
||
|
|
output: {
|
||
|
|
preserveModulesRoot: 'src',
|
||
|
|
},
|
||
|
|
rollupOptions: {
|
||
|
|
external: ['vue'],
|
||
|
|
output: {
|
||
|
|
globals: {
|
||
|
|
vue: 'Vue'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
})
|