Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Commit

Permalink
fix: locate compiler.jar using Node's regular mechanism.
Browse files Browse the repository at this point in the history
Newer npm versions change the installation location of node modules. Dependent
modules are not always installed into subfolders, in particular if there are
no version conflicts. That reduces file system usage, but also means this code
needs to be a bit more standard in how it locates the `compiler.jar`.
  • Loading branch information
mprobst committed Nov 4, 2015
1 parent 9be478c commit 6f90ace
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ spawn = require('child_process').spawn
path = require 'path'

JAVA_PATH = exports.JAVA_PATH = 'java'
JAR_PATH = exports.JAR_PATH = path.join __dirname, '../node_modules/google-closure-compiler/compiler.jar'
# Load `compiler.jar` using Node's regular lookup mechanism.
JAR_PATH = exports.JAR_PATH = require.resolve('google-closure-compiler/compiler.jar');
OPTIONS = exports.OPTIONS = {}

exports.compile = (input, options, callback) ->
Expand Down

0 comments on commit 6f90ace

Please sign in to comment.