From 4f2fcbb8e7316532c1584d608fb1d8df2b7affa6 Mon Sep 17 00:00:00 2001 From: Robert Reinhard Date: Mon, 9 Sep 2024 14:53:35 -0700 Subject: [PATCH] Switch to es6 exports --- packages/contentful/package.json | 1 + packages/next/package.json | 1 + packages/react/package.json | 1 + packages/sanity-next/package.json | 1 + tsconfig.build.json | 8 ++++++-- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/contentful/package.json b/packages/contentful/package.json index 28164ef..3dab0b7 100644 --- a/packages/contentful/package.json +++ b/packages/contentful/package.json @@ -4,6 +4,7 @@ "description": "Image and video renderer for Contentful assets.", "author": "Bukwild ", "license": "MIT", + "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ diff --git a/packages/next/package.json b/packages/next/package.json index 0920d53..722b0e2 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -4,6 +4,7 @@ "description": "Image and video renderer for Next.js projects", "author": "Bukwild ", "license": "MIT", + "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ diff --git a/packages/react/package.json b/packages/react/package.json index b52784b..2fe794a 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -4,6 +4,7 @@ "description": "Image and video renderer for React projects", "author": "Bukwild ", "license": "MIT", + "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ diff --git a/packages/sanity-next/package.json b/packages/sanity-next/package.json index bfaf0e4..1036963 100644 --- a/packages/sanity-next/package.json +++ b/packages/sanity-next/package.json @@ -4,6 +4,7 @@ "description": "Image and video renderer for Sanity + Next.js projects", "author": "Bukwild ", "license": "MIT", + "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ diff --git a/tsconfig.build.json b/tsconfig.build.json index 52ae6ce..4e8ec67 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "target": "es5", - "module": "commonjs", + "target": "ESNext", + "module": "ESNext", "declaration": true, "outDir": "./dist", "strict": true, @@ -10,6 +10,10 @@ // Required for importing packages, like React, that have `export =` "esModuleInterop": true, + // Recommendations for greater interoperability + "allowSyntheticDefaultImports": true, + "moduleResolution": "node", + // Fixes build failures when dependent types have errors, like: // node_modules/next/dist/shared/lib/get-img-props.d.ts:70 "skipLibCheck": true,