-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
43 lines (37 loc) · 1.13 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
module.exports = function(grunt) {
require("matchdep").filterAll("grunt-*").forEach(grunt.loadNpmTasks);
var webpack = require("webpack");
var webpackConfig = require("./config/webpack.make.js");
var buildConfig = webpackConfig({BUILD:true, TEST:false, GRUNT:true})
var devConfig = webpackConfig({BUILD:false, TEST:false, GRUNT:true})
grunt.initConfig({
webpack: {
options: {},
build: buildConfig,
"build-dev": devConfig
},
webpack_server: {
server:{
options: devConfig
}
},
watch: {
app: {
files: ["client/**/*"],
tasks: ["webpack:build-dev"],
options: {
spawn: false,
}
}
}
});
// The development server (the recommended option for development)
grunt.registerTask("default", ["webpack_server"]);
// Build and watch cycle (another option for development)
// Advantage: No server required, can run app from filesystem
// Disadvantage: Requests are not blocked until bundle is available,
// can serve an old app on too fast refresh
grunt.registerTask("dev", ["webpack:build-dev", "watch:app"]);
// Production build
grunt.registerTask("build", ["webpack:build"]);
};