File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change 1
1
import type { RsbuildPlugin } from '@rsbuild/core' ;
2
2
3
- import { resolvePackage } from '@rsbuild/shared' ;
3
+ import { resolvePackage , setConfig } from '@rsbuild/shared' ;
4
4
import { startServer } from './server/server' ;
5
5
6
6
export const pluginReactInspector = ( options ?: {
@@ -20,21 +20,18 @@ export const pluginReactInspector = (options?: {
20
20
21
21
api . modifyRsbuildConfig ( ( config ) => {
22
22
const tags : any = config ?. html ?. tags || [ ] ;
23
- config . html = {
24
- tags : [
25
- ...tags ,
26
- {
27
- tag : 'script' ,
28
- head : true ,
29
- attrs : {
30
- type : 'module' ,
31
- src : `http://localhost:${ port } /virtual-react-inspector-path-load.js` ,
32
- } ,
33
- } ,
34
- ] ,
35
- } ;
36
23
37
- return config ;
24
+ setConfig ( config , 'html.tags' , [
25
+ ...tags ,
26
+ {
27
+ tag : 'script' ,
28
+ head : true ,
29
+ attrs : {
30
+ type : 'module' ,
31
+ src : `http://localhost:${ port } /virtual-react-inspector-path-load.js` ,
32
+ } ,
33
+ } ,
34
+ ] ) ;
38
35
} ) ;
39
36
40
37
api . onAfterStartDevServer ( ( ) => {
You can’t perform that action at this time.
0 commit comments