antlr4ts
antlr4ts copied to clipboard
Use webpack to build browser-targeted distribution
Longstanding issue #311 seems best addressed using a the Webpack build tool.
This may break import
s with explicit paths! This is because Webpack packs all the code into a single (or small number) of downloadable bundles. This is a performance optimization, particularly for browser-based code. I'm still working on details, but by using output.libraryType = "umd"
it generates Universal Module Definition file which can be consumed both from node.js and from browsers. This seems to cover a lot of ground.
Additional notes:
- Information on using webpack for libraries at https://webpack.js.org/guides/author-libraries/
- Typescript integration: several options exist, initial attempt will use
ts-loader
- Use of umd for output.libraryType generates a single file which can be consumed both from node.js and from browsers.
Any progress on this?