grunt js injector error for generator-angularjs-cordova

It’s because of grunt-injector line endings. See this issue.

To avoid that you could configure grunt injector to work with default grunt line endings:

injector: {
 options: {
 lineEnding: grunt.util.linefeed
 },
 ...
}

 

Doing that, you will have to configure your Git line endings setting in case you work on different platforms. Assuming you are on Windows and pulling a file from Linux, you will obtain after the injection process a mixed LF and CR/LF file (LF in all the HTML file and CR/LF bewteen <!– injector:js –> tags) and the grunt-build plugin will not work.

You can use this Sublime Text plugin to see line endings on your file.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s