Skip to content

Commit

Permalink
Exclude test files from final bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
aliofye committed Jan 12, 2025
1 parent 32f25ed commit 27dc445
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/web/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Read: https://vite.dev/config/
* @see: https://vite.dev/config/
**/

import mdx from '@mdx-js/rollup';
Expand All @@ -14,14 +14,23 @@ export default defineConfig(({ mode }) => {
plugins: [
{
enforce: 'pre',
// configures .mdx file support
...mdx(),
},
// configures react support
react(),
// configures typescript path aliases
tsconfigPaths(),
],
define: {
PUBLIC_WEB_API_URL: JSON.stringify(env.PUBLIC_WEB_API_URL),
},
build: {
rollupOptions: {
// excludes test files from the bundle
external: (id) => /.*\.(test|spec)\..*/.test(id),
},
},
server: {
port: 5173,
host: true,
Expand Down

0 comments on commit 27dc445

Please sign in to comment.