Skip to content

Commit

Permalink
package
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave-12138 committed Sep 4, 2024
1 parent 51f7a00 commit 831800b
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 90 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
简单的vue3瀑布流组件,通过vue调整元素样式而非直接进行dom操作以获得最好的兼容性。

## 安装
我没传 npm ,理论上我会打个包放到 github release 里,如果没有那就下载或 git clone 这个仓库然后自己 `npm i``npm run build` 吧。

```cmd
npm i vue-waterfall-mini
```

## 使用例

Expand Down
3 changes: 3 additions & 0 deletions index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict'

module.exports = require('./dist/vue-waterfall-mini.cjs.js')
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Waterfall } from "./dist/vue-waterfall-mini.esm"
23 changes: 21 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
{
"name": "vue-waterfall-mini",
"version": "1.0.0",
"version": "1.0.2",
"author": {
"name": "Dave_12138",
"email": "[email protected]",
"url": "https://dave-12138.cn"
},
"private": true,
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/Dave-12138/vue-waterfall-mini"
},
"files": [
"dist",
"index.js",
"index.cjs"
],
"exports": {
".": {
"import": "./index.js",
"require": "./index.cjs"
},
"./style": "./dist/style.css",
"./style.css": "./dist/style.css"
},
"main": "index.cjs",
"module": "index.js",
"types": "dist/types/index.d.ts",
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
Expand Down
20 changes: 0 additions & 20 deletions pages/assets/index-BGTuES4Z.js

This file was deleted.

1 change: 0 additions & 1 deletion pages/assets/index-DzkyS5Ok.css

This file was deleted.

14 changes: 0 additions & 14 deletions pages/index.html

This file was deleted.

3 changes: 1 addition & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<script setup lang="ts">
import { defineAsyncComponent, reactive, } from 'vue';
import { reactive, } from 'vue';
import { Waterfall } from './main';
import BSInput from './components/BSInput.vue';
import { json } from 'stream/consumers';
const c = Array.from<string>("0123456789ABCDEF")
const d = () => c[(c.length * Math.random()) | 0]
const _createItem = () => ({ id: crypto.randomUUID(), h: 3 + (Math.random() * 30) | 0, c: '#' + d() + d() + d() });
Expand Down
17 changes: 0 additions & 17 deletions tsconfig.app.json

This file was deleted.

31 changes: 22 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
{
"files": [],
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "./tsconfig.app.json"
}
]
"include": ["env.d.ts", "src/**/main.ts", "src/**/Waterfall.vue"],
"exclude": ["src/components/BSInput.vue","src/App.vue"],
"compilerOptions": {
"types": ["vitest/importMeta"],
"baseUrl": ".",
"declaration": true,
"outDir": "dist",
"module": "ESNext",
"target": "es2016",
"lib": ["DOM", "ESNext"],
"strict": true,
"esModuleInterop": true,
"incremental": false,
"skipLibCheck": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"noUnusedLocals": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"declarationDir": "dist/types",
"emitDeclarationOnly": true
}
}
19 changes: 0 additions & 19 deletions tsconfig.node.json

This file was deleted.

9 changes: 4 additions & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ import { fileURLToPath, URL } from 'node:url'

import { BuildOptions, defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const target = process.env.TARGET;
const build: BuildOptions = {
target: "modules",
lib: {
formats: ['es'],
formats: ['es', 'cjs'],
entry: "./src/main.ts",
name: "vue-waterfall-mini",
fileName: () => 'vue-waterfall-mini.esm.js'
fileName: (t) => `vue-waterfall-mini.${t === 'es' ? 'esm' : t}.js`
},
rollupOptions: {
external: ['vue']
external: ['vue'],
}
}
if (target !== 'lib') {
if (process.env.TARGET !== 'lib') {
build.lib = false;
build.outDir = 'pages';
build.rollupOptions = void 0;
Expand Down

0 comments on commit 831800b

Please sign in to comment.