新增库打包&修改文档

This commit is contained in:
wanglin2 2022-08-05 09:29:59 +08:00
parent 8bf23f8397
commit 0b11aff105
29 changed files with 41 additions and 18 deletions

View File

@ -20,25 +20,25 @@
## 目录介绍 ## 目录介绍
1.simple-mind-map 1.`simple-mind-map`
思维导图工具库。 思维导图工具库。
2.web 2.`web`
使用`simple-mind-map`工具库基于vue2.x、ElementUI搭建的在线思维导图。 使用`simple-mind-map`工具库,基于`vue2.x``ElementUI`搭建的在线思维导图。
3.dist 3.`dist`
打包后的资源文件夹。 打包后的资源文件夹。
4.docs 4.`docs`
文档等。 文档等。
## 开发 ## 开发
本地开发 ### 本地开发
```bash ```bash
git clone https://github.com/wanglin2/mind-map.git git clone https://github.com/wanglin2/mind-map.git
@ -52,7 +52,27 @@ npm link simple-mind-map
npm run serve npm run serve
``` ```
打包 ### 打包库
`0.2.0`版本开始增加了对核心库`simple-mind-map`的打包,复用了示例项目`web`的打包工具。
```bash
cd web
npm run buildLibrary
```
`simple-mind-map`库的`package.json`文件提供了两个导出字段:
```json
{
"module": "index.js",
"main": "./dist/simpleMindMap.umd.min.js",
}
```
支持`module`字段的环境会以`index.js`为入口,否则会以打包后的`simpleMindMap.umd.min.js`为入口。
### 打包demo
```bash ```bash
cd web cd web
@ -70,15 +90,17 @@ npm run build
npm i simple-mind-map npm i simple-mind-map
``` ```
注意本项目为源码直接发布并未进行打包如果出现编译失败的情况Vue CLI创建的项目可以在vue.config.js文件中增加如下配置来让babel-loader编译本依赖 `0.2.0`版本之前的注意事项
```js >注意本项目为源码直接发布并未进行打包如果出现编译失败的情况Vue CLI创建的项目可以在vue.config.js文件中增加如下配置来让babel-loader编译本依赖
module.exports = { >
transpileDependencies: ['simple-mind-map'] >```js
} >module.exports = {
``` > transpileDependencies: ['simple-mind-map']
>}
其他项目请自行修改打包配置。 >```
>
>其他项目请自行修改打包配置。
# API # API

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -18,8 +18,8 @@
"url": "https://github.com/wanglin2/mind-map" "url": "https://github.com/wanglin2/mind-map"
}, },
"scripts": {}, "scripts": {},
"main": "index.js", "module": "index.js",
"type": "module", "main": "./dist/simpleMindMap.umd.min.js",
"dependencies": { "dependencies": {
"@svgdotjs/svg.js": "^3.0.16", "@svgdotjs/svg.js": "^3.0.16",
"canvg": "^3.0.7", "canvg": "^3.0.7",

View File

@ -5,7 +5,8 @@
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build && node ../copy.js", "build": "vue-cli-service build && node ../copy.js",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint",
"buildLibrary": "vue-cli-service build --target lib --name simpleMindMap ../simple-mind-map/index.js --dest ../simple-mind-map/dist"
}, },
"dependencies": { "dependencies": {
"@toast-ui/editor": "^3.1.5", "@toast-ui/editor": "^3.1.5",