// Configuration guide: https://rstack.rs/config import { define } from 'rstack'; define.lib({ lib: [ { syntax: 'es2021', dts: true }, { format: 'cjs', syntax: 'es2021', source: { entry: { index: './src/index.ts', loader: './src/loader.ts', }, }, }, ], }); define.test({ env: { // Let Rsbuild choose the mode based on the command. NODE_ENV: undefined, }, isolate: false, }); define.fmt({ singleQuote: true, }); define.staged({ '*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}': ['rs lint --fix', 'rs fmt'], '*.{json,json5,jsonc,md,mdx,css,scss,less,html,yml,yaml}': 'rs fmt', }); define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommended]);