Registry / devops / uber-compiler

uber-compiler

JSON →
library0.4.7jsnpmunverified

Compiles client-side JS and CSS using Google Closure Compiler, Closure Templates, and LESS. Version 0.4.7 runs on Node.js >= 0.4.1. It watches files for changes, caches compiled output, and supports custom warnings/compile modes. Unlike standalone build tools, it integrates directly into a Node.js server and auto-recompiles on file changes. Maintenance appears stalled with no recent updates.

npm install uber-compiler
INSTALL
IMPORT
SIG · UBER-COMPILER
U
uber-compiler
devopsjavascriptv0.4.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import uberCompiler from 'uber-compiler';
✗ const uberCompiler = require('uber-compiler');
The package exports a factory function directly; ESM import as default works, but CommonJS require also works.
uberCompiler function
✓ import uberCompiler from 'uber-compiler'; const compiler = uberCompiler(options);
✗ const { uberCompiler } = require('uber-compiler');
The package exports a single function; named destructuring fails.
getJsFilename
✓ import uberCompiler from 'uber-compiler'; const compiler = uberCompiler(options); const jsFile = compiler.getJsFilename();
✗ import { getJsFilename } from 'uber-compiler';
Methods are available on the compiler instance, not exported directly from the package.

Creates an uber-compiler instance with JS and CSS paths, then compiles and watches for changes.

const path = require('path'); const uberCompiler = require('uber-compiler'); const rootPath = process.cwd(); const options = { jsPaths: [ path.join(rootPath, 'public/js/lib/jquery-1.7.2.js'), path.join(rootPath, 'public/js/lib/underscore.js'), path.join(rootPath, 'public/js/lib/backbone.js'), path.join(rootPath, 'public/js/init.js'), path.join(rootPath, 'public/js/model/'), path.join(rootPath, 'public/js/view/'), path.join(rootPath, 'public/js/router/'), path.join(rootPath, 'public/js/main.js') ], cssPaths: [ path.join(rootPath, 'public/css') ], outputDir: path.join(rootPath, 'public/cached'), debug: false }; const compiler = uberCompiler(options); compiler.run();
Debug
Known issues
gotchaThe jsPaths and cssPaths arrays must contain absolute paths. Relative paths cause 'Path must be absolute' errors.
fix
Use path.join with process.cwd() or __dirname to create absolute paths.
affects: >=0.0.0
gotchaDependency google-closure-compiler is a large binary and must be installed globally (npm i -g google-closure-compiler) before using uber-compiler.
fix
Install google-closure-compiler globally: npm i -g google-closure-compiler
affects: >=0.0.0
deprecatedThis package is no longer actively maintained. The last release was in 2012. Alternatives like webpack or gulp are recommended.
fix
Migrate to modern build tools such as webpack, gulp, or rollup.
affects: >=0.0.0
gotchaThe 'endCallback' option is called after compilation completes but is not passed any arguments, making error handling difficult.
fix
Use process.on('uncaughtException') or wrap run() in try/catch for error handling.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Path must be absolute: relative/path/to/js
Providing relative paths in jsPaths or cssPaths.
fix
Use absolute paths by prefixing with path.join(__dirname, ...) or path.resolve().
Error: Cannot find module 'google-closure-compiler'
Missing google-closure-compiler dependency, which must be installed globally.
fix
Run: npm i -g google-closure-compiler
ReferenceError: require is not defined
Attempting to use CommonJS require in an ESM module file.
fix
Use import uberCompiler from 'uber-compiler'; instead, or rename file to .cjs.
Upgrade
Version history
0.4.7latest on npm
Audit
Dependencies
google-closure-compilerrequiredRequired for JS compilation via Google Closure Compiler.
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
uber-compiler — npm install uber-compiler · libregistry