-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.cjs
51 lines (41 loc) · 1.49 KB
/
Gruntfile.cjs
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
'use strict'
// Allows to require any ECMAScript module in this file
require('fix-esm').register()
const environment = require('./grunt/other/environment.js')
const isFontFilesConverted = require('./grunt/other/checkFontFilesConverted.js')
.isFontFilesConverted()
require('./grunt/other/server.js')
.server() // Starting the server
require('./grunt/other/fontsWriting.js')
.fontsWriting() // Parsing fonts into the style file
module.exports = grunt => {
// Load all grunt tasks matching the ['grunt-*', '@*/grunt-*'] patterns
require('load-grunt-tasks')(grunt)
grunt.loadTasks('./grunt/esbuild/tasks/')
grunt.initConfig({
...require('./grunt/html/posthtml.js'),
...require('./grunt/css/postcss.js'),
...require('./grunt/css/minifier&formatter.js'),
...require('./grunt/scripts/compiler.js'),
...require('./grunt/images/sharp.js'),
...require('./grunt/html/formatter.js'),
...require('./grunt/other/ttf2woff2.js'),
...require('./grunt/other/newer.js'),
...require('./grunt/other/copy.js'),
...require('./grunt/other/watch.js'),
...require('./grunt/other/deleteDist.js'),
})
grunt.registerTask('default', [
// Delete the dist folder if the --update-dist flag is set.
environment.isDeleteDistBeforeLaunch && 'clean',
'sharp',
'posthtml',
'newer:postcss',
'newer:cssmin',
'esbuild',
!isFontFilesConverted && 'ttf2woff2',
'newer:copy',
environment.isProductionMode && 'prettify',
'watch',
].filter(task => task))
}