{"id":27037,"library":"gulp-closure-compiler","title":"gulp-closure-compiler","description":"Gulp plugin for Google Closure Compiler that integrates the Closure Compiler Java-based minification and optimization into Gulp build pipelines. Version 0.4.0 (latest) is a stable release with no active development since 2016. It provides SIMPLE and ADVANCED optimization modes, supports custom compiler flags, tiered compilation, and maxBuffer configuration. Unlike alternatives like gulp-google-closure-compiler, this plugin requires a local compiler.jar and does not use the npm-based compiler distribution.","status":"abandoned","version":"0.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/steida/gulp-closure-compiler","tags":["javascript","closure","compiler","compress","google","gulpplugin","minify"],"install":[{"cmd":"npm install gulp-closure-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-closure-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-closure-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for Gulp plugin","package":"gulp","optional":false}],"imports":[{"note":"Default export: use default import or require(). No named export.","wrong":"const { closureCompiler } = require('gulp-closure-compiler')","symbol":"closureCompiler","correct":"import closureCompiler from 'gulp-closure-compiler'"},{"note":"CommonJS: require returns the function directly. No named import.","wrong":"import { closureCompiler } from 'gulp-closure-compiler'","symbol":"default (function)","correct":"const closureCompiler = require('gulp-closure-compiler')"},{"note":"No TypeScript types included. Use any or install @types/gulp-closure-compiler from DefinitelyTyped (may be outdated).","wrong":"import * as closureCompiler from 'gulp-closure-compiler'","symbol":"Type (none)","correct":"// No types provided; use @types/gulp-closure-compiler if needed"}],"quickstart":{"code":"var gulp = require('gulp');\nvar closureCompiler = require('gulp-closure-compiler');\n\ngulp.task('default', function() {\n  return gulp.src('src/*.js')\n    .pipe(closureCompiler({\n      compilerPath: 'path/to/compiler.jar',\n      fileName: 'build.js'\n    }))\n    .pipe(gulp.dest('dist'));\n});","lang":"javascript","description":"Basic Gulp task using SIMPLE optimization with a local closure-compiler.jar."},"warnings":[{"fix":"Download compiler.jar from https://dl.google.com/closure-compiler/compiler-latest.zip and set compilerPath.","message":"compilerPath must point to a local compiler.jar file. The package does not download or bundle the compiler.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Provide externs for external APIs and set closure_entry_point as the main entry.","message":"ADVANCED_OPTIMIZATIONS requires proper externs and closure_entry_point, otherwise code may be incorrectly removed.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Migrate to gulp-google-closure-compiler or use the official npm closure-compiler package.","message":"The package is no longer maintained. Consider using gulp-google-closure-compiler or closure-compiler-npm directly.","severity":"deprecated","affected_versions":">=0.4.0"},{"fix":"Set maxBuffer option to a higher value in kilobytes.","message":"maxBuffer default is 1000kb (in code). If output exceeds this, you get 'maxBuffer exceeded' error.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Ensure JDK is installed and set tieredCompilation: true only if needed.","message":"Tiered compilation requires JDK 1.7+ and may cause issues on some systems.","severity":"gotcha","affected_versions":">=0.3.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install Java JRE/JDK and ensure 'java' command is available.","cause":"Java is not installed or not in PATH.","error":"Error: spawn java ENOENT"},{"fix":"Pass maxBuffer option: maxBuffer: 2000 for 2MB.","cause":"Closure Compiler output exceeds default buffer size (1000kb).","error":"maxBuffer exceeded"},{"fix":"Run 'npm install gulp --save-dev'.","cause":"gulp is not installed as a peer dependency.","error":"Cannot find module 'gulp'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}