From 8b33b9882e3c0981e04ee3cd1edd7a9d774612e7 Mon Sep 17 00:00:00 2001 From: EGOIST <0x142857@gmail.com> Date: Wed, 13 Mar 2019 20:16:26 +0800 Subject: [PATCH] fix(build): use .module.js instead of .mjs for esm bundle (#332) --- bili.config.ts | 3 +++ package.json | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bili.config.ts b/bili.config.ts index 7f7ca8b2..a7015f46 100644 --- a/bili.config.ts +++ b/bili.config.ts @@ -18,6 +18,9 @@ const config: Config = { if (format === "umd") { config.output.minify = true } + if (format === "esm") { + config.output.fileName = "[name].module.js" + } return config } } diff --git a/package.json b/package.json index 9dfcdc8c..1e95a79b 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "description": "Create your next immutable state by mutating the current one", "main": "dist/immer.js", "umd:main": "dist/immer.umd.js", - "module": "dist/immer.mjs", - "jsnext:main": "dist/immer.mjs", - "react-native": "dist/immer.mjs", + "module": "dist/immer.module.js", + "jsnext:main": "dist/immer.module.js", + "react-native": "dist/immer.module.js", "types": "./dist/immer.d.ts", "scripts": { "watch": "jest --watch",