This repository was archived by the owner on Oct 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
52 lines (49 loc) · 1.27 KB
/
gulpfile.js
File metadata and controls
52 lines (49 loc) · 1.27 KB
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
const gulpStatic = require('gulp-static-gen');
const data = require('./src/languages');
const DEFAULT_LANG = 'pt-br';
const templateInfo = lang => ({
data: Object.assign({}, data[lang], {
languages: {
'pt-br': '/',
'es': '/es',
'en': '/en'
}
}),
input: './src/templates/index.hbs',
output: {
dir: './dist',
name: `${DEFAULT_LANG === lang ? "" : lang}/index.html`,
}
});
gulpStatic({
css: {
input: './src/sass/index.sass',
output: './dist/assets/css',
watch: './src/sass/**/*',
},
hbs: {
batch : ['./src/templates/partials'],
helpers: require('./src/templates/helpers'),
watch : './src/templates/**/*',
multiple: Object.keys(data).map(templateInfo)
},
img: {
input: './src/images/**/*',
output: './dist/assets/images',
config: {
interlaced: true,
progressive: true,
optimizationLevel: 5,
svgoPlugins: [{removeViewBox: true}]
}
},
scripts: {
input: './src/scripts/index.js',
output: './dist/assets/scripts/',
watch: './src/scripts/**/*',
},
move: [{
input: './src/static/*',
output: './dist'
}]
});