Skip to content

Commit

Permalink
chore: add rsbuild to explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed Feb 9, 2024
1 parent 421ea96 commit e274880
Show file tree
Hide file tree
Showing 4 changed files with 1,089 additions and 265 deletions.
6 changes: 6 additions & 0 deletions packages/grant-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
"@heroicons/react": "^2.0.13",
"@playwright/test": "^1.41.1",
"@rainbow-me/rainbowkit": "1.0.10",
"@rsbuild/core": "^0.4.1",
"@rsbuild/plugin-react": "^0.3.11",
"@rsbuild/plugin-svgr": "^0.3.11",
"@rsdoctor/rspack-plugin": "^0.1.1",
"@sentry/integrations": "^7.28.0",
"@sentry/react": "^7.27.0",
"@sentry/tracing": "^7.26.0",
Expand Down Expand Up @@ -79,6 +83,8 @@
"ipfs-core": "^0.14.3",
"ipfs-core-types": "^0.14.0",
"jest": "^27.0",
"jszip": "^3.10.1",
"localforage": "^1.10.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"moment": "^2.29.3",
Expand Down
41 changes: 41 additions & 0 deletions packages/grant-explorer/rsbuild.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineConfig, loadEnv } from "@rsbuild/core";
import { pluginReact } from "@rsbuild/plugin-react";
import { pluginSvgr } from "@rsbuild/plugin-svgr";
import { RsdoctorRspackPlugin } from "@rsdoctor/rspack-plugin";
const path = require("path");

const { publicVars } = loadEnv({ prefixes: ["REACT_APP_"] });

export default defineConfig({
plugins: [pluginReact(), pluginSvgr()],
html: {
template: "./public/index.html",
},
server: {
port: Number(process.env.PORT) || 3000,
},
source: {
define: publicVars,
alias: {
localforage: path.resolve(
__dirname,
"./node_modules/localforage/src/localforage.js"
),
jszip: path.resolve(__dirname, "./node_modules/jszip/lib/index.js"),
"readable-stream": require.resolve("readable-stream"),
"csv-stringify": "csv-stringify/browser/esm",
},
},
tools: {
rspack(config, { appendPlugins }) {
// Only register the plugin when RSDOCTOR is true, as the plugin will increase the build time.
if (process.env.RSDOCTOR) {
appendPlugins(
new RsdoctorRspackPlugin({
// plugin options
})
);
}
},
},
});
2 changes: 1 addition & 1 deletion packages/round-manager/rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig, loadEnv } from "@rsbuild/core";
import { pluginReact } from "@rsbuild/plugin-react";
import { pluginSvgr } from "@rsbuild/plugin-svgr";
import { RsdoctorRspackPlugin } from "@rsdoctor/rspack-plugin";
import path = require("path");
const path = require("path");

const { publicVars } = loadEnv({ prefixes: ["REACT_APP_"] });

Expand Down
Loading

0 comments on commit e274880

Please sign in to comment.