-
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
421ea96
commit e274880
Showing
4 changed files
with
1,089 additions
and
265 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 | ||
}) | ||
); | ||
} | ||
}, | ||
}, | ||
}); |
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
Oops, something went wrong.