From 6ef286d370f2036f6680aa3388d994803062291c Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 27 Nov 2021 18:52:47 +0800 Subject: [PATCH] feat: add exports field and use bundled output by default (#9952) --- packages/vant/package.json | 23 +++++++++++++++++------ pnpm-lock.yaml | 4 +++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/packages/vant/package.json b/packages/vant/package.json index dbc1ef692..de43982d6 100644 --- a/packages/vant/package.json +++ b/packages/vant/package.json @@ -2,10 +2,22 @@ "name": "vant", "version": "3.3.1", "description": "Mobile UI Components built on Vue", - "main": "lib/index.js", - "module": "es/index.js", + "main": "lib/vant.cjs.js", + "module": "lib/vant.es.js", "style": "lib/index.css", "typings": "lib/index.d.ts", + "unpkg": "lib/vant.min.js", + "jsdelivr": "lib/vant.min.js", + "exports": { + ".": { + "import": "./lib/vant.es.js", + "require": "./lib/vant.cjs.js", + "types": "./lib/index.d.ts" + }, + "./es/*": "./es/*", + "./lib/*": "./lib/*", + "./package.json": "./package.json" + }, "files": [ "es", "lib", @@ -54,6 +66,7 @@ "devDependencies": { "@vant/area-data": "^1.1.3", "@vant/cli": "workspace:*", + "@vant/eslint-config": "workspace:*", "@vue/compiler-sfc": "^3.2.20", "@vue/runtime-core": "^3.2.20", "@vue/test-utils": "^2.0.0-rc.16", @@ -67,11 +80,9 @@ "*.css", "*.less" ], + "web-types": "vetur/web-types.json", "vetur": { "tags": "vetur/tags.json", "attributes": "vetur/attributes.json" - }, - "web-types": "vetur/web-types.json", - "unpkg": "lib/vant.min.js", - "jsdelivr": "lib/vant.min.js" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d156baa8e..942e8f483 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,6 +51,7 @@ importers: specifiers: '@vant/area-data': ^1.1.3 '@vant/cli': workspace:* + '@vant/eslint-config': workspace:* '@vant/icons': ^1.7.1 '@vant/popperjs': ^1.1.0 '@vant/use': ^1.3.4 @@ -67,6 +68,7 @@ importers: devDependencies: '@vant/area-data': link:../vant-area-data '@vant/cli': link:../vant-cli + '@vant/eslint-config': link:../vant-eslint-config '@vue/compiler-sfc': 3.2.21 '@vue/runtime-core': 3.2.21 '@vue/test-utils': 2.0.0-rc.16_vue@3.2.21 @@ -6312,7 +6314,7 @@ packages: mime-db: 1.50.0 /mime/1.6.0: - resolution: {integrity: sha1-Ms2eXGRVO9WNGaVor0Uqz/BJgbE=, tarball: mime/download/mime-1.6.0.tgz} + resolution: {integrity: sha1-Ms2eXGRVO9WNGaVor0Uqz/BJgbE=, tarball: mime/download/mime-1.6.0.tgz?cache=0&sync_timestamp=1636738461596&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fmime%2Fdownload%2Fmime-1.6.0.tgz} engines: {node: '>=4'} hasBin: true requiresBuild: true