From cafd50c9cdae873cb44f1e92114823b983bbdecf Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Mon, 30 Nov 2020 20:30:40 +0800 Subject: [PATCH] chore(Lazyload): improve dist --- .gitignore | 1 - packages/vant-lazyload/README.md | 14 ++++++++++++++ packages/vant-lazyload/package.json | 14 ++++++-------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index af3ff5837..3aaecddc0 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ package-lock.json # dist file es -esm lib dist /site diff --git a/packages/vant-lazyload/README.md b/packages/vant-lazyload/README.md index a20be96e5..ac29c7b79 100644 --- a/packages/vant-lazyload/README.md +++ b/packages/vant-lazyload/README.md @@ -10,4 +10,18 @@ yarn add @vant/lazyload ## Usage +```js +import { createApp } from 'vue'; +import { LazyLoad } from '@vant/lazyload'; + +const app = createApp(); +app.use(LazyLoad); +``` + +## API + see: https://github.com/hilongjw/vue-lazyload + +## TODO + +support TypeScript. diff --git a/packages/vant-lazyload/package.json b/packages/vant-lazyload/package.json index fcd84494d..7683cc31c 100644 --- a/packages/vant-lazyload/package.json +++ b/packages/vant-lazyload/package.json @@ -2,21 +2,19 @@ "name": "@vant/lazyload", "version": "1.0.0", "description": "", - "main": "lib/index.js", - "module": "esm/index.js", - "types": "lib/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/index.d.ts", "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" }, "files": [ - "es", - "lib", - "types" + "dist" ], "scripts": { - "dev": "babel src --out-dir esm --watch", - "build": "babel src --out-dir esm && BABEL_MODULE=commonjs babel src --out-dir lib", + "dev": "babel src --out-dir dist/esm --watch", + "build": "babel src --out-dir dist/esm && BABEL_MODULE=commonjs babel src --out-dir dist/cjs", "release": "npm run build && release-it" }, "license": "MIT",