chore: merge @vant/lazyload into main package

This commit is contained in:
chenjiahan
2021-11-10 17:00:02 +08:00
parent b456459249
commit 2bfbe5f86e
17 changed files with 12 additions and 122 deletions

View File

@@ -1 +0,0 @@
lib

View File

@@ -1,27 +0,0 @@
# @vant/lazyload
This is a fork of [vue-lazyload](https://github.com/hilongjw/vue-lazyload) with Vue 3 support.
## Install
```shell
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.

View File

@@ -1,3 +0,0 @@
module.exports = {
presets: [['@vant/cli/preset.cjs', { loose: true }]],
};

View File

@@ -1,42 +0,0 @@
{
"name": "@vant/lazyload",
"version": "1.4.0",
"description": "This is a fork of vue-lazyload",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "types/index.d.ts",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"files": [
"dist",
"types"
],
"scripts": {
"dev": "rollup --config rollup.config.js --watch",
"build": "rollup --config rollup.config.js",
"release": "pnpm build && release-it",
"prepare": "pnpm build"
},
"license": "MIT",
"repository": "https://github.com/youzan/vant/tree/dev/packages/vant-lazyload",
"dependencies": {
"@vant/use": "^1.3.2"
},
"devDependencies": {
"vue": "3.x",
"@vue/runtime-core": "3.x",
"@vant/cli": "workspace:*",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-node-resolve": "^10.0.0",
"release-it": "^14.2.2",
"rollup": "^2.33.3"
},
"release-it": {
"git": {
"tag": false,
"commitMessage": "release: @vant/lazyload ${version}"
}
}
}

View File

@@ -1,22 +0,0 @@
import path from 'path';
import babel from '@rollup/plugin-babel';
import nodeResolve from '@rollup/plugin-node-resolve';
export default {
input: path.join(__dirname, 'src', 'index.js'),
output: [
{
dir: 'dist/cjs',
format: 'cjs',
},
{
dir: 'dist/esm',
format: 'esm',
},
],
external: ['vue', '@vant/use'],
plugins: [
babel({ babelHelpers: 'bundled', extensions: ['.js', '.ts'] }),
nodeResolve(),
],
};

View File

@@ -45,7 +45,6 @@
"license": "MIT",
"dependencies": {
"@vant/icons": "^1.7.1",
"@vant/lazyload": "^1.4.0",
"@vant/popperjs": "^1.1.0",
"@vant/use": "^1.3.2"
},

View File

@@ -1,4 +1,4 @@
import { Lazyload } from '@vant/lazyload';
import { Lazyload } from './vue-lazyload';
export default Lazyload;
export { Lazyload };

View File

@@ -1,4 +1,4 @@
import { App } from 'vue';
import type { App } from 'vue';
declare type ListenEvent =
| 'scroll'

View File

@@ -1,3 +1,7 @@
/**
* This is a fork of [vue-lazyload](https://github.com/hilongjw/vue-lazyload) with Vue 3 support.
*/
import Lazy from './lazy';
import LazyComponent from './lazy-component';
import LazyContainer from './lazy-container';

View File

@@ -6,5 +6,10 @@
"emitDeclarationOnly": true
},
"include": ["es/**/*", "lib/**/*"],
"exclude": ["node_modules", "**/test/**/*", "**/demo/**/*"]
"exclude": [
"node_modules",
"**/test/**/*",
"**/demo/**/*",
"**/vue-lazyload/*"
]
}