File tree Expand file tree Collapse file tree 4 files changed +36
-8
lines changed Expand file tree Collapse file tree 4 files changed +36
-8
lines changed Original file line number Diff line number Diff line change 13
13
"license" : " MIT" ,
14
14
"scripts" : {
15
15
"dev" : " rsbuild dev" ,
16
- "start" : " rsbuild build -w" ,
16
+ "start" : " NODE_ENV=development rsbuild build -w" ,
17
17
"build" : " rsbuild build" ,
18
18
"build:analysis" : " ENABLE_DEVTOOLS_PLUGIN=true DEVTOOLS_DEV=true rsbuild build" ,
19
19
"preview" : " rsbuild preview"
36
36
"react-error-boundary" : " ^4.1.2" ,
37
37
"react-router-dom" : " 6.4.3" ,
38
38
"sirv" : " 2.0.4" ,
39
+ "source-map-loader" : " ^5.0.0" ,
39
40
"typescript" : " ^5.2.2"
40
41
},
41
42
"publishConfig" : {
Original file line number Diff line number Diff line change
1
+ import type { RsbuildConfig , Rspack } from '@rsbuild/core' ;
1
2
import { defineConfig } from '@rsbuild/core' ;
2
- import { pluginReact } from '@rsbuild/plugin-react' ;
3
- import { pluginTypeCheck } from '@rsbuild/plugin-type-check' ;
4
3
import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill' ;
5
- import type { Rspack , RsbuildConfig } from '@rsbuild/core ' ;
4
+ import { pluginReact } from '@rsbuild/plugin-react ' ;
6
5
import { pluginSass } from '@rsbuild/plugin-sass' ;
7
- import serve from 'sirv' ;
8
- import path from 'path' ;
6
+ import { pluginTypeCheck } from '@rsbuild/plugin-type-check' ;
9
7
import fs from 'fs' ;
8
+ import path from 'path' ;
9
+ import serve from 'sirv' ;
10
10
11
11
import {
12
12
ClientEntry ,
@@ -179,6 +179,17 @@ export default defineConfig(({ env }) => {
179
179
] ) ;
180
180
}
181
181
} ,
182
+ rspack : {
183
+ module : {
184
+ rules : [
185
+ ! IS_PRODUCTION && {
186
+ test : / \. j s $ / ,
187
+ enforce : 'pre' as const ,
188
+ use : [ 'source-map-loader' ] ,
189
+ } ,
190
+ ] . filter ( Boolean ) ,
191
+ } ,
192
+ } ,
182
193
} ,
183
194
184
195
html : {
Original file line number Diff line number Diff line change 1
- import { moduleTools , defineConfig } from '@modern-js/module-tools' ;
1
+ import { defineConfig , moduleTools } from '@modern-js/module-tools' ;
2
2
3
3
export default defineConfig ( {
4
4
plugins : [ moduleTools ( ) ] ,
@@ -7,6 +7,8 @@ export default defineConfig({
7
7
format : 'esm' ,
8
8
target : 'es2020' ,
9
9
outDir : './dist' ,
10
+ sourceMap : true ,
11
+ minify : false ,
10
12
asset : {
11
13
svgr : {
12
14
include : / \. s v g $ / ,
You can’t perform that action at this time.
0 commit comments