Skip to content

Instantly share code, notes, and snippets.

@trinhvanminh
Created February 21, 2025 03:03
Show Gist options
  • Save trinhvanminh/3e2863d13e634df0408a965a54228235 to your computer and use it in GitHub Desktop.
Save trinhvanminh/3e2863d13e634df0408a965a54228235 to your computer and use it in GitHub Desktop.
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