@@ -20,7 +20,15 @@ grunt.initConfig( {
20
20
dest : "dist/resources/sri-directives.json"
21
21
}
22
22
}
23
- }
23
+ } ,
24
+
25
+ wordpress : ( function ( ) {
26
+
27
+ // This fails with "Cannot find module" if the file does not exist
28
+ var config = require ( "./config" ) ;
29
+ config . dir = "dist/wordpress" ;
30
+ return config ;
31
+ } ) ( )
24
32
} ) ;
25
33
26
34
grunt . registerTask ( "build-index" , function ( ) {
@@ -451,22 +459,12 @@ grunt.registerTask( "ensure-dist-resources", function() {
451
459
grunt . file . mkdir ( "dist/resources" ) ;
452
460
} ) ;
453
461
454
- grunt . registerTask ( "ensure-wordpress-config" , function ( ) {
455
- // This will fail with "Cannot find module" if the file
456
- // does not exist
457
- var config = require ( "./config" ) ;
458
- config . dir = "dist/wordpress" ;
459
- grunt . config . merge ( {
460
- wordpress : config
461
- } ) ;
462
- } ) ;
463
-
464
462
grunt . registerTask ( "sri-generate" , [ "ensure-dist-resources" , "sri:generate" ] ) ;
465
463
466
464
// The "grunt deploy" command is automatically invoked on git-commit by the server that
467
465
// will deploy the WordPress site.
468
466
// Task tree: "deploy" > "wordpress-deploy" > "build-wordpress" > "build".
469
467
grunt . registerTask ( "build" , [ "sri-generate" , "build-index" ] ) ;
470
- grunt . registerTask ( "deploy" , [ "ensure-wordpress-config" , " wordpress-deploy", "reload-listings" ] ) ;
468
+ grunt . registerTask ( "deploy" , [ "wordpress-deploy" , "reload-listings" ] ) ;
471
469
472
470
} ;
0 commit comments