This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix for google-closure-compiler. fixes #156
- Loading branch information
1 parent
2965678
commit 3ffa4fc
Showing
4 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
pkg: { | ||
assets: [ | ||
'compiler.jar' | ||
], | ||
patches: { | ||
'lib/node/closure-compiler.js': [ | ||
'require.resolve(\'../../compiler.jar\')', | ||
'require(\'path\').join(require(\'path\').dirname(process.execPath), \'compiler.jar\')' | ||
] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
test/test-79-npm/google-closure-compiler/google-closure-compiler.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
|
||
var fs = require('fs'); | ||
var path = require('path'); | ||
|
||
var Compiler = require('google-closure-compiler').compiler; | ||
var packagePath = path.dirname(require.resolve('google-closure-compiler')); | ||
var jarPath = path.join(packagePath, 'compiler.jar'); | ||
|
||
if (process.pkg) { | ||
fs.writeFileSync(Compiler.JAR_PATH, fs.readFileSync(jarPath)); | ||
fs.unlinkSync(Compiler.JAR_PATH); | ||
} | ||
|
||
console.log('ok'); | ||
|
||
// TODO try to avoid storing assets here and in drive list | ||
// figure out another way of referring to process.execPath directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "private": true } |