Add ESM build to the R3F package and update package.json

This commit is contained in:
Or Fleisher 2021-10-28 13:22:18 -04:00 committed by Aria
parent 0171fb88af
commit 2204e771b3
2 changed files with 6 additions and 5 deletions

View file

@ -67,11 +67,11 @@ function createBundles(watch: boolean) {
{encoding: 'utf-8'}, {encoding: 'utf-8'},
) )
// build({ build({
// ...esbuildConfig, ...esbuildConfig,
// outfile: path.join(pathToPackage, 'dist/index.mjs'), outfile: path.join(pathToPackage, 'dist/index.mjs'),
// format: 'esm', format: 'esm',
// }) })
} }
createBundles(false) createBundles(false)

View file

@ -20,6 +20,7 @@
"directory": "packages/r3f" "directory": "packages/r3f"
}, },
"main": "dist/index.js", "main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"sideEffects": false, "sideEffects": false,
"files": [ "files": [