highlight.js: Webpack error with autoit.js: Maximum call stack size exceeded

I’m not sure if this is a highlight.js problem or webpack, but when webpack attempts to bundle highlight.js version 8.7, it chokes on autoit.js:

ERROR in ../~/highlight.js/lib/languages/autoit.js
Module build failed: Maximum call stack size exceeded
 @ ../~/highlight.js/lib/index.js 12:32-61

Had to pin to ~8.6.0 to get around this. Using node 0.10.25.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 21 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I resolved it in webpack config file by adding to module.noParse option new RegExp, e.g. like this:

{
    //...other config options
    module: {
       noParse: [/autoit.js/],
       //...other config options
    },
}

I looked more closely into AutoIt and found out it is simply too big anyway. I reduced the list based on the official docs of the languages which reduced the size of the whole library by about 20% and as a side effect fixed this issue.