From 75378fd54f65eed58c1e36cefc1877054756ad8b Mon Sep 17 00:00:00 2001 From: Lxxyx Date: Wed, 17 Mar 2021 20:05:58 +0800 Subject: [PATCH] build: use tsc output code in both cjs and esm formats (#127) * build: use tsdx * Move "module" field up to the rest * build: use tsc * Use yarn instead of npm Co-authored-by: Simon Knott --- package.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 3badaa1..8a1c34a 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", + "module": "dist/esm/index.js", "files": [ "dist", "src" @@ -11,10 +12,12 @@ "node": ">=10" }, "scripts": { - "build": "tsc", + "build": "yarn build:cjs && yarn build:esm", + "build:cjs": "tsc", + "build:esm": "tsc --module es2015 --outDir dist/esm", "test": "tsdx test --notify --verbose", "lint": "tsdx lint", - "prepack": "tsc", + "prepack": "yarn build", "prepare": "husky install" }, "importSort": { @@ -46,7 +49,6 @@ "url": "https://twitter.com/flybayer" } ], - "module": "dist/superjson.esm.js", "repository": { "type": "git", "url": "https://github.com/blitz-js/superjson"