-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulp.config.js
89 lines (81 loc) · 2.4 KB
/
gulp.config.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
import packagefile from './package.json' assert {type: "json"};
try {
var configFile = await import('./config.json', { assert: { type: "json" } });
} catch (ex) {
configFile = {
"default":{
"dest": "./build"
}
};
}
var destinationFolder = (configFile.default.dest) + '/' + packagefile.name;
const buildConfig = {
general: {
dest: configFile.default.dest,
package: packagefile,
},
sources: {
sourceFolder: './src',
allJsFiles: {
front: './src/static/js/**/*.js',
admin: './src/static/js/admin/**/*.js',
},
allScssFiles: {
front: './src/static/sass/main-files/**/*.scss',
admin: './src/static/sass_admin/admin-style.scss',
principalCSSFiles: './src/static/sass/style.scss'
},
allImgFiles: './src/static/images/**/*.{png,jpg,gif,svg}',
allLibFiles: [
//ChartJS
'./node_modules/chart.js/dist/chart.js',
'./node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.min.js',
//HTML2Canvas
'./node_modules/html2canvas/dist/html2canvas.min.js',
],
vendorScripts: [
'./vendor/**/*'
],
scaffolding: [
'src/**/*',
'!src/static/sass/**',
'!src/static/sass_admin/**',
'!src/static/js/**',
'!src/admin/js/**',
'!src/static/images/**'
],
version: 'src/static/sass/variables-site/_version.scss',
banner: [
'/*!',
'Theme Name: ' + packagefile.name,
'Description:' + packagefile.description,
'Author: ' + packagefile.author,
'Version: ' + packagefile.version,
'Tags: ' + (packagefile.keywords).join(' '),
'Requires at least: 5.9.0',
'Template: hello-elementor',
'*/',
''
],
email: './src/views/email/*',
iconFont: './src/static/images/font-icons/*.svg',
},
destination: {
destFolder: destinationFolder,
allJsFiles: {
front: destinationFolder + '/static/js/',
admin: destinationFolder + '/static/js/admin/',
},
allScssFiles: {
front: destinationFolder + '/static/css/',
admin: destinationFolder + '/static/css/',
},
allImgFiles: destinationFolder + '/static/images/',
allLibFiles: destinationFolder + '/static/lib/',
email: destinationFolder + '/views/email/',
iconFont: destinationFolder + '/static/lib/fonts/',
vendorScripts: destinationFolder + '/theme/vendor/',
buildPackage: 'dist',
}
};
export default buildConfig;