File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/rsbuild-plugin-web-extension/src Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ interface Options {
77
88const pluginName = "rsbuild:plugin-web-extension" ;
99
10+ const port = + ( process . env . PORT || 3130 ) ;
11+
1012export const pluginWebExtension = ( { manifest } : Options ) : RsbuildPlugin => ( {
1113 name : pluginName ,
1214 setup : async ( api ) => {
@@ -31,6 +33,10 @@ export const pluginWebExtension = ({ manifest }: Options): RsbuildPlugin => ({
3133
3234 api . modifyRspackConfig ( ( config , { mergeConfig, HtmlPlugin } ) => {
3335 return mergeConfig ( config , {
36+ output : {
37+ hotUpdateChunkFilename : "hot/[id].[fullhash].hot-update.js" , // this points to where hmr files will be saved
38+ hotUpdateMainFilename : "hot/[runtime].[fullhash].hot-update.json" , // this points to where hmr files will be saved
39+ } ,
3440 plugins : htmlEntryPoints . map ( ( [ name , template ] ) => {
3541 return new HtmlPlugin ( {
3642 chunks : [ name ] ,
@@ -61,8 +67,14 @@ export const pluginWebExtension = ({ manifest }: Options): RsbuildPlugin => ({
6167 js : "src/[name]" ,
6268 } ,
6369 } ,
64-
70+ server : {
71+ port,
72+ } ,
6573 dev : {
74+ client : {
75+ port,
76+ host : "localhost" ,
77+ } ,
6678 writeToDisk : true ,
6779 } ,
6880 } ) ;
You can’t perform that action at this time.
0 commit comments