Skip to content

Instantly share code, notes, and snippets.

@vslala
Created October 11, 2016 10:44
Show Gist options
  • Select an option

  • Save vslala/60d8d1c6e3ef22bcca60811d9e70ecf0 to your computer and use it in GitHub Desktop.

Select an option

Save vslala/60d8d1c6e3ef22bcca60811d9e70ecf0 to your computer and use it in GitHub Desktop.
Stacc HMVC Backbone Boilerplate
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-webpack');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: [
'Gruntfile.js',
'js/*.js',
'app/**/*.js'
]
},
imagemin: {
dynamic: {
files: [{
expand: true,
cwd: 'img/',
src: [
'*.{png,jpg,gif,svg}',
'**/*.{png,jpg,gif,svg}'
],
dest: 'img/'
}]
}
},
// sass:{
// dist:{
// options:{
// style: 'compressed',
// sourcemap: 'none'
// },
// files:{
// 'app/**/*.css':'app/<%= grunt.task.current.args[0] %>/*.sass'
// }
// }
// },
sass: {
dist: {
files: [{
expand: true,
src: ['app/**/*.sass'],
dest: 'css/../',
extDot: 'last',
ext: '.css'
}]
},
options: {
sourcemap: false
}
},
postcss:{
options:{
processors:[
require('autoprefixer')({
browsers:[
'last 2 versions',
'> 10%',
]
})
]
},
dist:{
src: ['app/**/*.css']
}
},
watch: {
js: {
files: [
'app/**/*.js',
'js/*.js'
],
tasks: [
'jshint', 'webpack'
]
},
css: {
files: [
'app/**/*.sass'
],
tasks: [
'sass'
]
},
options:{
livereload: true
}
},
webpack: {
development: {
entry: './js/app.js',
output: {
path: './js/build',
filename: 'app.bundle.js'
},
watch: true,
module: {
loaders: [
{ test: /\.css$/, loader: "style-loader!css-loader" }
]
}
}
},
connect:{
server:{
options:{
livereload: true
}
}
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment