Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Gruntfile.js #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 56 additions & 52 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,65 @@
/*global module:false*/
module.exports = function(grunt){
module.exports = function(grunt) {


// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: grunt.file.readJSON('bower.json'),
copy: {
demo: {
files: [
{expand: true, src: ['src/*'], dest: 'dist/', filter: 'isFile', flatten: true}
]
}
},
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: grunt.file.readJSON('bower.json'),

uglify: {
options: {
beautify: {
ascii_only : true
},
preserveComments: 'some'
},
html5shiv: {
files: [{
expand: true, // Enable dynamic expansion.
cwd: 'src/', // Src matches are relative to this path.
src: ['**/*.js'], // Actual pattern(s) to match.
dest: 'dist/', // Destination path prefix.
ext: '.min.js'
}]
}
},
watch: {
js: {
files: ['src/**/*.js'],
tasks: ['copy', 'uglify', 'bytesize']
}
},
bytesize: {
all: {
src: [
'dist/**.min.js'
]
}
}
});
copy: {
demo: {
files: [
{
expand: true,
src: ['src/*'],
dest: 'dist/',
filter: 'isFile',
flatten: true
}
]
}
},


// Default task.
uglify: {
options: {
beautify: {
ascii_only: true
},
preserveComments: 'some'
},
html5shiv: {
files: [{
expand: true, // Enable dynamic expansion.
cwd: 'src/', // Src matches are relative to this path.
src: ['**/*.js'], // Actual pattern(s) to match.
dest: 'dist/', // Destination path prefix.
ext: '.min.js'
}]
}
},


watch: {
js: {
files: ['src/**/*.js'],
tasks: ['copy', 'uglify', 'bytesize']
}
},

grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-bytesize');
bytesize: {
all: {
src: [
'dist/**/*.min.js'
]
}
}
});

grunt.registerTask('default', ['copy', 'uglify', 'bytesize', 'watch']);
// Load the necessary plugins.
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-bytesize');

// Register the default tasks.
grunt.registerTask('default', ['copy', 'uglify', 'bytesize', 'watch']);
};