-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
79 lines (75 loc) · 2.96 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
"use strict";
module.exports = function (grunt) {
// We need to include the core Moodle grunt file too, otherwise we can't run tasks like "amd".
require("grunt-load-gruntfile")(grunt);
grunt.loadGruntfile("../../Gruntfile.js");
// Load all grunt tasks.
grunt.loadNpmTasks("grunt-contrib-sass");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.initConfig({
watch: {
// If any .scss file changes in directory "scss" then run the "sass" task.
files: "scss/*.scss",
tasks: ["sass", "js"]
},
sass: {
// Production config is also available.
development: {
options: {
// Saas output style.
style: "expanded",
// Specifies directories to scan for @import directives when parsing.
// Default value is the directory of the source, which is probably what you want.
loadPath: ["myOtherImports/"]
},
files: {
"styles.css": "scss/styles.scss"
}
},
prod:{
options: {
// Saas output style.
style: "compressed",
// Specifies directories to scan for @import directives when parsing.
// Default value is the directory of the source, which is probably what you want.
loadPath: ["myOtherImports/"]
},
files: {
"styles-prod.css": "scss/styles.scss"
}
}
},
js: {
// Production config is also available.
development: {
options: {
// Saas output style.
// style: "expanded",
// Specifies directories to scan for @import directives when parsing.
// Default value is the directory of the source, which is probably what you want.
// loadPath: ["myOtherImports/"]
},
files: {
"styles.css": "scss/styles.scss"
}
},
prod:{
options: {
// Saas output style.
style: "compressed",
// Specifies directories to scan for @import directives when parsing.
// Default value is the directory of the source, which is probably what you want.
loadPath: ["myOtherImports/"]
},
files: {
"styles-prod.css": "scss/styles.scss"
}
}
}
});
// The default task (running "grunt" in console).
grunt.registerTask("default", ["sass:development"]);
// The production task (running "grunt prod" in console).
grunt.registerTask("prod", ["sass:prod"]);
};