forked from SnowdogApps/magento2-frontools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·40 lines (37 loc) · 1.28 KB
/
gulpfile.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
'use strict';
// Plugins / Functions / Modules
const gulp = require('gulp'),
plugins = require('gulp-load-plugins')({
pattern: ['*', '!gulp', '!gulp-load-plugins'],
rename : {
'browser-sync' : 'browserSync',
'fs-extra' : 'fs',
'marked-terminal' : 'markedTerminal',
'postcss-reporter': 'reporter',
'run-sequence' : 'runSequence',
'js-yaml' : 'yaml'
}
}),
config = {
'projectPath': plugins.fs.realpathSync('../../../') + '/'
};
plugins.errorMessage = require('./helper/error-message')(plugins);
plugins.getThemes = require('./helper/get-themes')(plugins, config);
config.themes = require('./helper/config-loader')('themes.json', plugins, config, false);
// Tasks loading
require('gulp-task-loader')({
dir : 'task',
plugins: plugins,
configs: config
});
// Define task for each theme, locale, lang, processing type etc.
// Gulp can't run same task in parallel, so we need different names
Object.keys(config.themes).forEach(name => {
const theme = config.themes[name];
theme.locale.forEach(locale => {
gulp.task(
theme.lang + ':' + name + ':' + locale,
require('./helper/' + theme.lang)(gulp, plugins, config, name, locale)
);
});
});