Added a grunt build

This copies Layout.js to a dist folder, minifies and source-maps.
This commit is contained in:
Colin Eberhardt
2015-08-11 13:49:52 +01:00
parent a87e9e382f
commit ffa64f6fd3
2 changed files with 51 additions and 0 deletions

46
Gruntfile.js Normal file
View File

@@ -0,0 +1,46 @@
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
paths: {
distFolder: 'dist',
srcFolder: 'src'
},
clean: ['<%= paths.distFolder %>'],
copy: {
main: {
expand: true,
src: ['<%= paths.srcFolder %>/Layout.js'],
dest: '<%= paths.distFolder %>',
rename: function(dest, src) {
return dest + '/css-layout.js';
}
}
},
uglify: {
options: {
sourceMap: true,
sourceMapIncludeSources: true
},
main: {
files: {
'<%= paths.distFolder %>/css-layout.min.js': ['<%= paths.srcFolder %>/Layout.js']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('build', ['clean', 'copy', 'uglify']);
grunt.registerTask('default', ['build']);
};

View File

@@ -19,6 +19,11 @@
"homepage": "https://github.com/facebook/css-layout",
"devDependencies": {
"eslint": "^0.14.1",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-uglify": "^0.9.1",
"jasmine-core": "^2.2.0",
"karma": "^0.12.31",
"karma-chrome-launcher": "^0.1.7",