From 2204e771b3acfe399680bdff99f6d8ed4141e913 Mon Sep 17 00:00:00 2001 From: Or Fleisher Date: Thu, 28 Oct 2021 13:22:18 -0400 Subject: [PATCH] Add ESM build to the R3F package and update package.json --- packages/r3f/devEnv/build.ts | 10 +++++----- packages/r3f/package.json | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/r3f/devEnv/build.ts b/packages/r3f/devEnv/build.ts index 540ad9b..fb429cf 100644 --- a/packages/r3f/devEnv/build.ts +++ b/packages/r3f/devEnv/build.ts @@ -67,11 +67,11 @@ function createBundles(watch: boolean) { {encoding: 'utf-8'}, ) - // build({ - // ...esbuildConfig, - // outfile: path.join(pathToPackage, 'dist/index.mjs'), - // format: 'esm', - // }) + build({ + ...esbuildConfig, + outfile: path.join(pathToPackage, 'dist/index.mjs'), + format: 'esm', + }) } createBundles(false) diff --git a/packages/r3f/package.json b/packages/r3f/package.json index 6937f2e..eb72cf9 100644 --- a/packages/r3f/package.json +++ b/packages/r3f/package.json @@ -20,6 +20,7 @@ "directory": "packages/r3f" }, "main": "dist/index.js", + "module": "dist/index.mjs", "types": "dist/index.d.ts", "sideEffects": false, "files": [