Closed chrstntdd closed 6 years ago
This is actually not an issue with this plugin. ADVANCED compilation with Google Closure Compiler requires you to use externs when referencing external JavaScript. E.g document
or any third party node_modules you are including. I recommend taking a look at the docs for ADVANCED compilation located here: https://developers.google.com/closure/compiler/docs/api-tutorial3
As @bansawbanchee pointed out you might want to add externs to your build. Closing it for now.
I just got around to using this plugin to shave off extra bytes from my
.js
output of an Elm project. I have installed Java 9 SKD as per the requirements as well as the google closure compiler from npm.This configuration:
produces these errors and won't compile my output
.js
file at all:However, if I switch the config up to use
compilation_level: 'SIMPLE'
, it will all bundle just fine.Going further, I tried flipping on the
jsCompiler
option withcompilation_level: ADVANCED
, which actually will compile, but when I load the output file in a web browser, I get this error in the console:which references this line:
Admittedly, the difference between
SIMPLE
andADVANCED
within the first configuration is 10k, but I'm at a loss for why I'm unable to use thecompilation_level: ADVANCED
, regardless of the compiler, beit Java or JavaScript.If anyone could shed some light on these errors, I would really appreciate it. Here is the full repo, if anyone needs it. Love this plugin regardless 👍