If one is not using grunt's "concat" and "bower_concat", angular-i18n is used this way:
<html ng-app>
<head>
...
<script src="angular.js"></script>
<script src="i18n/angular-locale_de-de.js"></script>
...
</head>
</html>
(According to here: https://docs.angularjs.org/guide/i18n)
But... of course: I'm using concat
and bower_concat
.
I'm using them this way:
First I use bower_concat and create
build/bower-concat.js
Note: bower_concat reads every bower.json of every subdirectory living inbower_components
and it concatenates all the main files.
Note 2: the bower.json of "angular-18n" has"ignore": ["**/.*", ...
Then I concat all my js's (my controllers, etc), into
build/inouse-concat.js
- Finally I concat
bower-concat.js
withinhouse-concat.js
intoall-concat.js
<script src="build/all-concat.js"></script>
So I though that I could include the corresponding locale, "angular-i18n/angular-locale_de-de.js
", in the third step, like this:
// inhouse js with bower's js with angular's i18n into one file
allJsConcat: {
src: ['build/bower-concat.js', 'bower_components/angular-i18n/angular-locale_de-de.js', 'build/inhouse-concat.js',],
dest: 'build/all-concat.js',
}
But this is not working. I'm getting:
Uncaught ReferenceError: require is not defined
Question: how would you recommend using grunt, concat, and bower_concat with angular's locale js? what am I doing wrong?