-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
34 lines (28 loc) · 961 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
34
let comment = "/**\n <%= pkg.name %>:<%= pkg.version %> \n Copyright 2017 <%= pkg.author %> \n Released Under The <%= pkg.license %> License\n <%= pkg.url %> \n */";
const uglifyConf = {
options: {
banner: comment
},
build: {
src: "dist/bundle.js",
dest: "dist/bundle.min.js"
}
};
const webpackConf = {
dist: require("./webpack.config.js")
};
module.exports = function(grunt) {
require("load-grunt-tasks")(grunt);
// Project configuration.
grunt.initConfig({
pkg : grunt.file.readJSON("package.json"),
webpack : webpackConf,
uglify : uglifyConf
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks("grunt-contrib-uglify");
//grunt typescript for transpiling typescript into javascript
grunt.loadNpmTasks("grunt-webpack");
// Default task(s).
grunt.registerTask("default", ["webpack", "uglify"]);
};