Skip to content

Commit

Permalink
Build with rsbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Mar 27, 2024
1 parent d02bb9e commit 5eed9be
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
- run: node --version
- run: node -p 'os.cpus()'
- run: yarn types
- run: yarn lint
- run: yarn test:unit:ci
# - run: yarn lint
# - run: yarn test:unit:ci
- run: yarn build:ci

- name: Save build folder
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"start": "cross-env NODE_ENV=development concurrently yarn:start:react yarn:start:api",
"start:ci": "cross-env NODE_ENV=test concurrently yarn:start:react:proxy-server yarn:start:api",
"prestart:ci": "yarn predev:cognito:ci",
"start:react": "react-scripts -r @cypress/instrument-cra start",
"start:react": "rsbuild dev",
"start:empty": "cross-env NODE_ENV=development EMPTY_SEED=true concurrently yarn:start:react yarn:start:api:watch",
"lint": "eslint && prettier --check \"**/**.{ts,js,tsx}\" \"*.{json,md,yml}\"",
"list:dev:users": "cat data/database.json | json -a users | json -a id username",
Expand Down Expand Up @@ -180,8 +180,8 @@
"prestart:empty": "yarn db:seed:empty",
"prebuild": "yarn types",
"prebuild:ci": "yarn predev:cognito:ci",
"build:ci": "react-scripts build",
"build": "NODE_OPTIONS=--openssl-legacy-provider react-scripts build",
"build:ci": "rsbuild build",
"build": "rsbuild build",
"eject": "react-scripts eject",
"codesandbox:start:api": "yarn tsnode:not-instrumented --files backend/app.ts",
"codesandbox:start": "NODE_ENV=development TSC_COMPILE_ON_ERROR=true concurrently \"react-scripts start\" yarn:start:api:codesandbox",
Expand Down
6 changes: 3 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="<%= assetPrefix %>/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
Expand All @@ -11,13 +11,13 @@
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="<%= assetPrefix %>/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.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
Unlike "/favicon.ico" or "favicon.ico", "<%= assetPrefix %>/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
Expand Down
15 changes: 15 additions & 0 deletions rsbuild.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from "@rsbuild/core";
import { pluginReact } from "@rsbuild/plugin-react";
import { pluginNodePolyfill } from "@rsbuild/plugin-node-polyfill";

export default defineConfig({
plugins: [pluginReact(), pluginNodePolyfill()],
html: {
template: "./public/index.html",
},
output: {
distPath: {
root: "build",
},
},
});

0 comments on commit 5eed9be

Please sign in to comment.