

take css in temp, minify it, and save it into dist Grunt.loadNpmTasks('grunt-contrib-uglify') Grunt.loadNpmTasks('grunt-contrib-cssmin') Grunt.loadNpmTasks('grunt-contrib-concat') Grunt.loadNpmTasks('grunt-angular-templates') Npm install -save-dev grunt-contrib-concatĪt the root root of your project create a file called Gruntfile.js with the following content: 'use strict' Npm install -save-dev grunt-contrib-uglify Npm install -save-dev grunt-angular-templates Npm install -save-dev grunt-contrib-cssmin When installing dependencies using -save-dev all installed packages will be save in the package.json file under the section development dependencies. The wizard will create a package.json and an index.js file or call the entry point file as you like. Start an empty package with npm init, follow the wizard steps. When you finish this tutorial the project will be ready to ship a minified version in the dist directory.Īll source code will be store in the js directory (some people use src). we will not cover this on this tutorial, however you can check it how to install npm here. It's required to have NPM installed in our system. Unit test and coverage will be left for a future tutorial. This guide will help you to setup an initial project that will only minify source code. We will setup AngularJS project with Grunt as a task runner. In this tutorial we are going to cover how to create a new npm package from an AngulaJS module or project, so it can be re maintained independently or used by other projects. When your project starts to grow sometimes it becames the moment when you need to split it in parts.
