I am trying to use google compiler as an alternative for webpack. I am currently using the following files to compile all the files inside my folder:
java -jar closure-compiler.jar --process_common_js_modules --js_output_file=static/out.js 'lib/js/src/frontend/*.js'"
The problem in one of these files requires React and ReactDOM. I get the following error:
lib/js/src/frontend/app.js:7: ERROR - Failed to load module "react"
var React = require("react");
^^^^^^^^^^^^^^^^
lib/js/src/frontend/app.js:8: ERROR - Failed to load module "react-dom"
var ReactDom = require("react-dom");
^^^^^^^^^^^^^^^^^^^^
How do I make sure that the Google Closure compiler looks inside node_modules to find the appropriate third-party modules?
source
share