gridstack.js/Gruntfile.js

140 lines
3.9 KiB
JavaScript
Raw Permalink Normal View History

2016-03-02 08:31:53 +01:00
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
2016-02-20 01:45:30 +01:00
module.exports = function(grunt) {
2016-02-11 03:32:04 +01:00
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
2016-02-11 03:45:47 +01:00
grunt.loadNpmTasks('grunt-doctoc');
2016-02-19 23:31:06 +01:00
grunt.loadNpmTasks('grunt-contrib-jshint');
2016-02-20 01:45:30 +01:00
grunt.loadNpmTasks('grunt-jscs');
2016-02-20 08:20:42 +01:00
grunt.loadNpmTasks('grunt-contrib-watch');
2016-03-02 04:31:09 +01:00
grunt.loadNpmTasks('grunt-protractor-runner');
grunt.loadNpmTasks('grunt-contrib-connect');
2016-03-02 08:31:53 +01:00
grunt.loadNpmTasks('grunt-protractor-webdriver');
2015-11-18 16:47:37 +01:00
2016-02-11 03:32:04 +01:00
grunt.initConfig({
sass: {
options: {
outputStyle: 'expanded'
},
dist: {
files: {
'dist/gridstack.css': 'src/gridstack.scss',
'dist/gridstack-extra.css': 'src/gridstack-extra.scss'
}
}
},
2015-11-18 16:47:37 +01:00
2016-02-11 03:32:04 +01:00
cssmin: {
dist: {
files: {
'dist/gridstack.min.css': ['dist/gridstack.css'],
'dist/gridstack-extra.min.css': ['dist/gridstack-extra.css']
}
}
},
2015-11-18 16:47:37 +01:00
2016-02-11 03:32:04 +01:00
copy: {
dist: {
files: {
2016-08-19 06:43:48 +02:00
'dist/gridstack.js': ['src/gridstack.js'],
'dist/gridstack.jQueryUI.js': ['src/gridstack.jQueryUI.js'],
2016-02-11 03:32:04 +01:00
}
}
},
2015-11-18 16:47:37 +01:00
2016-02-11 03:32:04 +01:00
uglify: {
options: {
sourceMap: true,
2016-02-15 20:37:07 +01:00
sourceMapName: 'dist/gridstack.min.map',
preserveComments: 'some'
2016-02-11 03:32:04 +01:00
},
dist: {
files: {
2016-08-19 06:43:48 +02:00
'dist/gridstack.min.js': ['src/gridstack.js'],
2016-08-20 22:44:01 +02:00
'dist/gridstack.jQueryUI.min.js': ['src/gridstack.jQueryUI.js'],
2016-08-19 06:43:48 +02:00
'dist/gridstack.all.js': ['src/gridstack.js', 'src/gridstack.jQueryUI.js']
2016-02-11 03:32:04 +01:00
}
}
2016-02-11 03:45:47 +01:00
},
doctoc: {
options: {
removeAd: false
},
readme: {
2016-02-20 04:45:51 +01:00
options: {
target: './README.md'
}
},
doc: {
options: {
target: './doc/README.md'
}
},
2016-03-06 21:09:51 +01:00
faq: {
options: {
target: './doc/FAQ.md'
}
},
2016-02-19 23:31:06 +01:00
},
jshint: {
all: ['src/*.js']
2016-02-20 01:45:30 +01:00
},
jscs: {
all: ['*.js', 'src/*.js', ],
},
2016-02-20 08:20:42 +01:00
watch: {
scripts: {
files: ['src/*.js'],
2016-02-20 08:49:19 +01:00
tasks: ['uglify', 'copy'],
2016-02-20 08:20:42 +01:00
options: {
},
},
styles: {
files: ['src/*.scss'],
tasks: ['sass', 'cssmin'],
options: {
},
},
docs: {
2016-03-06 21:09:51 +01:00
files: ['README.md', 'doc/README.md', 'doc/FAQ.md'],
2016-02-20 08:20:42 +01:00
tasks: ['doctoc'],
options: {
},
},
},
2016-03-02 04:31:09 +01:00
protractor: {
options: {
configFile: 'protractor.conf.js',
},
all: {}
},
connect: {
all: {
options: {
port: 8080,
hostname: 'localhost',
base: '.',
},
},
},
2016-03-02 08:31:53 +01:00
protractor_webdriver: {
all: {
options: {
command: 'webdriver-manager start',
}
}
}
2016-02-11 03:32:04 +01:00
});
2015-11-18 16:47:37 +01:00
2016-02-20 08:49:19 +01:00
grunt.registerTask('default', ['sass', 'cssmin', 'jshint', 'jscs', 'copy', 'uglify', 'doctoc']);
2016-03-02 08:31:53 +01:00
grunt.registerTask('e2e-test', ['connect', 'protractor_webdriver', 'protractor']);
2015-11-18 16:47:37 +01:00
};