@@ -26,6 +26,7 @@ interface BundleOutputFiles {
2626
2727interface BundleOutputDirs {
2828 dist : string ;
29+ tmpDir : string ;
2930 mpkDir : string ;
3031 contentRoot : string ;
3132 widgetDir : string ;
@@ -41,15 +42,6 @@ interface ProjectConfigInputs {
4142export abstract class ProjectConfig {
4243 readonly projectPath : string | null = null ;
4344
44- /** Output directory for built files. */
45- readonly dist = "dist" ;
46-
47- /**
48- * Package root directory that contains all widget files shipped with mpk.
49- * By default "dist/tmp/widgets".
50- */
51- readonly contentRoot = path . join ( this . dist , "tmp" , "widgets" ) ;
52-
5345 /** Widget package.json */
5446 readonly pkg : PackageJson ;
5547
@@ -136,13 +128,26 @@ export abstract class ProjectConfig {
136128 }
137129
138130 get outputDirs ( ) : BundleOutputDirs {
139- const widgetDir = path . join ( this . contentRoot , this . widgetDirectory ) ;
131+ // dist
132+ const dist = "dist" ;
133+ // dist/tmp
134+ const tmpDir = path . join ( dist , "tmp" ) ;
135+ // dist/tmp/widgets
136+ const contentRoot = path . join ( tmpDir , "widgets" ) ;
137+ // dist/tmp/widgets/com/mendix/my/awesome/button
138+ const widgetDir = path . join ( contentRoot , this . widgetDirectory ) ;
139+ // dist/x.y.z
140+ const mpkDir = path . join ( dist , this . pkg . version ) ;
141+ // dist/widgets/com/mendix/my/awesome/button/assets
142+ const widgetAssetsDir = path . join ( widgetDir , "assets" ) ;
143+
140144 return {
141- dist : this . dist ,
142- mpkDir : path . join ( this . dist , this . pkg . version ) ,
143- contentRoot : this . contentRoot ,
145+ dist,
146+ tmpDir,
147+ mpkDir,
148+ contentRoot,
144149 widgetDir,
145- widgetAssetsDir : path . join ( widgetDir , "assets" )
150+ widgetAssetsDir
146151 } ;
147152 }
148153
@@ -152,8 +157,8 @@ export abstract class ProjectConfig {
152157
153158 toPlainObject ( ) : Record < string , unknown > {
154159 return {
155- dist : this . dist ,
156- contentRoot : this . contentRoot ,
160+ dist : this . outputDirs . dist ,
161+ contentRoot : this . outputDirs . contentRoot ,
157162 pkg : this . pkg ,
158163 isTsProject : this . isTsProject ,
159164 projectPath : this . projectPath ,
0 commit comments