Skip to content

ApelegHQ/esbuild-plugin-closure-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ea1ff4e · Mar 24, 2025

History

11 Commits
Mar 24, 2025
Sep 11, 2024
Sep 11, 2024
Oct 28, 2023
Oct 28, 2023
Mar 23, 2025
Oct 28, 2023
Sep 11, 2024
Sep 11, 2024
Mar 24, 2025
Mar 23, 2025
Mar 24, 2025
Mar 24, 2025
Mar 24, 2025
Mar 24, 2025

Repository files navigation

esbuild plugin for post-compiling with Google Closure Compiler

Reliability Rating Vulnerabilities Bugs Security Rating Maintainability Rating NPM Downloads

How to use

Installing

npm i -D @apeleghq/esbuild-plugin-closure-compiler

Configuring esbuild

In the file you have your configuration, first import this plugin

const cc = require('@apeleghq/esbuild-plugin-closure-compiler');

Or using ES module syntax:

import cc from '@apeleghq/esbuild-plugin-closure-compiler';

Then, in your esbuild configuration, add cc() to the plugins list. cc optionally takes an object that is passed as options to Closure Compiler (for reference, refer to the documentation for Google Closure Compiler). Minimal example:

const esbuild = require('esbuild');
const cc = require('@apeleghq/esbuild-plugin-closure-compiler');

await esbuild
	.build({
		entryPoints: ['index.js'],
		outdir: 'build',
		bundle: true,
		format: 'cjs',
		plugins: [cc({ language_out: 'ECMASCRIPT_2018' })],
	});