24a2 icon indicating copy to clipboard operation
24a2 copied to clipboard

Add es6 module support

Open micahcantor opened this issue 4 years ago • 1 comments

This change allows 24a2 to be used as a node module. All this changes is exporting the public enums and interfaces in src/engine.ts. It also updates the package.json to specify that it is a module, and to point to the types and main files.

These are the same changes I made to 24a2 to use it on my own site, which uses Gatsby, so these changes should work. You can see an example of importing and using the 24a2 interfaces here.

#5

micahcantor avatar Nov 07 '20 07:11 micahcantor

Also, I did not add it in here because I wasn't exactly sure how it worked, but the Typescript build step should be automated in the package.json file, rather than done manually and committed to git. I believe you can just set the 'postinstall' script to 'tsc', which would automatically generate the build folder when the package is installed via npm, but I'm not exactly sure.

micahcantor avatar Nov 10 '20 20:11 micahcantor