3

I am trying to setup my google-closure-compiler to be able to read my files which uses Node core modules and I read online that I need the NodeJS externs... I downloaded a set of externs from: https://github.com/dcodeIO/node.js-closure-compiler-externs (which is like 2 years old??) and then in the compiler option I added the following in my gulpfile.js:

process_common_js_modules: true,
externs: '../node.js-closure-compiler-externs/fs.js',

When running gulp I get:

[19:38:07] gulp-google-closure-compiler: /src/js/myfile.js:3: ERROR - Failed to load module "fs"
const fs = require('fs');

What is really the right way to setup a JavaScript project that uses Node.js and have google-closure-compiler regconize things properly? Is there a step by step tutorial somewhere?

Chad Killingsworth
  • 14,360
  • 2
  • 34
  • 57
L. C
  • 33
  • 3
  • Possible duplicate of [How do you define node\_modules as externs in Closure Compiler?](http://stackoverflow.com/questions/30261330/how-do-you-define-node-modules-as-externs-in-closure-compiler) – Chad Killingsworth Aug 23 '16 at 11:35

0 Answers0