@@ -230,6 +230,8 @@ module.exports = (grunt) ->
230230 " usebanner:css"
231231 " copy:depsJS"
232232 " clean:depsJS"
233+ " copy:gcdsLoader"
234+ " usebanner:gcdsLoader"
233235 ]
234236 )
235237
@@ -583,6 +585,7 @@ module.exports = (grunt) ->
583585 " !{sites,common,components,templates,design-patterns,wet-boew}/**/assets"
584586 " !{sites,common,components,templates,design-patterns,wet-boew}/**/demo"
585587 " !{sites,common,components,templates,design-patterns,wet-boew}/**/demos"
588+ " !sites/gcdsloader.js"
586589 ]
587590 dest : " <%= themeDist %>/js/theme.js"
588591 common :
@@ -666,6 +669,22 @@ module.exports = (grunt) ->
666669 " <%= themeDist %>/css/*.*" ,
667670 " <%= themeDist %>/méli-mélo/*.css"
668671 ]
672+
673+ gcdsLoader :
674+ options :
675+ position : " replace"
676+ props :
677+ ver : " <%= pkg.peerDependencies[ '@cdssnc/gcds-components' ] %>"
678+ srijs : " <%= pkg[ " io .github .wet - boew" ].gcdsSriJs %>"
679+ sricss : " <%= pkg[ " io .github .wet - boew" ].gcdsSriCss %>"
680+ replace : (fileContents , newBanner , insertPositionMarker , src , options ) ->
681+ # Replace GCDS version and SRIs in the source file
682+ return fileContents
683+ .replace ( " @gcdsComponentVersion@" , options .props .ver )
684+ .replace ( " @gcdsSriJs@" , options .props .srijs )
685+ .replace ( " @gcdsSriCss@" , options .props .sricss )
686+ src : " <%= themeDist %>/js/gcdsloader.js"
687+
669688 #
670689 # Use the name in the package.json as packageName in the theme
671690 # used to build the URL and to ease the reuse of this build script for derivative themes
@@ -839,6 +858,11 @@ module.exports = (grunt) ->
839858 cwd : " <%= themeDist %>/deps-js"
840859 src : " **/*.*"
841860 dest : " dist/wet-boew/js/deps"
861+ gcdsLoader :
862+ expand : true
863+ flatten : true
864+ src : " sites/gcdsloader.js"
865+ dest : " <%= themeDist %>/js"
842866
843867 wetboew_demos :
844868 expand : true
0 commit comments