From d3f2a659af88d63236411dd49931ffffde598812 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Tue, 2 Apr 2024 18:38:13 +0200 Subject: [PATCH] Add ES output to rollup configuration --- CHANGELOG.md | 2 ++ package.json | 1 + rollup.config.mjs | 15 +++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cb0c3f4..12aa4a8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ### Next +- Fix #755: export EcmaScript modules in dist/es/. Thanks @DamienCassou + ### 2.4.0 - Update a ton of dependencies. Thanks @BenjaminVanRyseghem diff --git a/package.json b/package.json index 88a84101..2f52786c 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "percentage" ], "main": "./dist/numbro.min.js", + "browser": "./dist/es/numbro.js", "typings": "./numbro.d.ts", "engines": { "node": "*" diff --git a/rollup.config.mjs b/rollup.config.mjs index c1b1af31..e1215b59 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -55,6 +55,11 @@ export default async () => { plugins: [terser()], name: "numbro" }, + { + file: path.resolve(outputFolder, "es", "numbro.js"), + format: "es", + name: "numbro" + }, ], plugins, }, @@ -72,6 +77,11 @@ export default async () => { plugins: [terser()], name: `numbro.${baseName}` }, + { + file: path.resolve(outputFolder, "es", "languages", `${baseName}.js`), + format: "es", + name: `numbro.${baseName}` + }, ], plugins, }; @@ -86,6 +96,11 @@ export default async () => { plugins: [terser()], name: `numbro.allLanguages` }, + { + file: path.resolve(outputFolder, "es", "languages.js"), + format: "es", + name: `numbro.allLanguages` + }, ], plugins, }