-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
33 lines (30 loc) · 965 Bytes
/
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
const webpackConfig = require('./webpack.config.js');
const grunt = require('grunt');
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
aws: grunt.file.readJSON('aws-keys.json'),
pkg: grunt.file.readJSON('package.json'),
aws_s3: {
options: {
accessKeyId: '<%= aws.AWSAccessKeyId %>', // Use the variables
secretAccessKey: '<%= aws.AWSSecretKey %>',
bucket: '<%= aws.bucket %>'
},
dev: {
files: [{
src: 'dist/bundle.js',
dest: 'documents/bundle.js'
}]
}
},
webpack: {
build: Object.assign({mode: 'development'}, webpackConfig),
produce: Object.assign({mode: 'production', stats: 'minimal'}, webpackConfig)
}
});
grunt.loadNpmTasks('grunt-webpack');
grunt.loadNpmTasks('grunt-aws-s3');
grunt.registerTask('default', ['webpack:build']);
grunt.registerTask('deploy', ['webpack:produce', 'aws_s3']);
};