Skip to content

Commit

Permalink
🔨 [#724] Replace CRA with Vite for 'npm start'
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Jan 6, 2025
1 parent 212263a commit 1f2f4f3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 28 deletions.
15 changes: 15 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="nl" class="openforms-theme">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="SDK development entrypoint" />
<title>Open Forms SDK - dev</title>
</head>
<body class="utrecht-document">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"react-dom": "^18.0.0"
},
"scripts": {
"start": "npm run build:design-tokens && node scripts/start.js",
"start": "npm run build:design-tokens && vite",
"build": "node scripts/build.js && npm run build:esm",
"build:esm": "rimraf dist/esm && NODE_ENV=production babel --no-babelrc --config-file ./.babelrc.esm-build --ignore 'src/**/*.spec.js','src/**/fixtures/**','src/setupTests.js','src/reportWebVitals.js' src --out-dir dist/esm",
"build:vite": "BUILD_TARGET=umd vite build && BUILD_TARGET=esm vite build",
Expand Down
27 changes: 0 additions & 27 deletions public/index.html

This file was deleted.

3 changes: 3 additions & 0 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ const umdOutput = {
export default defineConfig({
base: './',
publicDir: false,
server: {
port: 3000,
},
plugins: [
// BIG DISCLAIMER - Vite only processes files with the .jsx or .tsx extension with
// babel, and changing this configuration is... cumbersome and comes with a performance
Expand Down

0 comments on commit 1f2f4f3

Please sign in to comment.