File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
DistributionPackages/Vendor.Site Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,18 @@ module.exports = function (fusionSource) {
21
21
exportStatements . push ( 'export {styles};' ) ;
22
22
}
23
23
24
+ if ( ! fs . existsSync ( `${ basePath } .css` ) && fs . existsSync ( `${ basePath } .css.fusion` ) ) {
25
+ fs . unlinkSync ( `${ basePath } .css.fusion` ) ;
26
+ }
27
+
24
28
if ( fs . existsSync ( `${ basePath } .js` ) ) {
25
29
throw new Error ( `Do not use JS files for components. Please create a "${ path . basename ( basePath ) } .ts" instead.` ) ;
26
30
}
27
31
32
+ if ( ! fs . existsSync ( `${ basePath } .ts` ) && ! fs . existsSync ( `${ basePath } .js` ) && fs . existsSync ( `${ basePath } .js.fusion` ) ) {
33
+ fs . unlinkSync ( `${ basePath } .js.fusion` ) ;
34
+ }
35
+
28
36
if ( fs . existsSync ( `${ basePath } .ts` ) ) {
29
37
importStatements . push ( `import script from '${ basePath } .ts';` ) ;
30
38
exportStatements . push ( 'export {script};' ) ;
Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ export default function main(components: ComponentsDefinition) {
18
18
if ( componentName in components ) {
19
19
const { script, prototypeName, styles} = components [ componentName ] ;
20
20
21
- script ( el , { prototypeName, styles} ) ;
21
+ if ( script ) {
22
+ script ( el , { prototypeName, styles} ) ;
23
+ return ;
24
+ }
25
+
22
26
return ;
23
27
}
24
28
Original file line number Diff line number Diff line change @@ -77,9 +77,14 @@ install::
77
77
flush ::
78
78
@ddev composer flush
79
79
80
+ remove-artefacts :
81
+ @ddev exec find ./DistributionPackages/ -type f -name ' *.js.fusion' -delete
82
+ @ddev exec find ./DistributionPackages/ -type f -name ' *.css.fusion' -delete
83
+
80
84
cleanup ::
81
85
@ddev composer cleanup:php
82
86
@ddev yarn cleanup:node
87
+ @$(MAKE ) -s remove-artefacts
83
88
84
89
# ##############################################################################
85
90
# LINTING & QA #
You can’t perform that action at this time.
0 commit comments