-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
executable file
·89 lines (88 loc) · 2.94 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
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
//require("load-grunt-tasks")(grunt); // npm install --save-dev load-grunt-tasks
module.exports = function(grunt) {
grunt.initConfig({
"clean":{
clean: ['temp', 'spbdt_build']
},
// Include the screen HTML files in script tags in index.html
"include_file": {
default_options: {
cwd: 'src/',
src: ['index.html'],
dest: 'spbdt_build/'
}
},
// Transpile the javascript resources.
"babel": {
options: {
sourceMap: true,
getModuleId: function(x) {return x.replace(/^\/src\/resources\/js/, '.')},
babelrc: true,
ignore: ['resources/js/lib/','resources/js/extend/', 'resources/js/spa.js']
},
files: {
expand: true,
cwd: 'src/resources',
src: ['**/*.js'],
dest: 'temp/resources',
},
},
"concat": {
options: {
banner: '//// Build for SmousProBetaDeluxeTycoon ////\n',
},
dev: {
src: [
'src/resources/js/extend/*.js',
'temp/resources/js/SPBDT/backend.js',
'temp/resources/js/screens/*.js',
'temp/resources/js/main.js',
],
dest: 'temp/resources/js/sp.js',
options: {
sourceMap: true,
},
},
},
"less": {
dist: {
options: {
strictMath: true,
},
files: {
'temp/resources/css/spbdt.css': 'src/resources/css/spbdt.less',
},
// files: {
// cwd: 'src/',
// src: ['resources/css/spbdt.less'],
// dest: 'temp/resources/css/spbdt.css',
// },
},
},
// Copy the css and image resources
"copy": {
main: {
expand: true,
cwd: 'src',
src: ['resources/fonts/*', 'resources/img/*', '**/*.py', 'resources/css/*'],
dest: 'spbdt_build/'
},
temp: {
expand: true,
cwd: 'temp',
src: ['**/*.js', '**/*.map', '**/*.css'],
dest: 'spbdt_build/'
},
},
});
// Default task
grunt.registerTask('default', ['clean', 'include_file', 'babel', 'concat', 'less', 'copy']);
// Load up tasks
// grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-include-file');
grunt.loadNpmTasks('grunt-babel');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-copy');
};