Added a grunt build
This copies Layout.js to a dist folder, minifies and source-maps.
This commit is contained in:
46
Gruntfile.js
Normal file
46
Gruntfile.js
Normal 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']);
|
||||
|
||||
};
|
@@ -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",
|
||||
|
Reference in New Issue
Block a user