From 36f538148ccfbcbfc836076f2138612f05fbb2a5 Mon Sep 17 00:00:00 2001 From: Michael White Date: Mon, 27 Jun 2022 17:07:42 -0400 Subject: [PATCH] Updated options required for pure ESM packages Followed this guide: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c --- package.json | 6 +++++- tsconfig.json | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8b70f59188..99f2a3f770 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "description": "Create web application with the t3 stack", "author": "Shoubhit Dash ", "license": "MIT", - "main": "./dist/index.js", "repository": { "type": "git", "url": "https://github.com/nexxeln/create-t3-app.git" @@ -18,9 +17,14 @@ "tRPC", "typescript" ], + "type": "module", + "exports": "./dist/index.js", "bin": { "create-t3-app": "./dist/index.js" }, + "engines": { + "node": ">=14.16" + }, "scripts": { "build": "tsup src/index.ts --clean --sourcemap --minify --metafile", "dev": "tsup src/index.ts --watch --clean --onSuccess \"node dist/index.js\"", diff --git a/tsconfig.json b/tsconfig.json index b0b45801f4..eb27cd944e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,8 +4,8 @@ /* LANGUAGE COMPILATION OPTIONS */ "target": "ES6", "lib": ["DOM", "ES6", "ESNext"], - "module": "commonjs", - "moduleResolution": "Node", + "module": "Node16", + "moduleResolution": "Node16", "resolveJsonModule": true, /* EMIT RULES */