-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile_ruby_sass.js
101 lines (89 loc) · 2.41 KB
/
Gruntfile_ruby_sass.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
94
95
96
97
98
99
100
101
module.exports = function(grunt){
grunt.initConfig({
// Builds Sass
sass: {
dev: {
files: {
'public/stylesheets/application.css': 'app/assets/sass/application.scss',
'public/stylesheets/application-ie6.css': 'app/assets/sass/application-ie6.scss',
'public/stylesheets/application-ie7.css': 'app/assets/sass/application-ie7.scss',
'public/stylesheets/application-ie8.css': 'app/assets/sass/application-ie8.scss'
},
options: {
loadPath: [
'govuk_modules/govuk_template/assets/stylesheets',
'govuk_modules/govuk_frontend_toolkit/stylesheets'
],
style: 'expanded'
}
}
},
// Copies templates and assets from external modules and dirs
copy: {
govuk_template: {
cwd: 'node_modules/govuk_template_mustache/',
src: '**',
dest: 'govuk_modules/govuk_template/',
expand: true
},
govuk_frontend_toolkit: {
cwd: 'node_modules/govuk_frontend_toolkit/govuk_frontend_toolkit/',
src: '**',
dest: 'govuk_modules/govuk_frontend_toolkit/',
expand: true
}
},
// Watches styles and specs for changes
watch: {
css: {
files: ['app/assets/sass/**/*.scss'],
tasks: ['sass'],
options: { nospawn: true }
}
},
// nodemon watches for changes and restarts app
nodemon: {
dev: {
script: 'server.js',
options: {
ext: 'html, js',
ignore: ['node_modules/**']
}
}
},
concurrent: {
target: {
tasks: ['watch', 'nodemon'],
options: {
logConcurrentOutput: true
}
}
}
});
[
'grunt-contrib-copy',
'grunt-contrib-watch',
'grunt-contrib-sass',
'grunt-nodemon',
'grunt-concurrent'
].forEach(function (task) {
grunt.loadNpmTasks(task);
});
grunt.registerTask(
'convert_template',
'Converts the govuk_template to use mustache inheritance',
function () {
var script = require(__dirname + '/lib/template-conversion.js');
script.convert();
grunt.log.writeln('govuk_template converted');
}
);
grunt.registerTask('default', [
'copy:govuk_template',
'copy:govuk_frontend_toolkit',
'convert_template',
'copy:govuk_frontend_toolkit',
'sass',
'concurrent:target'
]);
};