-
Notifications
You must be signed in to change notification settings - Fork 10
/
Gruntfile.js
55 lines (52 loc) · 1.3 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
var TerserPlugin = require('terser-webpack-plugin');
var webpackConfig = require('./webpack.config.js');
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-webpack');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-sftp-deploy');
grunt.initConfig({
'pkg': grunt.file.readJSON('package.json'),
'webpack': {
options: webpackConfig,
build: {
mode: 'production',
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
}
},
'webpack-dev-server': {
options: webpackConfig,
start: {
mode: 'development',
devtool: 'eval',
devServer: {
static: 'public',
},
}
},
'open': {
default: {
path: 'http://localhost:8080/',
app: 'Google Chrome'
}
},
'sftp-deploy': {
build: {
auth: {
host: 'zoeetrope.com',
authKey: 'privateKey',
port: 22
},
src: 'public',
dest: '/home/deployer/mob-timer',
serverSep: '/',
progress: true
}
}
});
grunt.registerTask('default', ['webpack-dev-server:start', 'open:dev']);
grunt.registerTask('build', ['webpack:build']);
grunt.registerTask('deploy', ['webpack:build', 'sftp-deploy']);
};