Ich bin in einem seltsamen Problem mit grunt-ng-constant
läuft wo nur 2 von 3 der Ziele arbeiten.grunt-ng-constant Ziele nicht konsequent arbeiten
Meine Konfiguration sieht wie folgt aus:
grunt.initConfig({
ngconstant: {
options: {
space: ' ',
wrap: '"use strict";\n\n {%= __ngModule %}',
name: 'config'
},
// Environment targets
development: {
options: {
dest: '<%= yeoman.app %>/scripts/config.js',
},
constants: {
ENV: {
name: 'development',
apiEndpoint: 'http://your-development.api.endpoint:3000'
}
}
},
staging: {
options: {
dest: '<%= yeoman.app %>/scripts/config.js',
},
constants: {
ENV: {
name: 'staging',
apiEndpoint: 'http://your-staging.api.endpoint:3000'
}
}
},
production: {
options: {
dest: '<%= yeoman.dist %>/scripts/config.js',
},
constants: {
ENV: {
name: 'production',
apiEndpoint: 'http://api.livesite.com'
}
}
}
}
})
und ich habe wobei folgende Aufgaben
registriertgrunt.registerTask('development', [
'ngconstant:development'
]);
grunt.registerTask('staging', [
'ngconstant:staging'
]);
grunt.registerTask('production', [
'ngconstant:production'
]);
Wenn ich die beiden folgenden Befehle ausführen, funktioniert alles einwandfrei und die config.js
-Datei generiert wird und sieht gut aus.
grunt development
grunt staging
aber läuft grunt production
erzeugt nicht die config.js
Datei. Ich kann nicht herausfinden, warum das passiert.
Gibt der Befehl 'grunt production' Fehler zurück? Welche Version jeder Bibliothek verwenden Sie? Ich war in der Lage, alle drei erfolgreich einen schnellen Test basierend auf dem von Ihnen bereitgestellten Code zu generieren. Kannst du 'grunt production --verbose' ausführen und die Ausgabe teilen? – richleland