Skip to content

Commit

Permalink
Migrerer fra react-scripts til vite
Browse files Browse the repository at this point in the history
  • Loading branch information
terjeofnorway committed Jul 16, 2024
1 parent ec3d736 commit 85bfaf9
Show file tree
Hide file tree
Showing 24 changed files with 18,238 additions and 63,314 deletions.
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@OWNER:registry=https://npm.pkg.github.com
@navikt:registry=https://npm.pkg.github.com
1 change: 1 addition & 0 deletions example/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@navikt:registry=https://npm.pkg.github.com
17 changes: 17 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html lang="no">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" />
<link rel="stylesheet" href="/src/styles.less" />
<title>Arbeidsforhold - www.nav.no</title>
</head>
<body>
<noscript> You need to enable JavaScript to run this app. </noscript>
<div class="pagewrapper">
<main class="app" id="root"></main>
</div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
36,173 changes: 7,305 additions & 28,868 deletions example/package-lock.json

Large diffs are not rendered by default.

39 changes: 21 additions & 18 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,44 @@
"scripts": {
"start": "npm-run-all -p start:*",
"start:less": "less-watch-compiler",
"start:react": "react-scripts start",
"start:build": "vite build --watch",
"start:vite": "vite",
"build": "npm-run-all build:*",
"build:css": "less-watch-compiler --run-once",
"build:react": "react-scripts build",
"eject": "react-scripts eject",
"test": "exit 0"
"build:vite": "vite build"
},
"dependencies": {
"@navikt/aksel-icons": "6.1.1",
"@navikt/aksel-icons": "6.13.0",
"@navikt/arbeidsforhold": "file:..",
"@navikt/ds-css": "6.1.1",
"@navikt/ds-react": "6.1.1",
"@navikt/fnrvalidator": "1.3.0",
"@react-pdf/renderer": "3.1.17",
"@navikt/ds-css": "6.13.0",
"@navikt/ds-react": "6.13.0",
"@navikt/fnrvalidator": "2.1.0",
"@react-pdf/renderer": "3.4.4",
"buffer": "6.0.3",
"core-js": "3.36.0",
"core-js": "3.37.1",
"dayjs": "1.11.10",
"fetch-mock": "9.11.0",
"lodash.throttle": "4.1.1",
"npm-run-all": "4.1.5",
"react": "file:../node_modules/react",
"react-app-polyfill": "3.0.0",
"react-dom": "file:../node_modules/react-dom",
"react-modal": "3.16.1",
"react-router": "6.21.2",
"react-router-dom": "6.21.2",
"react-scripts": "5.0.1",
"typescript": "4.9.5"
"react-router": "6.24.1",
"react-router-dom": "6.24.1",
"typescript": "5.5.3"
},
"devDependencies": {
"@types/react": "18.2.48",
"@types/react-dom": "18.2.18",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"classnames": "2.5.1",
"fetch-mock": "10.0.8",
"less": "4.2.0",
"less-watch-compiler": "1.16.3"
"less-watch-compiler": "1.16.3",
"vite": "5.3.3",
"vite-tsconfig-paths": "4.3.2",
"vitest": "2.0.3",
"vitest-fetch-mock": "0.3.0"
},
"browserslist": {
"production": [
Expand Down
24 changes: 0 additions & 24 deletions example/public/index.html

This file was deleted.

8 changes: 0 additions & 8 deletions example/public/manifest.json

This file was deleted.

1 change: 0 additions & 1 deletion example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve"
},
Expand Down
1 change: 1 addition & 0 deletions example/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'vite/client';
23 changes: 23 additions & 0 deletions example/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';

export default defineConfig(() => {
return {
build: {
outDir: 'build',
assetsInlineLimit: 0,
sourcemap: true,
},
base: '',
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 3006,
},
};
});
Loading

0 comments on commit 85bfaf9

Please sign in to comment.