vitepress-plugin-codepen 0.1.0
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/LICENSE +21 -0
- package/README.md +111 -0
- package/dist/client/browser/index.d.ts +23 -0
- package/dist/client/browser/index.js +57 -0
- package/dist/client/ssr/index.d.ts +23 -0
- package/dist/client/ssr/index.js +64 -0
- package/dist/node/index.d.ts +33 -0
- package/dist/node/index.js +62 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 pengzhanbo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# vitepress-plugin-codepen
|
|
2
|
+
|
|
3
|
+
Embed CodePen in your VitePress site.
|
|
4
|
+
|
|
5
|
+
在 VitePress 中嵌入 CodePen。
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
### With Vitepress-tuck
|
|
10
|
+
|
|
11
|
+
**Installation:**
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# npm
|
|
15
|
+
npm install -D vitepress-tuck vitepress-plugin-codepen
|
|
16
|
+
# pnpm
|
|
17
|
+
pnpm add -D vitepress-tuck vitepress-plugin-codepen
|
|
18
|
+
# yarn
|
|
19
|
+
yarn add -D vitepress-tuck vitepress-plugin-codepen
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Configuration:**
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
// .vitepress/config.ts
|
|
26
|
+
import codepen from 'vitepress-plugin-codepen'
|
|
27
|
+
import { defineConfig } from 'vitepress-tuck'
|
|
28
|
+
|
|
29
|
+
export default defineConfig({
|
|
30
|
+
plugins: [codepen()],
|
|
31
|
+
})
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
// .vitepress/theme/index.ts
|
|
36
|
+
import type { Theme } from 'vitepress'
|
|
37
|
+
import enhanceApp from 'virtual:enhance-app'
|
|
38
|
+
import DefaultTheme from 'vitepress/theme'
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
extends: DefaultTheme,
|
|
42
|
+
enhanceApp(ctx) {
|
|
43
|
+
enhanceApp(ctx)
|
|
44
|
+
},
|
|
45
|
+
} satisfies Theme
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### With Vitepress
|
|
49
|
+
|
|
50
|
+
**Installation:**
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# npm
|
|
54
|
+
npm install -D vitepress-plugin-codepen
|
|
55
|
+
# pnpm
|
|
56
|
+
pnpm add -D vitepress-plugin-codepen
|
|
57
|
+
# yarn
|
|
58
|
+
yarn add -D vitepress-plugin-codepen
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Configuration:**
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
// .vitepress/config.ts
|
|
65
|
+
import { defineConfig } from 'vitepress'
|
|
66
|
+
import { codepenMarkdownPlugin } from 'vitepress-plugin-codepen'
|
|
67
|
+
|
|
68
|
+
export default defineConfig({
|
|
69
|
+
markdown: {
|
|
70
|
+
config: (md) => {
|
|
71
|
+
md.use(codepenMarkdownPlugin)
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
})
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
// .vitepress/theme/index.ts
|
|
79
|
+
import type { Theme } from 'vitepress'
|
|
80
|
+
import { enhanceAppWithCodepen } from 'vitepress-plugin-codepen/client'
|
|
81
|
+
import DefaultTheme from 'vitepress/theme'
|
|
82
|
+
|
|
83
|
+
export default {
|
|
84
|
+
extends: DefaultTheme,
|
|
85
|
+
enhanceApp(ctx) {
|
|
86
|
+
enhanceAppWithCodepen(ctx)
|
|
87
|
+
},
|
|
88
|
+
} satisfies Theme
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Syntax
|
|
92
|
+
|
|
93
|
+
```md
|
|
94
|
+
@[codepen](user/slash)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### With Options
|
|
98
|
+
|
|
99
|
+
```md
|
|
100
|
+
@[codepen preview editable title="My Demo" height="500px" tab="css,result" theme="dark"](user/slash)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
| Option | Type | Default | Description |
|
|
104
|
+
| ---------- | ------------------- | ------------ | --------------------------------------- |
|
|
105
|
+
| `preview` | `boolean` | `false` | Use preview embed mode |
|
|
106
|
+
| `editable` | `boolean` | `false` | Allow editing |
|
|
107
|
+
| `tab` | `string` | `"result"` | Default tab (e.g. `"css,result"`) |
|
|
108
|
+
| `theme` | `'light' \| 'dark'` | auto | Theme, auto follows VitePress dark mode |
|
|
109
|
+
| `width` | `string` | `"100%"` | iframe width |
|
|
110
|
+
| `height` | `string` | `"400px"` | iframe height |
|
|
111
|
+
| `title` | `string` | `"Code Pen"` | iframe title |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EnhanceAppContext } from "vitepress/client";
|
|
2
|
+
|
|
3
|
+
//#region src/client/VPCodepen.vue.d.ts
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
user: string;
|
|
6
|
+
slash: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
preview?: boolean;
|
|
9
|
+
editable?: boolean;
|
|
10
|
+
tab?: string;
|
|
11
|
+
theme?: 'light' | 'dark';
|
|
12
|
+
width?: string;
|
|
13
|
+
height?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/client/index.d.ts
|
|
19
|
+
declare function enhanceAppWithCodepen({
|
|
20
|
+
app
|
|
21
|
+
}: EnhanceAppContext): void;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { _default as VPCodepen, enhanceAppWithCodepen };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { computed, createElementBlock, defineComponent, normalizeStyle, openBlock } from "vue";
|
|
2
|
+
import { useData } from "vitepress/client";
|
|
3
|
+
//#region src/client/VPCodepen.vue
|
|
4
|
+
const _hoisted_1 = ["src", "title"];
|
|
5
|
+
const CODEPEN_LINK = "https://codepen.io/";
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "VPCodepen",
|
|
8
|
+
props: {
|
|
9
|
+
user: {},
|
|
10
|
+
slash: {},
|
|
11
|
+
title: {},
|
|
12
|
+
preview: { type: Boolean },
|
|
13
|
+
editable: { type: Boolean },
|
|
14
|
+
tab: {},
|
|
15
|
+
theme: {},
|
|
16
|
+
width: {},
|
|
17
|
+
height: {}
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const { isDark } = useData();
|
|
21
|
+
const link = computed(() => {
|
|
22
|
+
const middle = __props.preview ? "/embed/preview/" : "/embed/";
|
|
23
|
+
const params = new URLSearchParams();
|
|
24
|
+
__props.editable && params.set("editable", "true");
|
|
25
|
+
__props.tab && params.set("default-tab", __props.tab);
|
|
26
|
+
const themeMode = __props.theme ?? (isDark.value ? "dark" : "light");
|
|
27
|
+
themeMode && params.set("theme-id", themeMode);
|
|
28
|
+
return `${CODEPEN_LINK}${__props.user}${middle}${__props.slash}?${params.toString()}`;
|
|
29
|
+
});
|
|
30
|
+
return (_ctx, _cache) => {
|
|
31
|
+
return openBlock(), createElementBlock("iframe", {
|
|
32
|
+
src: link.value,
|
|
33
|
+
class: "vp-codepen",
|
|
34
|
+
title: __props.title,
|
|
35
|
+
frameborder: "0",
|
|
36
|
+
loading: "lazy",
|
|
37
|
+
allowtransparency: "true",
|
|
38
|
+
allowfullscreen: "true",
|
|
39
|
+
style: normalizeStyle({
|
|
40
|
+
width: __props.width,
|
|
41
|
+
height: __props.height,
|
|
42
|
+
marginBlock: "16px",
|
|
43
|
+
marginInline: "0",
|
|
44
|
+
border: "none",
|
|
45
|
+
boxShadow: "var(--vp-shadow-2)"
|
|
46
|
+
})
|
|
47
|
+
}, null, 12, _hoisted_1);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/client/index.ts
|
|
53
|
+
function enhanceAppWithCodepen({ app }) {
|
|
54
|
+
app.component("VPCodepen", _sfc_main);
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { _sfc_main as VPCodepen, enhanceAppWithCodepen };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EnhanceAppContext } from "vitepress/client";
|
|
2
|
+
|
|
3
|
+
//#region src/client/VPCodepen.vue.d.ts
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
user: string;
|
|
6
|
+
slash: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
preview?: boolean;
|
|
9
|
+
editable?: boolean;
|
|
10
|
+
tab?: string;
|
|
11
|
+
theme?: 'light' | 'dark';
|
|
12
|
+
width?: string;
|
|
13
|
+
height?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/client/index.d.ts
|
|
19
|
+
declare function enhanceAppWithCodepen({
|
|
20
|
+
app
|
|
21
|
+
}: EnhanceAppContext): void;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { _default as VPCodepen, enhanceAppWithCodepen };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { computed, defineComponent, mergeProps, useSSRContext } from "vue";
|
|
2
|
+
import { ssrRenderAttrs } from "vue/server-renderer";
|
|
3
|
+
import { useData } from "vitepress/client";
|
|
4
|
+
//#region src/client/VPCodepen.vue
|
|
5
|
+
const CODEPEN_LINK = "https://codepen.io/";
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "VPCodepen",
|
|
8
|
+
__ssrInlineRender: true,
|
|
9
|
+
props: {
|
|
10
|
+
user: {},
|
|
11
|
+
slash: {},
|
|
12
|
+
title: {},
|
|
13
|
+
preview: { type: Boolean },
|
|
14
|
+
editable: { type: Boolean },
|
|
15
|
+
tab: {},
|
|
16
|
+
theme: {},
|
|
17
|
+
width: {},
|
|
18
|
+
height: {}
|
|
19
|
+
},
|
|
20
|
+
setup(__props) {
|
|
21
|
+
const { isDark } = useData();
|
|
22
|
+
const link = computed(() => {
|
|
23
|
+
const middle = __props.preview ? "/embed/preview/" : "/embed/";
|
|
24
|
+
const params = new URLSearchParams();
|
|
25
|
+
__props.editable && params.set("editable", "true");
|
|
26
|
+
__props.tab && params.set("default-tab", __props.tab);
|
|
27
|
+
const themeMode = __props.theme ?? (isDark.value ? "dark" : "light");
|
|
28
|
+
themeMode && params.set("theme-id", themeMode);
|
|
29
|
+
return `${CODEPEN_LINK}${__props.user}${middle}${__props.slash}?${params.toString()}`;
|
|
30
|
+
});
|
|
31
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
32
|
+
_push(`<iframe${ssrRenderAttrs(mergeProps({
|
|
33
|
+
src: link.value,
|
|
34
|
+
class: "vp-codepen",
|
|
35
|
+
title: __props.title,
|
|
36
|
+
frameborder: "0",
|
|
37
|
+
loading: "lazy",
|
|
38
|
+
allowtransparency: "true",
|
|
39
|
+
allowfullscreen: "true",
|
|
40
|
+
style: {
|
|
41
|
+
width: __props.width,
|
|
42
|
+
height: __props.height,
|
|
43
|
+
marginBlock: "16px",
|
|
44
|
+
marginInline: "0",
|
|
45
|
+
border: "none",
|
|
46
|
+
boxShadow: "var(--vp-shadow-2)"
|
|
47
|
+
}
|
|
48
|
+
}, _attrs))}></iframe>`);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const _sfc_setup = _sfc_main.setup;
|
|
53
|
+
_sfc_main.setup = (props, ctx) => {
|
|
54
|
+
const ssrContext = useSSRContext();
|
|
55
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/client/VPCodepen.vue");
|
|
56
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/client/index.ts
|
|
60
|
+
function enhanceAppWithCodepen({ app }) {
|
|
61
|
+
app.component("VPCodepen", _sfc_main);
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { _sfc_main as VPCodepen, enhanceAppWithCodepen };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PluginSimple } from "markdown-it";
|
|
2
|
+
|
|
3
|
+
//#region src/node/codepenPlugin.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { codepenMarkdownPlugin } from 'vitepress-plugin-codepen'
|
|
8
|
+
* import { defineConfig } from 'vitepress'
|
|
9
|
+
* export default defineConfig({
|
|
10
|
+
* markdown: {
|
|
11
|
+
* config: (md) => {
|
|
12
|
+
* md.use(codepenMarkdownPlugin)
|
|
13
|
+
* },
|
|
14
|
+
* },
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
declare const codepenMarkdownPlugin: PluginSimple;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/node/index.d.ts
|
|
21
|
+
/**
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import codepen from 'vitepress-plugin-codepen'
|
|
25
|
+
* import { defineConfig } from 'vitepress-tuck'
|
|
26
|
+
* export default defineConfig({
|
|
27
|
+
* plugins: [codepen()]
|
|
28
|
+
* })
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare const _default: (option?: unknown) => import("vitepress-tuck").VitepressPlugin;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { codepenMarkdownPlugin, _default as default };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { definePlugin } from "vitepress-tuck";
|
|
2
|
+
import { createEmbedRuleBlock, parseRect, resolveAttrs, stringifyAttrs } from "vitepress-plugin-toolkit";
|
|
3
|
+
//#region src/node/codepenPlugin.ts
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { codepenMarkdownPlugin } from 'vitepress-plugin-codepen'
|
|
8
|
+
* import { defineConfig } from 'vitepress'
|
|
9
|
+
* export default defineConfig({
|
|
10
|
+
* markdown: {
|
|
11
|
+
* config: (md) => {
|
|
12
|
+
* md.use(codepenMarkdownPlugin)
|
|
13
|
+
* },
|
|
14
|
+
* },
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
const codepenMarkdownPlugin = (md) => {
|
|
19
|
+
createEmbedRuleBlock(md, {
|
|
20
|
+
type: "codepen",
|
|
21
|
+
syntaxPattern: /^@\[codepen([^\]]*)\]\(([^)]*)\)/,
|
|
22
|
+
meta: ([, info, source]) => {
|
|
23
|
+
const { width, height, title, tab, ...rest } = resolveAttrs(info);
|
|
24
|
+
const [user, slash] = source.split("/");
|
|
25
|
+
return {
|
|
26
|
+
title: title || "Code Pen",
|
|
27
|
+
tab: tab || "result",
|
|
28
|
+
width: width ? parseRect(width) : "100%",
|
|
29
|
+
height: height ? parseRect(height) : "400px",
|
|
30
|
+
user,
|
|
31
|
+
slash,
|
|
32
|
+
...rest
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
content: (meta) => `<VPCodepen${stringifyAttrs(meta)} />`
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/node/index.ts
|
|
40
|
+
/**
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* import codepen from 'vitepress-plugin-codepen'
|
|
44
|
+
* import { defineConfig } from 'vitepress-tuck'
|
|
45
|
+
* export default defineConfig({
|
|
46
|
+
* plugins: [codepen()]
|
|
47
|
+
* })
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
var node_default = definePlugin(() => ({
|
|
51
|
+
name: "vitepress-plugin-codepen",
|
|
52
|
+
client: { enhance: "enhanceAppWithCodepen" },
|
|
53
|
+
markdown: { config(md) {
|
|
54
|
+
md.use(codepenMarkdownPlugin);
|
|
55
|
+
} },
|
|
56
|
+
vite: {
|
|
57
|
+
optimizeDeps: { include: ["@pengzhanbo/utils"] },
|
|
58
|
+
ssr: { noExternal: ["vitepress-plugin-codepen"] }
|
|
59
|
+
}
|
|
60
|
+
}));
|
|
61
|
+
//#endregion
|
|
62
|
+
export { codepenMarkdownPlugin, node_default as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vitepress-plugin-codepen",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "embed codepen in vitepress document.",
|
|
6
|
+
"author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"vitepress",
|
|
10
|
+
"vitepress-plugin",
|
|
11
|
+
"codepen"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./dist/node/index.js",
|
|
15
|
+
"./client": {
|
|
16
|
+
"browser": "./dist/client/browser/index.js",
|
|
17
|
+
"default": "./dist/client/ssr/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./style.css": "./dist/client/style.css"
|
|
20
|
+
},
|
|
21
|
+
"module": "./dist/node/index.js",
|
|
22
|
+
"types": "./dist/node/index.d.ts",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"vitepress": "^1.6.4 || ^2.0.0-alpha.17",
|
|
28
|
+
"vue": "^3.5.0"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"vitepress-plugin-toolkit": "0.1.0",
|
|
32
|
+
"vitepress-tuck": "0.1.0"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"clean": "rimraf --glob ./dist",
|
|
39
|
+
"dev": "pnpm '/(tsdown|copy):watch/'",
|
|
40
|
+
"build": "pnpm tsdown && pnpm copy",
|
|
41
|
+
"copy": "cpx \"src/**/*.css\" dist",
|
|
42
|
+
"copy:watch": "pnpm copy -w",
|
|
43
|
+
"tsdown": "tsdown --config-loader unrun",
|
|
44
|
+
"tsdown:watch": "pnpm tsdown -w"
|
|
45
|
+
}
|
|
46
|
+
}
|