Ich erstelle meine erste SPA in Angular und konsumiere eine SpringBoot Rest API.Wie erstelle ich einen einfachen "Build" in Angular SPA
Was ich brauche, ist einen einfachen "Build" -Prozess zu erstellen, wie Maven für Java-Projekte, damit ich verschiedene Umgebungskonstanten behandeln kann. Ist es möglich, es einfach zu machen? Ich habe sehr große Konfiguration js gesehen und dies ist ein einfaches Projekt.
Ich habe dies in meinem app.js
angular.module('app', [ 'ui.router', 'ngCookies', 'ngMessages', 'ngStorage', 'ngAnimate', 'datatables',
'checklist-model', 'pascalprecht.translate', 'ui.bootstrap', 'oitozero.ngSweetAlert', 'ngSanitize',
'angucomplete-alt', 'localytics.directives', 'angular-peity'])
.constant('config', {
appName : 'MyApp',
appVersion : '1.0.0',
apiUrl : 'http://localhost:8080/rest/v1/',
auth : {
url : 'http://localhost:8080/oauth/token',
clientId : 'myAppOuath2',
header : 'Basic c29mdGFs123456F1dGgyOlh6NnFnamhwwxx=',
grantType : 'password'
}
})
...
Und ich will die URLs mit Wildcards wie diese automatisieren:
...
apiUrl : '{apiUrl}',
auth : {
url : '{authUrl}',
clientId : '{clientId}',
header : '{authHeader}',
grantType : 'password'
}
Dank!
Auschecken Grunt-Preprocess: https://github.com/jsoverson/grunt-preprocess –