Skip to content

Commit

Permalink
Use webpack to manage depenendencies and build bundle.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hector Virgen committed Sep 30, 2015
1 parent 612d400 commit fd6fbd6
Show file tree
Hide file tree
Showing 14 changed files with 711 additions and 686 deletions.
30 changes: 17 additions & 13 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ module.exports = function(grunt) {

// NPM tasks, alphabetical
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-docco');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-webpack');

grunt.initConfig({
// Clean
Expand All @@ -20,17 +20,6 @@ module.exports = function(grunt) {
coverage: ['test/coverage.html']
},

// Concat
concat: {
angular: {
src: ['lib/index.js', 'lib/http_adapter/angular.js', 'lib/wrappers/angular.js'],
dest: 'monocle-client-angular.js',
options: {
footer: 'Monocle.angularWrapper(angular, Monocle);'
}
}
},

// Documentation
docco: {
main: {
Expand Down Expand Up @@ -116,6 +105,21 @@ module.exports = function(grunt) {
],
tasks: ['mochaTest:unit']
}
},

webpack: {
angular: {
entry: './lib/angular.js',
output: {
path: './',
filename: 'monocle-client-angular.js'
},
stats: {
colors: false,
modules: true,
reasons: true
}
}
}
});

Expand All @@ -138,5 +142,5 @@ module.exports = function(grunt) {
grunt.registerTask('dev', 'Enables watchers for developing', ['watch:unit']);

// Build concatenated/minified version for browsers
grunt.registerTask('build', 'Builds concatenated/minified versions for browsers', ['concat', 'uglify']);
grunt.registerTask('build', 'Builds concatenated/minified versions for browsers', ['webpack', 'uglify']);
};
Loading

0 comments on commit fd6fbd6

Please sign in to comment.