{"id":25672,"library":"grunt-esbuild","title":"grunt-esbuild","description":"Grunt plugin to run esbuild builds. Version 1.0.0+ actively maintained. Configuration is passed directly to esbuild's build function, which must be provided via options.buildFunction. Unlike other Grunt bundler plugins, it does not wrap esbuild's API, giving full access to esbuild options. Requires Node.js and a compatible Grunt >=1. Releases are irregular; no known breaking changes yet.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/coqsenpate/grunt-esbuild","tags":["javascript","grunt","esbuild"],"install":[{"cmd":"npm install grunt-esbuild","lang":"bash","label":"npm"},{"cmd":"yarn add grunt-esbuild","lang":"bash","label":"yarn"},{"cmd":"pnpm add grunt-esbuild","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: requires Grunt >=1 as task runner","package":"grunt","optional":false},{"reason":"Peer dependency: must be installed separately and passed via options.buildFunction","package":"esbuild","optional":false}],"imports":[{"note":"This is a Grunt plugin, not a Node module. It should be loaded via grunt.loadNpmTasks or a task loader like load-grunt-tasks.","wrong":"const esbuild = require('grunt-esbuild')","symbol":"grunt-esbuild","correct":"grunt.loadNpmTasks('grunt-esbuild') or use load-grunt-tasks"},{"note":"esbuild must be required and its .build method passed explicitly. Do not pass the entire esbuild object.","wrong":"options: { buildFunction: esbuild.build } (if esbuild is not required correctly)","symbol":"buildFunction","correct":"options: { buildFunction: require('esbuild').build }"},{"note":"entryPoints should be an array of strings, not a single string.","wrong":"grunt.initConfig({ esbuild: { dist: { entryPoints: 'src/main.js' } } }) (string instead of array)","symbol":"task config","correct":"grunt.initConfig({ esbuild: { dist: { entryPoints: ['src/main.js'], bundle: true } } })"}],"quickstart":{"code":"// Gruntfile.js\nmodule.exports = function(grunt) {\n  require('load-grunt-tasks')(grunt);\n\n  grunt.initConfig({\n    esbuild: {\n      options: {\n        buildFunction: require('esbuild').build\n      },\n      dist: {\n        entryPoints: ['src/main.js'],\n        bundle: true,\n        outfile: 'dist/main.js',\n      }\n    }\n  });\n\n  grunt.registerTask('default', ['esbuild']);\n};","lang":"javascript","description":"Configure Grunt to run esbuild with a single bundle target."},"warnings":[{"fix":"Set options.buildFunction to require('esbuild').build in your Gruntfile.","message":"buildFunction is required: you must pass require('esbuild').build in options.","severity":"gotcha","affected_versions":">=0"},{"fix":"Use entryPoints: ['src/main.js'] instead of entryPoints: 'src/main.js'.","message":"Entry points must be an array, even for a single file.","severity":"gotcha","affected_versions":">=0"},{"fix":"Use a separate watch task (e.g., grunt-contrib-watch) to trigger rebuilds.","message":"The plugin does not support esbuild's watch mode or incremental builds.","severity":"gotcha","affected_versions":">=0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add grunt.loadNpmTasks('grunt-esbuild') or use load-grunt-tasks in Gruntfile.","cause":"grunt-esbuild not loaded correctly.","error":"Warning: Task \"esbuild\" not found."},{"fix":"Set options.buildFunction = require('esbuild').build in grunt.initConfig.","cause":"buildFunction not set or set incorrectly.","error":"TypeError: options.buildFunction is not a function"},{"fix":"Change entryPoints: 'src/main.js' to entryPoints: ['src/main.js'].","cause":"entryPoints is a string instead of an array.","error":"Error: Invalid entry point. Must be an array of strings."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}