2022-01-27 16:18:16 +08:00
|
|
|
import { UserConfigExport } from 'vite'
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
import { resolve } from 'path'
|
|
|
|
|
|
|
|
export default (): UserConfigExport => {
|
|
|
|
return {
|
|
|
|
publicDir: false,
|
|
|
|
resolve: {
|
|
|
|
alias: [
|
|
|
|
{
|
|
|
|
find: '@',
|
2022-02-17 12:29:20 +08:00
|
|
|
replacement: resolve(process.cwd(), './')
|
2022-01-27 16:18:16 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
vue(),
|
|
|
|
],
|
|
|
|
build: {
|
|
|
|
cssCodeSplit: false,
|
|
|
|
outDir: 'lib',
|
|
|
|
emptyOutDir: true,
|
|
|
|
lib: {
|
2022-02-17 12:29:20 +08:00
|
|
|
entry: resolve(process.cwd(), './src/index.ts'),
|
2022-01-27 16:18:16 +08:00
|
|
|
name: 'layui-vue',
|
|
|
|
formats: ['es'],
|
|
|
|
fileName: (name) => `index.js`
|
|
|
|
},
|
|
|
|
rollupOptions: {
|
|
|
|
output: {
|
|
|
|
globals: {
|
|
|
|
vue: 'Vue'
|
|
|
|
},
|
|
|
|
assetFileNames: 'index.css',
|
|
|
|
},
|
|
|
|
external: ['vue', 'vue-router']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|