antlr4ts icon indicating copy to clipboard operation
antlr4ts copied to clipboard

Webpack 5 - AntlrTS in Browser

Open NicoLaval opened this issue 1 year ago • 3 comments

Since webpack release to v5, some required lib for browser running are missing:

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
        - install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "util": false }

Is it possible to add util, assert and process to the antlr4ts bundle?

NicoLaval avatar Sep 12 '23 06:09 NicoLaval

I faced with the same issue. Is there WA?

voronovmaksim avatar Sep 26 '23 07:09 voronovmaksim

At this point, I added react-app-rewired to my React app to override Webpack config adding these packages, but I don't find it very nice.

NicoLaval avatar Sep 26 '23 07:09 NicoLaval

see #549 - not sure though if this is caused be the antlr runtime itself

1R053 avatar May 17 '24 13:05 1R053