-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile-Prod.js
93 lines (88 loc) · 2.38 KB
/
Gruntfile-Prod.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/// <binding AfterBuild='concat, babel' />
module.exports = function(grunt) {
const sass = require('node-sass')
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options : {
sourceMap :true
},
site: {
src: [
'src/Bobcat.Web/wwwroot/js/app/viewmodels/**/*.js',
'src/Bobcat.Web/wwwroot/js/app/objects/**/*.js'
],
dest: 'src/Bobcat.Web/wwwroot/js/site.js',
},
resources: {
src: [
'src/Bobcat.Web/wwwroot/lib/jquery/dist/jquery.js',
'src/Bobcat.Web/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js',
'src/Bobcat.Web/wwwroot/lib/toastr.js/toastr.min.js',
'src/Bobcat.Web/wwwroot/js/jsmpeg.min.js',
'src/Bobcat.Web/wwwroot/lib/knockout/knockout-latest.min.js',
'src/Bobcat.Web/wwwroot/js/all.min.js'
],
dest: 'src/Bobcat.Web/wwwroot/js/resources.js',
},
},
babel: {
options: {
sourceMap: true,
presets: ['@babel/preset-env']
},
dist: {
files: {
'src/Bobcat.Web/wwwroot/js/site.js': 'src/Bobcat.Web/wwwroot/js/site.js'
}
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'src/Bobcat.Web/wwwroot/js/site.min.js': ['src/Bobcat.Web/wwwroot/js/site.js'],
'src/Bobcat.Web/wwwroot/js/resources.min.js': ['src/Bobcat.Web/wwwroot/js/resources.js']
}
}
},
sass: {
options: { // Target options
implementation: sass,
sourceMap: true
},
dist: {
files: {
'src/Bobcat.Web/wwwroot/css/site.css': 'src/Bobcat.Web/wwwroot/sass/site.scss' // 'destination': 'source'
}
}
},
jshint: {
files: ['Gruntfile.js', 'src/Bobcat.Web/wwwroot/js/app/**/*.js'],
options: {
// options here to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true
},
'esversion': 6
},
ignore_warning: {
options: {
'expr': true,
},
src: ['src/Bobcat.Web/wwwroot/js/app/**/*.js'],
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-babel');
grunt.loadNpmTasks('grunt-sass');
grunt.registerTask('default', ['concat', 'babel', 'uglify', 'sass']);
};