vite-plugins-spire-officejs-spire1
v1.0.1
Published
该插件是一个作用于officejs的服务与打包插件。
Readme
vite-plugins-spire-officejs
该插件是一个作用于officejs的服务与打包插件。
安装
npm install vite-plugins-spire-officejs --save使用方式
// vite.config.js
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
// 默认参数
export default defineConfig({
plugins: [
vue(),
officejsPlugin()
],
})
// 带参数
export default defineConfig({
plugins: [
vue(),
officejsPlugin({
name: 'vite-plugin-spire-officejs',
port: 3001,
mappings: [
{
package: '@spireofficejs/document', // npm包名称
path: '/', // 包内的资源路径
route: '/document' // 对外服务的URL路径前缀
}, {
package: '@spireofficejs/spreadsheet',
path: '/',
route: '/spreadsheet'
}, {
package: '@spireofficejs/presentation',
path: '/',
route: '/presentation'
}, {
package: '@spireofficejs/pdf',
path: '/',
route: '/pdf'
}
]
})
],
})参数
| 属性 | 说明 | 类型 | 默认 |
| -------- | ----------- | ------------- | ------------------------------ |
| mappings | package映射 | Array | 详见 |
| port | 服务端口 | number | 3001 |
| name | 服务名称 | string | 'vite-plugin-spire-officejs' |
mappings属性
| 属性 | 说明 | 类型 | 默认 |
| ------- | -------------- | -------- | ---- |
| package | 需要映射的包名 | String | —— |
| path |
