-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.js
61 lines (57 loc) · 1.73 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
module.exports = function(grunt) {
'use strict';
var webpack = require("webpack");
var webpackConfig = require("./webpack.config.js");
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
webpack: {
options: webpackConfig,
build: {
stats: {
// Configure the console output
colors: false,
modules: true,
reasons: false
},
plugins: webpackConfig.plugins.concat(
new webpack.DefinePlugin({
"process.env": {
// This can have an effect on library size
"NODE_ENV": JSON.stringify("production")
},
"DEBUG": false
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin()
)
}
},
"webpack-dev-server": {
options: {
webpack: webpackConfig,
publicPath: "/" + webpackConfig.output.publicPath,
contentBase: 'client/',
},
start: {
plugins: webpackConfig.plugins.concat(
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
"DEBUG": true
})
),
keepAlive: true,
webpack: {
cache: true,
watch: true,
inline: true,
devtool: "eval",
debug: true
}
}
}
});
grunt.loadNpmTasks('grunt-webpack');
// Default task(s).
grunt.registerTask("default", ["webpack-dev-server:start"]);
grunt.registerTask("build", ["webpack:build"]);
};