antlr4ts icon indicating copy to clipboard operation
antlr4ts copied to clipboard

Use webpack to build browser-targeted distribution

Open BurtHarris opened this issue 7 years ago • 1 comments

Longstanding issue #311 seems best addressed using a the Webpack build tool.

This may break imports 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.

BurtHarris avatar Dec 15 '17 00:12 BurtHarris

Any progress on this?

harry-kalligeros avatar Jan 07 '19 17:01 harry-kalligeros