This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Gruntfile.js
70 lines (59 loc) · 1.91 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
/* eslint-env node */
/* eslint-disable object-shorthand */
'use strict';
module.exports = function (grunt) {
// Find all of the task which start with `grunt-` and load them, rather than explicitly declaring them all
require('matchdep').filterDev(['grunt-*', '!grunt-cli']).forEach(grunt.loadNpmTasks);
grunt.initConfig({
clean: {
built: {
src: ['dist/**']
},
dependencies: {
src: ['node_modules/**']
},
tmp: {
src: ['tmp/**']
}
},
watch: {
csscomb: {
files: ['app/styles/**/*.css'],
tasks: ['shell:csscombfix']
}
},
shell: {
'npm-install': {
command: 'yarn install'
},
ember: {
command: function (mode) {
let liveReloadBaseUrl = grunt.option('live-reload-base-url') || '/ghost/';
switch (mode) {
case 'prod':
return 'npm run build -- --environment=production --silent';
case 'dev':
return 'npm run build';
case 'watch':
return `npm run start -- --live-reload-base-url=${liveReloadBaseUrl} --live-reload-port=4201`;
}
}
},
csscombfix: {
command: 'csscomb -c app/styles/csscomb.json -v app/styles'
},
csscomblint: {
command: 'csscomb -c app/styles/csscomb.json -lv app/styles'
},
test: {
command: 'npm test'
},
options: {
preferLocal: true
}
}
});
grunt.registerTask('init', 'Install the admin dependencies',
['shell:npm-install']
);
};