Skip to content

Commit

Permalink
Merge pull request #73 from InseeFr/feat/migrate-to-vite
Browse files Browse the repository at this point in the history
feat: migrate to vite
  • Loading branch information
PierreVasseur authored Jul 25, 2024
2 parents 5ce67a9 + 8bd6bc3 commit 0cf7695
Show file tree
Hide file tree
Showing 6 changed files with 946 additions and 10,306 deletions.
14 changes: 8 additions & 6 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
<html lang="fr">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link
href="https://unpkg.com/@triply/yasgui/build/yasgui.min.css"
rel="stylesheet"
type="text/css"
/>
<script src="%PUBLIC_URL%/yasgui.min.js"></script>
<script src="/yasgui.min.js"></script>

<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="apple-touch-icon" href="/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="manifest" href="/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand All @@ -33,7 +33,7 @@

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<h1><img src="%PUBLIC_URL%/insee.png" alt="INSEE" /></h1>
<h1><img src="/insee.png" alt="INSEE" /></h1>

<div id="root"></div>
<!--
Expand All @@ -45,5 +45,7 @@ <h1><img src="%PUBLIC_URL%/insee.png" alt="INSEE" /></h1>
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
--></body>
-->
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "5.0.1",
"web-vitals": "4.2.2"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "16.0.0",
"@testing-library/user-event": "14.5.2",
"@vitejs/plugin-react-swc": "^3.7.0",
"bestzip": "^2.2.1",
"ncp": "^2.0.0",
"prettier": "^3.3.3"
"prettier": "^3.3.3",
"vite": "^5.3.4"
},
"scripts": {
"copy-static": "ncp pages build && ncp temp_dist build/sparql",
"build-react": "PUBLIC_URL='/sparql' BUILD_PATH='./temp_dist' react-scripts build",
"start": "react-scripts start",
"build-react": "vite build --base=/sparql",
"start": "vite",
"build": "yarn build-react && yarn copy-static && npm run create-zip",
"test": "react-scripts test",
"eject": "react-scripts eject",
Expand Down
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'

// https://vitejs.dev/config/
export default defineConfig({
base: '/',
plugins: [react()],
build: {
outDir: 'temp_dist'
}
})
Loading

0 comments on commit 0cf7695

Please sign in to comment.