-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgruntfile.js
52 lines (46 loc) · 1.65 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
module.exports = function (grunt) {
grunt.initConfig({
browserify: {
development: {
src: [
"./js/main-home.js",
"./js/main-products.js"
],
dest: './dist/js/common.js',
options: {
browserifyOptions: { debug: true },
transform: [["babelify", { "presets": ["es2015"] }]],
plugin: [
["factor-bundle", { outputs: [
"./dist/js/main-home.js",
"./dist/js/main-products.js"
] }]
],
watch: true,
keepAlive: true,
}
},
production: {
src: [
"./js/main-home.js",
"./js/main-products.js"
],
dest: './dist/js/common.min.js',
options: {
browserifyOptions: { debug: false },
transform: [["babelify", { "presets": ["es2015"] }]],
plugin: [
["factor-bundle", { outputs: [
"./dist/js/main-home.min.js",
"./dist/js/main-products.min.js"
] }],
["minifyify", { map: false }]
]
}
}
},
});
grunt.loadNpmTasks('grunt-browserify');
grunt.registerTask("buildDev", ['browserify:development']);
grunt.registerTask("buildProd", ['browserify:production']);
};