dirview/gruntfile.js

46 lines
950 B
JavaScript
Raw Normal View History

2019-05-27 17:35:14 -07:00
const webpackConfig = require('./webpack.config.js');
2019-05-27 16:22:23 -07:00
module.exports = function(grunt) {
grunt.initConfig({
2019-05-27 17:35:14 -07:00
webpack: {
dev: webpackConfig,
},
2019-06-01 18:45:52 -07:00
babel: {
options: {
sourceMap: true
},
dist: {
files: {
"static/scripts.js": "static/scripts.jsx"
}
}
},
2019-06-01 22:53:57 -07:00
less: {
styles: {
files: {
"static/style.css": "assets/style/main.less"
},
sourceMap: true
}
},
2019-05-27 16:22:23 -07:00
watch: {
2019-06-01 22:53:57 -07:00
jshits: {
2019-05-27 17:35:14 -07:00
files: ['assets/js/*.js'],
2019-06-01 18:45:52 -07:00
tasks: ['webpack:dev', 'babel'],
2019-06-01 22:53:57 -07:00
},
cshits: {
files: ["assets/style/main.less"],
tasks: ['less:styles'],
2019-05-27 16:22:23 -07:00
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
2019-05-27 17:35:14 -07:00
grunt.loadNpmTasks('grunt-webpack');
2019-06-01 18:45:52 -07:00
grunt.loadNpmTasks('grunt-babel');
2019-06-01 22:53:57 -07:00
grunt.loadNpmTasks('grunt-contrib-less');
2019-05-27 16:22:23 -07:00
2019-06-01 22:53:57 -07:00
grunt.registerTask('default', ['webpack:dev', 'babel', 'less:styles']);
2019-05-27 16:22:23 -07:00
};