This PR adds module bundling using Rollup. It enables the engine to be used as a dependency in other projects and removes rest of the old-style script tag imports. Additional features can be easily added using Rollup plugins if needed. For example, the bundle size can be reduced using a minifier such as Terser.
Executing npm run build builds the library bundle to dist/ while npm run dev builds the development bundle to public/. Running Lätkäzombit from the project now requires executing the latter and accessing the files in public/ instead of the root directory.
These changes now make it possible to publish the project as a dependency as well!
This PR adds module bundling using Rollup. It enables the engine to be used as a dependency in other projects and removes rest of the old-style script tag imports. Additional features can be easily added using Rollup plugins if needed. For example, the bundle size can be reduced using a minifier such as Terser.
Executing
npm run build
builds the library bundle todist/
whilenpm run dev
builds the development bundle topublic/
. Running Lätkäzombit from the project now requires executing the latter and accessing the files inpublic/
instead of the root directory.These changes now make it possible to publish the project as a dependency as well!