From 607e6e2be4228e5c8aecbe5d9335a447c2e726ac Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 22 May 2022 20:10:14 +0800 Subject: [PATCH] feat: using mjs extension for esmodule (#10625) --- packages/vant/package.json | 18 +----------------- packages/vant/vant.config.mjs | 3 +++ 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/packages/vant/package.json b/packages/vant/package.json index ca612ebd2..1358b9c6f 100644 --- a/packages/vant/package.json +++ b/packages/vant/package.json @@ -3,27 +3,11 @@ "version": "3.4.9", "description": "Mobile UI Components built on Vue", "main": "lib/vant.cjs.js", - "module": "es/index.js", + "module": "es/index.mjs", "style": "lib/index.css", "typings": "lib/index.d.ts", "unpkg": "lib/vant.min.js", "jsdelivr": "lib/vant.min.js", - "exports": { - ".": { - "node": { - "import": "./lib/ssr.mjs", - "require": "./lib/ssr.js" - }, - "import": "./es/index.js", - "require": "./lib/vant.cjs.js", - "types": "./lib/index.d.ts" - }, - "./es": "./es/index.js", - "./lib": "./lib/vant.cjs.js", - "./es/": "./es/", - "./lib/": "./lib/", - "./package.json": "./package.json" - }, "files": [ "es", "lib", diff --git a/packages/vant/vant.config.mjs b/packages/vant/vant.config.mjs index 86e34d454..7e4ec2e88 100644 --- a/packages/vant/vant.config.mjs +++ b/packages/vant/vant.config.mjs @@ -5,6 +5,9 @@ export default { namedExport: true, skipInstall: ['lazyload'], packageManager: 'pnpm', + extensions: { + esm: '.mjs' + }, site: { publicPath: (typeof window === 'undefined' && process.env.PUBLIC_PATH) || '/vant/',