Created
February 21, 2025 03:03
-
-
Save trinhvanminh/3e2863d13e634df0408a965a54228235 to your computer and use it in GitHub Desktop.
rsbuild config with plugin (https://github.com/orgs/rspack-contrib/repositories?language=&q=rsbuild-plugin-&sort=&type=all)
This file contains hidden or 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
import { defineConfig, loadEnv } from '@rsbuild/core'; | |
// import { pluginEslint } from '@rsbuild/plugin-eslint'; | |
import { pluginReact } from '@rsbuild/plugin-react'; | |
import { pluginSass } from '@rsbuild/plugin-sass'; | |
import { pluginSvgr } from '@rsbuild/plugin-svgr'; | |
import { pluginTypeCheck } from '@rsbuild/plugin-type-check'; | |
const { publicVars, rawPublicVars } = loadEnv({ prefixes: ['REACT_APP_'] }); | |
export default defineConfig({ | |
plugins: [ | |
pluginReact(), | |
pluginSvgr({ mixedImport: true }), | |
pluginSass(), | |
pluginTypeCheck(), | |
// , pluginEslint() | |
], | |
html: { | |
template: './public/index.html', | |
}, | |
source: { | |
define: { | |
...publicVars, | |
'process.env': JSON.stringify(rawPublicVars), | |
}, | |
}, | |
// server: { | |
// port: 8080, | |
// }, | |
output: { | |
distPath: { | |
root: 'build', | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment