-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6990f0b
commit 421ea96
Showing
3 changed files
with
615 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}) | ||
); | ||
} | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.