75 lines
1.6 KiB
TypeScript
75 lines
1.6 KiB
TypeScript
import path from 'path';
|
|
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import vueJsx from '@vitejs/plugin-vue-jsx';
|
|
import jingrowui from 'jingrow-ui/vite';
|
|
import pluginRewriteAll from 'vite-plugin-rewrite-all';
|
|
import Components from 'unplugin-vue-components/vite';
|
|
import Icons from 'unplugin-icons/vite';
|
|
import IconsResolver from 'unplugin-icons/resolver';
|
|
import { sentryVitePlugin } from '@sentry/vite-plugin';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
vueJsx(),
|
|
pluginRewriteAll(),
|
|
jingrowui(),
|
|
Components({
|
|
dirs: [
|
|
'src2/components',
|
|
'node_modules/jingrow-ui/src/components'
|
|
],
|
|
resolvers: [IconsResolver()]
|
|
}),
|
|
Icons(),
|
|
sentryVitePlugin({
|
|
url: process.env.SENTRY_URL,
|
|
org: process.env.SENTRY_ORG,
|
|
project: process.env.SENTRY_PROJECT,
|
|
applicationKey: 'jcloud-dashboard',
|
|
authToken: process.env.SENTRY_AUTH_TOKEN
|
|
})
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src2')
|
|
}
|
|
},
|
|
optimizeDeps: {
|
|
include: ['feather-icons', 'showdown']
|
|
},
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 8080,
|
|
proxy: {
|
|
'/api/action': {
|
|
target: 'http://localhost',
|
|
changeOrigin: true,
|
|
secure: false
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
outDir: '../jcloud/public/dashboard',
|
|
emptyOutDir: true,
|
|
sourcemap: true,
|
|
target: 'es2015',
|
|
rollupOptions: {
|
|
input: {
|
|
main: path.resolve(__dirname, 'index.html')
|
|
}
|
|
}
|
|
},
|
|
// @ts-ignore
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom',
|
|
setupFiles: 'src2/tests/setup/msw.js',
|
|
coverage: {
|
|
extension: ['.vue', '.js'],
|
|
all: true
|
|
}
|
|
}
|
|
});
|