mathjax / MathJax-src

MathJax source code for version 3 and beyond

Home Page:https://www.mathjax.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Throw exception by using custom build at version 3.2.1

woody-li opened this issue · comments

I'm using a custom build from example at http://docs.mathjax.org/en/latest/web/webpack.html#a-custom-mathjax-build

It throw a exception after updated to version 3.2.1.

Uncaught ReferenceError: require is not defined.
At "node_modules/mathjax-full/js/components/version.js".

exports.VERSION = typeof PACKAGE_VERSION === 'undefined' ? function() {
  var load = eval('require');
  var dirname = eval('__dirname');
  var path = load('path');
  return load(path.resolve(dirname, '..', '..', 'package.json')).version;
}() : PACKAGE_VERSION;

Questions:

  1. Is there any using change for it?
  2. Why the code using "eval", some code quality tool treat it as a vulnerability issue.

Duplicate of #818

Can you add your use case & bundler to that thread too please?

Thanks and sorry.
There's some mistake in my config causes the exception.