mollenhauer
/
Gruntfile.cjs
49 строк · 1.5 Кб
1'use strict'
2
3// Allows to require any ECMAScript module in this file
4require('fix-esm').register()5
6const environment = require('./grunt/other/environment.js')7const isFontFilesConverted = require('./grunt/other/checkFontFilesConverted.js')8.isFontFilesConverted()9
10require('./grunt/other/server.js')11.server() // Starting the server12require('./grunt/other/fontsWriting.js')13.fontsWriting() // Parsing fonts into the style file14
15
16module.exports = grunt => {17// Load all grunt tasks matching the ['grunt-*', '@*/grunt-*'] patterns18require('load-grunt-tasks')(grunt)19grunt.loadTasks('./grunt/esbuild/tasks/')20
21grunt.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
35grunt.registerTask('default', [36// Delete the dist folder if the --update-dist flag is set.37environment.isDeleteDistBeforeLaunch && 'clean',38'sharp',39'posthtml',40'newer:postcss',41'newer:cssmin',42'esbuild',43!isFontFilesConverted && 'ttf2woff2',44
45'newer:copy',46environment.isProductionMode && 'prettify',47'watch',48].filter(task => task))49}
50
51
52