houwenjian 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +23 -0
- package/src/components/RichEditor.vue +11 -0
- package/src/components/coloreditor.vue +14 -0
- package/src/index.js +15 -0
- package/vite.config.js +23 -0
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "houwenjian",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"main": "vite.config.js",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"csstype": "^3.2.3",
|
|
7
|
+
"entities": "^7.0.0",
|
|
8
|
+
"estree-walker": "^2.0.2",
|
|
9
|
+
"magic-string": "^0.30.21",
|
|
10
|
+
"nanoid": "^3.3.11",
|
|
11
|
+
"picocolors": "^1.1.1",
|
|
12
|
+
"postcss": "^8.5.6",
|
|
13
|
+
"source-map-js": "^1.2.1",
|
|
14
|
+
"vue": "^3.5.26"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
19
|
+
},
|
|
20
|
+
"author": "",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"description": ""
|
|
23
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import RichEditor from './components/RichEditor.vue';
|
|
2
|
+
|
|
3
|
+
// 定义插件安装方法(Vue3标准方式)
|
|
4
|
+
export default {
|
|
5
|
+
install(app) {
|
|
6
|
+
// 注册全局组件
|
|
7
|
+
app.component('RichEditor', RichEditor);
|
|
8
|
+
|
|
9
|
+
// 可选:暴露其他功能(如指令、服务等)
|
|
10
|
+
// app.config.globalProperties.$editor = ...;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// 兼容直接导入组件(按需引入)
|
|
15
|
+
export { RichEditor };
|
package/vite.config.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import vue from '@vitejs/plugin-vue';
|
|
3
|
+
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
build: {
|
|
7
|
+
lib: {
|
|
8
|
+
entry: './src/index.js', // 入口文件
|
|
9
|
+
name: 'RichEditor', // 全局变量名(UMD模式)
|
|
10
|
+
fileName: (format) => `richeditor.${format}.js`,
|
|
11
|
+
},
|
|
12
|
+
rollupOptions: {
|
|
13
|
+
external: ['vue'], // 将vue作为peerDependency
|
|
14
|
+
plugins: [peerDepsExternal()],
|
|
15
|
+
output: {
|
|
16
|
+
globals: {
|
|
17
|
+
vue: 'Vue' // UMD模式下映射vue到全局变量
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
plugins: [vue()]
|
|
23
|
+
});
|