-
-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated from CRA to vite and updated typescript to latest (#2268)
* Partially migrated to vite * Fixed vite cache errors * Fixed test after migration * Fixed process.env * Fixed failing tests due to babel * updated package.json * Fixed all errors * Updated typescript to latest * Moved config files
- Loading branch information
1 parent
e143243
commit 01ef5c6
Showing
13 changed files
with
7,834 additions
and
20,455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
presets: [ | ||
'@babel/preset-env', // Transforms modern JavaScript | ||
'@babel/preset-typescript', // Transforms TypeScript | ||
'@babel/preset-react', // Transforms JSX | ||
], | ||
plugins: ['babel-plugin-transform-import-meta'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { defineConfig } from 'vite'; | ||
import react from '@vitejs/plugin-react'; | ||
import viteTsconfigPaths from 'vite-tsconfig-paths'; | ||
import svgrPlugin from 'vite-plugin-svgr'; | ||
import EnvironmentPlugin from 'vite-plugin-environment'; | ||
|
||
export default defineConfig({ | ||
// depending on your application, base can also be "/" | ||
build: { | ||
outDir: 'build', | ||
}, | ||
base: '', | ||
plugins: [ | ||
react(), | ||
viteTsconfigPaths(), | ||
EnvironmentPlugin('all'), | ||
svgrPlugin({ | ||
svgrOptions: { | ||
icon: true, | ||
// ...svgr options (https://react-svgr.com/docs/options/) | ||
}, | ||
}), | ||
], | ||
server: { | ||
// this ensures that the browser opens upon server start | ||
open: true, | ||
// this sets a default port to 3000 | ||
port: 4321, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.