16.07.2017 Views

AngularJS Essentials

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Automating the Workflow<br />

grunt.initConfig({<br />

clean: {<br />

dist: ["dist/"]<br />

},<br />

jshint: {<br />

dist: ['Gruntfile.js', 'js/**/*.js', 'test/**/*.js']<br />

},<br />

concat: {<br />

dist: {<br />

src: ["js/**/*.js"],<br />

dest: "dist/js/scripts.js"<br />

}<br />

},<br />

uglify: {<br />

dist: {<br />

src: ["dist/js/scripts.js"],<br />

dest: "dist/js/scripts.min.js"<br />

}<br />

},<br />

copy: {<br />

dist: {<br />

src: ["index.html", "lib/*", "partials/*", "css/*"],<br />

dest: "dist/"<br />

}<br />

},<br />

karma: {<br />

dist: {<br />

configFile: "karma.conf.js"<br />

}<br />

}<br />

});<br />

grunt.loadNpmTasks("grunt-contrib-clean");<br />

grunt.loadNpmTasks("grunt-contrib-jshint");<br />

grunt.loadNpmTasks("grunt-contrib-concat");<br />

grunt.loadNpmTasks("grunt-contrib-uglify");<br />

grunt.loadNpmTasks("grunt-contrib-copy");<br />

grunt.loadNpmTasks("grunt-karma");<br />

grunt.registerTask("dist", ["clean", "jshint", "concat",<br />

"uglify", "copy", "karma"]);<br />

}<br />

[ 152 ]<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!