tunnelvisionlabs / antlr4ts

Optimized TypeScript target for ANTLR 4
Other
637 stars 109 forks source link

Webpack 5 - AntlrTS in Browser #546

Open NicoLaval opened 1 year ago

NicoLaval commented 1 year ago

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?

voronovmaksim commented 1 year ago

I faced with the same issue. Is there WA?

NicoLaval commented 1 year ago

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.

1R053 commented 5 months ago

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