forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
111 lines (98 loc) · 2.83 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**
* @copyright Copyright (c) 2015 X.commerce, Inc. (http://www.magentocommerce.com)
*/
// For performance use one level down: 'name/{,*/}*.js'
// If you want to recursively match all subfolders, use: 'name/**/*.js'
module.exports = function (grunt) {
'use strict';
var _ = require('underscore'),
path = require('path');
require('./dev/tools/grunt/tasks/mage-minify')(grunt);
require('time-grunt')(grunt);
require('load-grunt-config')(grunt, {
configPath: path.join(process.cwd(), 'dev/tools/grunt/configs'),
init: true,
loadGruntTasks: {
pattern: [
'grunt-*',
'!grunt-template-jasmine-requirejs'
]
}
});
_.each({
/**
* Assembling tasks.
* ToDo UI: define default tasks.
*/
default: function () {
grunt.log.subhead('I\'m default task and at the moment I\'m empty, sorry :/');
},
/**
* Production preparation task.
*/
prod: function (component) {
if (component === 'setup') {
grunt.task.run([
'less:' + component,
'autoprefixer:' + component,
'cssmin:' + component,
'usebanner:' + component
]);
}
if (typeof component === 'undefined') {
grunt.log.subhead('Tip: Please make sure that u specify prod subtask. By default prod task do nothing');
}
},
/**
* Refresh magento frontend & backend.
*/
refresh: [
'exec:all',
'less:blank',
'less:luma',
'less:backend'
],
/**
* Styles for backend theme
*/
backend: [
'less:backend',
'replace:escapeCalc',
'less:override'
],
/**
* Documentation
*/
documentation: [
'less:documentation',
'styledocco:documentation',
'clean:var',
'clean:pub'
],
spec: [
'specRunner:lib',
'specRunner:backend',
'specRunner:frontend'
],
unit: [
'jasmine:lib-unit',
'jasmine:backend-unit',
'jasmine:frontend-unit'
],
integration: [
'jasmine:lib-integration',
'jasmine:backend-integration',
'jasmine:frontend-integration'
],
'legacy-build': [
'mage-minify:legacy'
],
'documentation-banners': [
'usebanner:documentationCss',
'usebanner:documentationLess',
'usebanner:documentationHtml'
]
}, function (task, name) {
grunt.registerTask(name, task);
});
};