Hi, I was trying to use uglifyjs programmatically but got this error. Anyone know how can i solve it?
Please provide a reproducible test case to illustrate your issue - there is nothing actionable with the current level of information.
I'm building a react app and using webpack to bundle it.
This line
var UglifyJS = require("uglify-js");
causes the following:
Uncaught Error: Cannot find module '../lib/utils.js'.
at eval (eval at
at Function.webpackContextResolve [as resolve] (eval at
at eval (eval at
at Array.map (native)
at eval (eval at
at Object.
at s (http://localhost:3000/static/bundle.js:1:5619)
at c (http://localhost:3000/static/bundle.js:1:1165)
at eval (eval at
at Object.
Sounds like a webpack issue - please file a report with them instead.
My understanding is that they are pulling out and rearranging files from uglify-js, and something breaks along the way.
Got it. Thanks!
Got it. Thanks!
How to do it
What is the reason?How to deal with it
I think it's the problem of uglifyJs, the require grammar can't be static analyzed by webpack.
Most helpful comment
What is the reason?How to deal with it