2021-09-27 06:09:33 +08:00
|
|
|
import path from 'path'
|
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
import plugins from './src/plugin/common-plugins'
|
2022-03-31 03:37:01 +08:00
|
|
|
import pkg from '../package.json'
|
2021-09-27 06:09:33 +08:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
2022-01-27 16:18:16 +08:00
|
|
|
'/@src': path.resolve(__dirname, './src'),
|
2021-09-27 06:09:33 +08:00
|
|
|
},
|
|
|
|
},
|
2022-03-31 03:37:01 +08:00
|
|
|
define: {
|
|
|
|
'import.meta.env.LAYUI_VUE_VERSION': JSON.stringify(pkg.version),
|
|
|
|
},
|
2022-04-02 06:34:14 +08:00
|
|
|
build: {
|
|
|
|
rollupOptions: {
|
|
|
|
output: {
|
|
|
|
manualChunks(id) {
|
|
|
|
if (id.includes("node_modules")) {
|
|
|
|
return id.toString().split("node_modules/")[1].split("/")[0].toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-09-27 06:09:33 +08:00
|
|
|
plugins,
|
2022-01-27 16:18:16 +08:00
|
|
|
})
|