unplugin-dingtalk
v0.5.0
Published
[![NPM version](https://img.shields.io/npm/v/unplugin-dingtalk?color=a1b858&label=)](https://www.npmjs.com/package/unplugin-dingtalk)
Downloads
13
Maintainers
Readme
unplugin-dingtalk
一键启动钉钉内调试。支持 vite
、vue-cli
、rebuild
。
功能
- [x] 在钉钉内打开调试链接
- [x] 可选注入 vConsole 用于调试 (仅支持 vite )
- [x] 可选注入 chii 用于调试
- [x] 可选打开 vue-devtools 用于调试
- [x] 支持调试
HttpOnly
cookies
安装
npm i unplugin-dingtalk --save-dev
interface Options {
enable?: boolean
targetUrl?: string
corpId?: string
debug?: boolean
/**
* only support vite
*
* @link https://github.com/vadxq/vite-plugin-vconsole#vitevconsole-options
*/
vconsole?: viteVConsoleOptions
/** 需要调试的 cookies, 避免无法调试 HttpOnly 的 cookie */
debugCookies?: string[]
/** 默认值 `true` */
chii?: boolean
vueDevtools?: {
enable?: boolean
host?: string
port?: number
}
}
// vite.config.ts
import UnpluginDingtalk from 'unplugin-dingtalk/vite';
export default defineConfig({
plugins: [
UnpluginDingtalk({
enable: true,
}),
],
});
// vue.config.js
const [setupMiddlewares, unpluginDingtalk] = require('unplugin-dingtalk/webpack').default({
enable: true,
});
/**
* @type {import('@vue/cli-service').ProjectOptions}
*/
module.exports = {
devServer: {
setupMiddlewares,
},
configureWebpack: {
plugins: [
unpluginDingtalk,
],
},
};
// rsbuild.config.js
import { defineConfig } from '@rsbuild/core';
import createUnpluginDingtalk from 'unplugin-dingtalk/rspack';
const [setupMiddlewares, unpluginDingtalk] = createUnpluginDingtalk({
enable: true,
});
export default defineConfig({
dev: {
setupMiddlewares: [
setupMiddlewares,
],
},
tools: {
rspack: {
plugins: [
unpluginDingtalk,
],
},
},
});