@@ -220,6 +220,8 @@ module.exports = (grunt) ->
220220 " copy:fonts"
221221 " copy:wetboew"
222222 " copy:depsJS_custom"
223+ " copy:gcdsLoader"
224+ " usebanner:gcdsLoader"
223225 ]
224226 )
225227
@@ -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
@@ -1070,7 +1094,7 @@ module.exports = (grunt) ->
10701094 indent : " \t "
10711095 }
10721096
1073- lintspaces :
1097+ lintspaces : components / gcds - card /
10741098 all :
10751099 src : [
10761100 # Root files
0 commit comments