I managed to get this to work with some help from the Webpack team. Using the following webpack configuration as recommended by the antlr4 documentation is no longer supported.
Does not work
{
node: {
fs: 'empty',
module: 'empty',
net: 'empty'
}
}
Working configuration
{
resolve: {
fallback: {
fs: false
}
}
}
With this, I was able to get my JavaScript parser working.
Please note that there is an ongoing effort to update antlr4 to generate ES6 based code. This configuration may not be necessary in the future.