81 lines
2.0 KiB
TypeScript
81 lines
2.0 KiB
TypeScript
|
|
import process from 'node:process';
|
||
|
|
import { fileURLToPath } from 'node:url';
|
||
|
|
import vue from '@vitejs/plugin-vue';
|
||
|
|
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||
|
|
import UnoCSS from 'unocss/vite';
|
||
|
|
import { defineConfig } from 'vite';
|
||
|
|
import dts from 'vite-plugin-dts';
|
||
|
|
// https://vitejs.dev/config/
|
||
|
|
export default defineConfig({
|
||
|
|
define: {
|
||
|
|
'process.env': process.env,
|
||
|
|
},
|
||
|
|
resolve: {
|
||
|
|
alias: {
|
||
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||
|
|
'@lingshu/business-module': fileURLToPath(new URL('../business-module/src', import.meta.url)),
|
||
|
|
},
|
||
|
|
},
|
||
|
|
build: {
|
||
|
|
emptyOutDir: false,
|
||
|
|
cssCodeSplit: false,
|
||
|
|
lib: {
|
||
|
|
entry: fileURLToPath(new URL('src/index.ts', import.meta.url)),
|
||
|
|
formats: ['es'],
|
||
|
|
name: 'fe-lowcode-render',
|
||
|
|
},
|
||
|
|
sourcemap: false,
|
||
|
|
rollupOptions: {
|
||
|
|
external: [
|
||
|
|
'vue',
|
||
|
|
'vue-router',
|
||
|
|
'vue-i18n',
|
||
|
|
'pinia',
|
||
|
|
'@lingshu/core',
|
||
|
|
'@lingshu/enums',
|
||
|
|
'@lingshu/lowcode-create',
|
||
|
|
'@lingshu/business-components',
|
||
|
|
'@lingshu/business-module',
|
||
|
|
'@lingshu/core-utils',
|
||
|
|
'@lingshu/types',
|
||
|
|
'element-plus-cisdi',
|
||
|
|
'vxe-table',
|
||
|
|
'vxe-pc-ui',
|
||
|
|
'@vxe-ui/plugin-render-element',
|
||
|
|
'lodash-es',
|
||
|
|
'dayjs',
|
||
|
|
'axios',
|
||
|
|
'@vueuse/core',
|
||
|
|
'@minmetals/common-lib',
|
||
|
|
// 排除设计器专用依赖
|
||
|
|
'vue-draggable-plus',
|
||
|
|
'@lingshu/form-create',
|
||
|
|
],
|
||
|
|
output: {
|
||
|
|
globals: {
|
||
|
|
'vue': 'Vue',
|
||
|
|
'@lingshu/core': 'FeLowcodeCore',
|
||
|
|
'@lingshu/enums': 'FeLowcodeEnums',
|
||
|
|
'element-plus-cisdi': 'ElementPlusCisdi',
|
||
|
|
},
|
||
|
|
exports: 'named',
|
||
|
|
banner: `
|
||
|
|
/**
|
||
|
|
* Copyright ${new Date(Date.now()).getFullYear()} Cisdi
|
||
|
|
* @license MIT
|
||
|
|
**/
|
||
|
|
`,
|
||
|
|
entryFileNames: '[name].mjs',
|
||
|
|
chunkFileNames: '[name]-[hash].mjs',
|
||
|
|
assetFileNames: '[name].[ext]',
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
plugins: [
|
||
|
|
vue(),
|
||
|
|
vueJsx(),
|
||
|
|
UnoCSS(),
|
||
|
|
dts(),
|
||
|
|
],
|
||
|
|
});
|