mollenhauer

Форк
0
/
Gruntfile.cjs 
49 строк · 1.5 Кб
1
'use strict'
2

3
// Allows to require any ECMAScript module in this file
4
require('fix-esm').register()
5

6
const environment = require('./grunt/other/environment.js')
7
const isFontFilesConverted = require('./grunt/other/checkFontFilesConverted.js')
8
  .isFontFilesConverted()
9

10
require('./grunt/other/server.js')
11
  .server() // Starting the server
12
require('./grunt/other/fontsWriting.js')
13
  .fontsWriting() // Parsing fonts into the style file
14

15

16
module.exports = grunt => {
17
  // Load all grunt tasks matching the ['grunt-*', '@*/grunt-*'] patterns
18
  require('load-grunt-tasks')(grunt)
19
  grunt.loadTasks('./grunt/esbuild/tasks/')
20

21
  grunt.initConfig({
22
    ...require('./grunt/html/posthtml.js'),
23
    ...require('./grunt/css/postcss.js'),
24
    ...require('./grunt/css/minifier&formatter.js'),
25
    ...require('./grunt/scripts/compiler.js'),
26
    ...require('./grunt/images/sharp.js'),
27
    ...require('./grunt/html/formatter.js'),
28
    ...require('./grunt/other/ttf2woff2.js'),
29
    ...require('./grunt/other/newer.js'),
30
    ...require('./grunt/other/copy.js'),
31
    ...require('./grunt/other/watch.js'),
32
    ...require('./grunt/other/deleteDist.js'),
33
  })
34

35
  grunt.registerTask('default', [
36
    // Delete the dist folder if the --update-dist flag is set.
37
    environment.isDeleteDistBeforeLaunch && 'clean',
38
    'sharp',
39
    'posthtml',
40
    'newer:postcss',
41
    'newer:cssmin',
42
    'esbuild',
43
    !isFontFilesConverted && 'ttf2woff2',
44

45
    'newer:copy',
46
    environment.isProductionMode && 'prettify',
47
    'watch',
48
  ].filter(task => task))
49
}
50

51

52

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.