62 lines
1.6 KiB
JavaScript
62 lines
1.6 KiB
JavaScript
|
|
import path from 'node:path';
|
||
|
|
import { fileURLToPath } from 'node:url';
|
||
|
|
import { defineConfig } from 'vite';
|
||
|
|
import vue from '@vitejs/plugin-vue';
|
||
|
|
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||
|
|
|
||
|
|
const __filename = fileURLToPath(import.meta.url);
|
||
|
|
const rootDir = path.dirname(__filename);
|
||
|
|
|
||
|
|
export default defineConfig({
|
||
|
|
define: {
|
||
|
|
__PRINT_TEMPLATE_VERSION__: JSON.stringify("0.0.0"),
|
||
|
|
},
|
||
|
|
plugins: [
|
||
|
|
vue({
|
||
|
|
script: {
|
||
|
|
babelParserPlugins: ['jsx'],
|
||
|
|
},
|
||
|
|
}),
|
||
|
|
vueJsx(),
|
||
|
|
],
|
||
|
|
resolve: {
|
||
|
|
alias: [
|
||
|
|
{ find: '@', replacement: path.resolve(rootDir, 'packages/designer/src') },
|
||
|
|
{
|
||
|
|
find: '@h3/theme-pc/core/index.scss',
|
||
|
|
replacement: path.resolve(rootDir, './styles/h3-theme-stub.scss'),
|
||
|
|
},
|
||
|
|
{
|
||
|
|
find: '@busi-comp',
|
||
|
|
replacement: path.resolve(rootDir, '../../packages/business-components/src')
|
||
|
|
},
|
||
|
|
{
|
||
|
|
find: '~@',
|
||
|
|
replacement: path.resolve(rootDir, '../../packages/form-designer/src')
|
||
|
|
}
|
||
|
|
],
|
||
|
|
},
|
||
|
|
css: {
|
||
|
|
preprocessorOptions: {
|
||
|
|
scss: {
|
||
|
|
additionalData: `@import "${path.resolve(rootDir, './styles/h3-theme-stub.scss').replace(/\\/g, '/')}";\n`,
|
||
|
|
// 忽略 Sass 弃用警告(@import 等)
|
||
|
|
silenceDeprecations: ['import', 'color-functions', 'global-builtin'],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
root: path.resolve(rootDir, 'demo'),
|
||
|
|
server: {
|
||
|
|
proxy: {
|
||
|
|
'/biz-gateway': {
|
||
|
|
target: 'https://dsep-dev.minmetals.com.cn',
|
||
|
|
changeOrigin: true,
|
||
|
|
},
|
||
|
|
'/cap/file-center': {
|
||
|
|
target: 'https://dsep-dev.minmetals.com.cn',
|
||
|
|
changeOrigin: true,
|
||
|
|
},
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|