From 1a07e812164e12da83e6bd90d652aa91a27e0eb1 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 17 Feb 2023 11:03:08 -0500 Subject: [PATCH] Fix package file generation --- scripts/build.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/build.js b/scripts/build.js index 62d09d84..c29760c3 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -114,6 +114,12 @@ async function buildIcons(package, style, format) { async function buildExports(styles) { let pkg = {} + // To appease Vite's optimizeDeps feature which requires a root-level import + pkg[`.`] = { + import: `./index.esm.js`, + require: `./index.js`, + } + // For those that want to read the version from package.json pkg[`./package.json`] = { "default": "./package.json" }