From 659188f84c3316856aaa9266036e645d5ff31e41 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sun, 8 Sep 2024 13:44:11 -0700 Subject: [PATCH] Fix `Task "pug" not found` error in production mode Fixes https://github.com/gruntjs/gruntjs.com/issues/221. Ref https://github.com/jquery/infrastructure/issues/529. --- Gruntfile.js | 21 ++++++++++++++++++--- package.json | 3 +-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 642b141c..88bafede 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -200,9 +200,24 @@ module.exports = function(grunt) { }); grunt.loadTasks('tasks'); // getWiki, docs tasks - require('matchdep') - .filterAll(['grunt-*', '!grunt-docs']) - .forEach(grunt.loadNpmTasks); + + grunt.loadNpmTasks('grunt-autoprefixer'); + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-less'); + grunt.loadNpmTasks('grunt-contrib-pug'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-sitemap'); + + if (process.env.NODE_ENV !== 'production') { + grunt.loadNpmTasks('grunt-concurrent'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-html'); + grunt.loadNpmTasks('grunt-nodemon'); + grunt.loadNpmTasks('grunt-open'); + grunt.loadNpmTasks('grunt-puglint'); + } grunt.registerTask('build', 'Build the site', [ 'copy', diff --git a/package.json b/package.json index 90148d69..2764e286 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "grunt-contrib-clean": "~1.1.0", "grunt-contrib-copy": "~1.0.0", "grunt-contrib-less": "~2.0.0", + "grunt-contrib-pug": "^2.0.0", "grunt-contrib-uglify": "~4.0.0", "grunt-docs": "https://github.com/gruntjs/grunt-docs.git#d224f17ae21fe606b5b7eca73155a31f4e341930", "grunt-sitemap": "~1.2.1", @@ -38,7 +39,6 @@ "less-plugin-clean-css": "~1.5.1", "lodash": "~4.17.10", "marked": "https://github.com/vladikoff/marked/tarball/032a72231503b63e15e76b990a914becf664b0d7", - "matchdep": "~2.0.0", "method-override": "~3.0.0", "node-schedule": "~1.3.0", "pug": "~2.0.3", @@ -47,7 +47,6 @@ "devDependencies": { "grunt-concurrent": "~2.3.1", "grunt-contrib-jshint": "~1.1.0", - "grunt-contrib-pug": "^2.0.0", "grunt-contrib-watch": "~1.1.0", "grunt-html": "~9.3.0", "grunt-nodemon": "~0.4.2",