Trouble Using the Closure Library in Node LTS with Webpack and the Closure Compiler JS.

Skip to first unread message

Jorge Davila

Mar 12, 2018, 11:30:39 AM3/12/18
to Closure Library Discuss
Hi all,

I'm currently trying to set up a project using the following tools: 

"devDependencies": {
"google-closure-compiler-js": "^20180204.0.0",
"webpack": "^4.1.1",
"webpack-cli": "^2.0.11",
"dependencies": {
"google-closure-library": "^20180204.0.0"

Additionally, I'm using NPM 5.6.0 and Node 8.10.0.

When I try running this example: ... the Webpack build hangs indefinitely. Looks like `require("google-closure-library");` causes it to hang.

Any idea of what's going on here? 

Also, if I remove this from webpack.config.js:

const ClosureCompiler = require('google-closure-compiler-js').webpack;
plugins: [
new ClosureCompiler({
options: {
languageIn: 'ECMASCRIPT6',
languageOut: 'ECMASCRIPT5',
compilationLevel: 'ADVANCED',
warningLevel: 'VERBOSE',

I get the following errors: 
ERROR in ./node_modules/google-closure-library/closure/goog/bootstrap/nodejs.js
Module not found: Error: Can't resolve 'fs'
ERROR in ./node_modules/google-closure-library/closure/goog/promise/testsuiteadapter.js
Module not found: Error: Can't resolve 'promises_aplus_tests

Are these the following two libraries meant to work together? and

Thank you in advance 
Reply all
Reply to author
0 new messages