Skip to content
Snippets Groups Projects
Commit f0f252ae authored by Bogdan Plieshka's avatar Bogdan Plieshka
Browse files

MAGETWO-37091: [UI] Intagrate JIT(Just In Time) plugin loader for Grunt.js

- Added JIT
- Updated Grunt Banner plugin, merged Banner tasks
- Optimized Grunt prod task
parent 4f25bddc
No related merge requests found
......@@ -23,17 +23,17 @@ module.exports = function (grunt) {
require('load-grunt-config')(grunt, {
configPath: path.join(__dirname, configDir),
init: true,
loadGruntTasks: {
pattern: [
'grunt-*'
]
jitGrunt: {
staticMappings: {
usebanner: 'grunt-banner'
}
}
});
_.each({
/**
* Assembling tasks.
* ToDo UI: define default tasks.
* ToDo: define default tasks.
*/
default: function () {
grunt.log.subhead('I\'m default task and at the moment I\'m empty, sorry :/');
......@@ -43,17 +43,19 @@ module.exports = function (grunt) {
* Production preparation task.
*/
prod: function (component) {
if (component === 'setup') {
grunt.task.run([
'less:' + component,
'autoprefixer:' + component,
'cssmin:' + component,
'usebanner:' + component
]);
}
var tasks = [
'less',
'autoprefixer',
'cssmin',
'usebanner'
].map(function(task){
return task + ':' + component;
});
if (typeof component === 'undefined') {
grunt.log.subhead('Tip: Please make sure that u specify prod subtask. By default prod task do nothing');
} else {
grunt.task.run(tasks);
}
},
......
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
'use strict';
module.exports = {
firstLine: 'Copyright © <%= grunt.template.today("yyyy") %> Magento. All rights reserved.',
secondLine: 'See COPYING.txt for license details.',
css: function () {
return '/**\n * ' + this.firstLine + '\n * ' + this.secondLine + '\n */\n';
},
less: function () {
return '// /**\n// * ' + this.firstLine + '\n// * ' + this.secondLine + '\n// */\n';
},
html: function () {
return '<!--\n/**\n * ' + this.firstLine + '\n * ' + this.secondLine + '\n */\n-->\n';
}
};
......@@ -5,7 +5,22 @@
'use strict';
var banner = require('./banner');
var banner = {
firstLine: 'Copyright © <%= grunt.template.today("yyyy") %> Magento. All rights reserved.',
secondLine: 'See COPYING.txt for license details.',
css: function () {
return '/**\n * ' + this.firstLine + '\n * ' + this.secondLine + '\n */\n';
},
less: function () {
return '// /**\n// * ' + this.firstLine + '\n// * ' + this.secondLine + '\n// */\n';
},
html: function () {
return '<!--\n/**\n * ' + this.firstLine + '\n * ' + this.secondLine + '\n */\n-->\n';
}
};
module.exports = {
options: {
......
......@@ -2,7 +2,7 @@
"name": "Magento2",
"author": "Magento, an eBay Inc. company",
"description": "Magento2 node modules dependencies for local development",
"version": "0.42.0-beta1",
"version": "0.74.0-beta7",
"repository": {
"type": "git",
"url": "https://github.com/magento/magento2.git"
......@@ -11,7 +11,7 @@
"devDependencies": {
"grunt": "^0.4.5",
"grunt-autoprefixer": "^2.0.0",
"grunt-banner": "^0.3.1",
"grunt-banner": "^0.4.0",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-connect": "^0.9.0",
"grunt-contrib-cssmin": "^0.10.0",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment