Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- module.exports = function(grunt)
- {
- grunt.initConfig({
- // validate this file
- jshint: {
- options: {
- jshintrc: '.jshintrc'
- },
- gruntfile: [
- 'gruntfile.js'
- ]
- },
- // minify css!
- cssmin: {
- dist: {
- files: {
- 'src/css/style.min.css': [
- 'src/css/*.css',
- '!src/css/style.min.css'
- ]
- }
- }
- },
- open: {
- // We open this url to reload the plugin in chrome with 'watch'
- // Requires https://chrome.google.com/webstore/detail/extensions-reloader/fimgfedafeadlieiabdeeaodndnlbhid
- // Note, I am playing with Chrome Canary here, remove or change for youre own browser ;)
- refresh : {
- path: 'http://reload.extensions/',
- app: 'Google Chrome Canary'
- }
- },
- // Used for dev, auto updates, etc.
- watch: {
- gruntfile: {
- files: '<%= jshint.gruntfile %>',
- tasks: ['jshint'],
- options: {
- livereload: true,
- },
- },
- livereload: {
- options: { livereload: true },
- // (Optionnal) Uncomment task line below to run Extension Reloader on file modification
- // tasks: ['open:refresh'],
- // livereload watches only the specified files
- files: [
- 'src/**/*.css',
- 'src/**/*.js',
- 'src/**/*.html',
- 'src/**/*.png',
- 'src/**/*.jpg'
- ],
- }
- },
- // copy all but source files to prepare for crx release
- copy: {
- dist: {
- files: [{
- expand: true,
- src: [
- 'src/**',
- '!src/**/*.psd',
- '!src/**/*.map'
- ],
- dest: 'temp/'
- }]
- }
- },
- // more details on crx here: https://npmjs.org/package/grunt-crx
- crx: {
- dist: {
- "src": "src/",
- "dest": "dist/",
- }
- }
- });
- // Load tasks
- grunt.loadNpmTasks('grunt-contrib-jshint');
- grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.loadNpmTasks('grunt-contrib-copy');
- grunt.loadNpmTasks('grunt-open');
- grunt.loadNpmTasks('grunt-crx');
- // Register tasks
- grunt.registerTask('default', [
- 'watch'
- ]);
- grunt.registerTask('dev', [
- 'watch'
- ]);
- grunt.registerTask('release', [
- 'copy:dist',
- 'crx',
- 'clean:crx'
- ]);
- };
Add Comment
Please, Sign In to add comment