module.exports = function( grunt ) {
var dir_theme = 'wp-content/themes/2017-child/',
dir_js = 'wp-content/themes/2017-child/assets/js/';
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
concat: {
// options: {
// separator: ';'
// },
dist: {
src: [dir_js + 'src/**/*.js',
'!' + dir_js + 'src/*-long.js',
'!' + dir_js + 'src/concatenated.js'],
dest: dir_js + 'src/concatenated.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */'
},
dist: {
src: // 'style.css': ['style.scss', '<%= concat.dist.dest %>'],
['<%= concat.dist.dest %>'],
dest:
dir_js + '<%= pkg.name %>.js'
}
},
// qunit: {
// files: ['bl-page-content/**/*.html']
// },
jshint: {
files: [dir_js + 'src/**/*.js',
dir_js + 'global.js',
'!<%= concat.dist.dest %>'],
options: {
// verbose: true,
'-W004': true,
'-W030': true,
esversion: 6,
globals: {
jQuery: true,
console: true,
module: true,
// document: true
}
}
},
sass: {
options: {
sourceMap: true
},
dist: {
src: dir_theme + 'style.scss',
dest: dir_theme + 'style.css'
}
},
watch: {
sass: {
files: dir_theme + 'style.scss',
tasks: ['sass']
},
jshint: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
}
}
});
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
// grunt.loadNpmTasks( 'grunt-contrib-qunit' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-contrib-concat' );
grunt.loadNpmTasks( 'grunt-contrib-sass' );
// grunt.registerTask( 'test', ['jshint', 'qunit']);
// grunt.registerTask( 'default', ['sass', 'jshint', 'qunit', 'concat', 'uglify']);
grunt.registerTask( 'js', ['jshint']);
grunt.registerTask( 'default', ['sass', 'jshint', 'concat', 'uglify']);
grunt.registerTask( 'cu', ['concat', 'uglify']);
};
댓글 없음:
댓글 쓰기