File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ module.exports = ({ isDev }) => {
4444 const output = resolveAppPath ( 'src/htdocs/dist' ) ;
4545 const extensionConfig = loadExtensionConfig ( ) ;
4646 const routes = prepareRoutes ( extensionConfig . routes ) ;
47+
48+ const routesPlugin = new VirtualModulesPlugin ( {
49+ routes : generateRoutesModule ( routes ) ,
50+ } ) ;
51+
4752 const baseConfig = {
4853 mode : isDev ? 'development' : 'production' ,
4954 watch : isDev ,
@@ -91,9 +96,6 @@ module.exports = ({ isDev }) => {
9196 routes,
9297 } ,
9398 } ) ,
94- new VirtualModulesPlugin ( {
95- routes : generateRoutesModule ( routes ) ,
96- } ) ,
9799 ] ,
98100 resolve : {
99101 modules : [
@@ -106,5 +108,12 @@ module.exports = ({ isDev }) => {
106108 } ,
107109 } ;
108110
109- return applyCustomConfig ( baseConfig , { isDev } , extensionConfig . webpack ) ;
111+ const config = applyCustomConfig ( baseConfig , { isDev } , extensionConfig . webpack ) ;
112+
113+ if ( ! config . plugins || ! config . plugins . find ( plugin => plugin ?. constructor ?. name === 'VirtualModulesPlugin' ) ) {
114+ config . plugins ??= [ ] ;
115+ config . plugins . push ( routesPlugin ) ;
116+ }
117+
118+ return config ;
110119} ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @plesk/plesk-ext-sdk" ,
33 "description" : " Plesk Extension SDK" ,
4- "version" : " 0.6.1 " ,
4+ "version" : " 0.6.2 " ,
55 "author" : " Plesk Developers <plesk-dev-leads@plesk.com> (https://www.plesk.com/)" ,
66 "repository" : " plesk/plesk-ext-sdk" ,
77 "bugs" : {
You can’t perform that action at this time.
0 commit comments