2024-10-28 05:22:50 -05:00
|
|
|
import { sentryVitePlugin } from '@sentry/vite-plugin';
|
2024-05-13 03:12:58 -05:00
|
|
|
import react from '@vitejs/plugin-react-swc';
|
2024-10-28 05:22:50 -05:00
|
|
|
import * as process from 'node:process';
|
2024-04-12 11:52:19 -05:00
|
|
|
import { defineConfig } from 'vite';
|
|
|
|
import { viteSingleFile } from 'vite-plugin-singlefile';
|
|
|
|
import svgr from 'vite-plugin-svgr';
|
|
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
root: './ui-src',
|
2024-10-28 05:22:50 -05:00
|
|
|
plugins: [
|
|
|
|
svgr(),
|
|
|
|
react(),
|
|
|
|
viteSingleFile({ removeViteModuleLoader: true }),
|
|
|
|
tsconfigPaths(),
|
|
|
|
sentryVitePlugin({
|
|
|
|
org: 'runroom-sl',
|
|
|
|
project: 'penpot-exporter'
|
|
|
|
})
|
|
|
|
],
|
2024-05-13 03:12:58 -05:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'react': 'preact/compat',
|
|
|
|
'react-dom': 'preact/compat',
|
|
|
|
'!../css/base.css': '../css/base.css'
|
|
|
|
}
|
|
|
|
},
|
2024-04-12 11:52:19 -05:00
|
|
|
build: {
|
2024-05-13 03:12:58 -05:00
|
|
|
emptyOutDir: false,
|
2024-04-12 11:52:19 -05:00
|
|
|
target: 'esnext',
|
2024-05-13 03:12:58 -05:00
|
|
|
reportCompressedSize: false,
|
2024-05-13 03:29:40 -05:00
|
|
|
outDir: '../dist',
|
2024-10-28 05:22:50 -05:00
|
|
|
|
2024-05-13 03:29:40 -05:00
|
|
|
rollupOptions: {
|
|
|
|
external: ['!../css/base.css']
|
2024-10-28 05:22:50 -05:00
|
|
|
},
|
|
|
|
sourcemap: true
|
|
|
|
},
|
|
|
|
define: {
|
|
|
|
APP_VERSION: JSON.stringify(process.env.npm_package_version)
|
2024-04-12 11:52:19 -05:00
|
|
|
}
|
|
|
|
});
|