Skip to content

Commit

Permalink
wip: 02_jsx migrates from CRA to vite
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed May 16, 2024
1 parent 0edc986 commit b0fb491
Show file tree
Hide file tree
Showing 8 changed files with 396 additions and 30 deletions.
9 changes: 9 additions & 0 deletions examples/02_jsx/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<html>
<head>
<title>example</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
18 changes: 9 additions & 9 deletions examples/02_jsx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
"name": "example",
"version": "0.0.0",
"private": true,
"type": "commonjs",
"type": "module",
"dependencies": {
"@types/react": "latest",
"@types/react-dom": "latest",
"react": "latest",
"react-dom": "latest",
"react-scripts": "latest",
"typescript": "latest",
"use-signals": "latest"
},
"devDependencies": {
"@types/react": "latest",
"@types/react-dom": "latest",
"@vitejs/plugin-react": "latest",
"typescript": "latest",
"vite": "latest"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"dev": "vite"
}
}
8 changes: 0 additions & 8 deletions examples/02_jsx/public/index.html

This file was deleted.

13 changes: 0 additions & 13 deletions examples/02_jsx/src/index.tsx

This file was deleted.

10 changes: 10 additions & 0 deletions examples/02_jsx/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

import App from './app';

createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
);
6 changes: 6 additions & 0 deletions examples/02_jsx/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import react from '@vitejs/plugin-react';

/** @type {import('vite').UserConfig} */
export default {
plugins: [react()],
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
Expand Down
Loading

0 comments on commit b0fb491

Please sign in to comment.