Skip to content

Commit

Permalink
vite-tsconfig-paths
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Dec 25, 2024
1 parent 0355a96 commit c6a6804
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"typescript-eslint": "^8.18.1",
"valtio": "^2.1.2",
"vite": "^6.0.4",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^2.1.8"
},
"peerDependencies": {
Expand Down
41 changes: 41 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

import { resolve } from 'node:path';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';

const { DIR, PORT = '8080' } = process.env;

export default defineConfig(({ mode }) => {
if (mode === 'test') {
return {
resolve: { alias: { 'jotai-valtio': resolve('src') } },
test: {
environment: 'happy-dom',
setupFiles: ['./tests/vitest-setup.ts'],
},
plugins: [tsconfigPaths()],
};
}
if (!DIR) {
Expand All @@ -21,6 +22,6 @@ export default defineConfig(({ mode }) => {
return {
root: resolve('examples', DIR),
server: { port: Number(PORT) },
resolve: { alias: { 'jotai-valtio': resolve('src') } },
plugins: [tsconfigPaths()],
};
});

0 comments on commit c6a6804

Please sign in to comment.