diff --git a/README.md b/README.md index 61b9b11..07bd7a3 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,15 @@ const Polygons = Kage.Polygons; const Buhin = Kage.Buhin; ``` +Bundled ESM file is also available: +```html + +``` + ### Drawing glyphs *See [docs](docs/classes/Kage.md) for more detailed API documentations (of development version).* diff --git a/rollup.config.mjs b/rollup.config.mjs index d9a8142..a352714 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -9,28 +9,46 @@ const banner = `/*! kage.js v${pkg.version} */`; /** @type {import("rollup").RollupOptions} */ -const options = { - input: "src/browser.ts", - output: [ - { - file: "dist/kage.js", - format: "iife", - name: "Kage", - exports: "default", - banner, - }, - { - file: "dist/kage.min.js", - format: "iife", - name: "Kage", - exports: "default", - banner, - plugins: [terser()], - }, - ], - plugins: [ - typescript({}), - ], -}; +const options = [ + { + input: "src/browser.ts", + output: [ + { + file: "dist/kage.js", + format: "iife", + name: "Kage", + exports: "default", + banner, + }, + { + file: "dist/kage.min.js", + format: "iife", + name: "Kage", + exports: "default", + banner, + plugins: [terser()], + }, + ], + plugins: [ + typescript({}), + ], + }, + { + input: "src/index.ts", + output: [ + { + file: "dist/kage.min.mjs", + format: "es", + banner, + plugins: [terser()], + }, + ], + plugins: [ + typescript({ + target: "es6", + }), + ], + }, +]; export default options;