@vuepress/plugin-replace-assets 2.0.0-rc.111

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 ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018-present, VuePress Community
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,166 @@
1
+ import { Plugin } from 'vuepress/core';
2
+ import { VitePlugin, WebpackPluginInstance } from 'unplugin';
3
+
4
+ /**
5
+ * Assets Replacement Target Path
6
+ * - `string`: Directly concatenated before the original path
7
+ * - `(url) => string`: Custom replacement method, returns the new path
8
+ *
9
+ * 资源替换目标路径
10
+ * - `string`: 直接拼接在原始路径前面
11
+ * - `(url) => string`: 自定义替换方法,返回新路径
12
+ */
13
+ type Replacement = string | ((url: string) => string);
14
+ /**
15
+ * Assets Replacement Rule
16
+ *
17
+ * 资源替换规则
18
+ */
19
+ interface ReplacementRule {
20
+ /**
21
+ * Assets Matching
22
+ *
23
+ * - `RegExp`: Match using regular expression
24
+ * - `string`: Match using string
25
+ * - Strings starting with `^` or ending with `$` are automatically converted to regular expressions
26
+ * - For ordinary strings, checks if they appear at the start or end
27
+ *
28
+ * 资源匹配
29
+ *
30
+ * - `RegExp`: 匹配正则
31
+ * - `string`: 匹配字符串
32
+ * - 以 `^` 开头或以 `$` 结尾的字符串,会自动转换为正则
33
+ * - 普通字符串检查是否以其作为开头或结尾
34
+ *
35
+ * @example
36
+ * ```
37
+ * '^/foo/'
38
+ * '.jpg$'
39
+ * /\.jpg$/
40
+ * ```
41
+ */
42
+ find: RegExp | string;
43
+ /**
44
+ * Assets Replacement Target Path
45
+ * - `string`: Directly concatenated before the original path
46
+ * - `(url) => string`: Custom replacement method, returns the new path
47
+ *
48
+ * 资源替换目标路径
49
+ * - `string`: 直接拼接在原始路径前面
50
+ * - `(url) => string`: 自定义替换方法,返回新路径
51
+ *
52
+ * @example
53
+ * ```
54
+ * 'https://example.com'
55
+ * (url) => `https://example.com${url}`
56
+ * ```
57
+ */
58
+ replacement: Replacement;
59
+ }
60
+ interface ReplaceAssetsOptions {
61
+ /**
62
+ * Custom Assets Replacement Rules
63
+ *
64
+ * 自定义资源替换规则
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * {
69
+ * rules: [{
70
+ * find: /^\/images\/.*\.(jpe?g|png|gif|svg)$/,
71
+ * replacement: 'https://cdn.example.com/images/',
72
+ * }]
73
+ * }
74
+ * ```
75
+ */
76
+ rules?: ReplacementRule | ReplacementRule[];
77
+ /**
78
+ * Built-in image matching rules, designed to match and find common image paths starting with `^/images/`
79
+ *
80
+ * 内置的图片匹配规则,匹配查找 `^/images/` 开头的常见的图片路径
81
+ *
82
+ * @example
83
+ * ```
84
+ * {
85
+ * image: 'https://example.com'
86
+ * }
87
+ * ```
88
+ */
89
+ image?: Replacement;
90
+ /**
91
+ * Built-in media matching rules, designed to match and locate common media paths such as videos and audio that start with `^/medias/`.
92
+ *
93
+ * 内置的媒体匹配规则,匹配查找 `^/medias/` 开头的常见的视频、音频等媒体路径
94
+ *
95
+ * @example
96
+ * ```
97
+ * {
98
+ * media: 'https://example.com'
99
+ * }
100
+ * ```
101
+ */
102
+ media?: Replacement;
103
+ /**
104
+ * Equivalent to setting both {@link ReplaceAssetsOptions.image image} and {@link ReplaceAssetsOptions.media media} simultaneously.
105
+ *
106
+ * 相当于同时设置 {@link ReplaceAssetsOptions.image image} 和 {@link ReplaceAssetsOptions.media media}
107
+ *
108
+ * @example
109
+ * ```
110
+ * {
111
+ * all: 'https://example.com'
112
+ * }
113
+ * ```
114
+ */
115
+ all?: Replacement;
116
+ }
117
+ /**
118
+ * Assets Replacement Plugin Options
119
+ *
120
+ * 资源替换插件配置项
121
+ */
122
+ type ReplaceAssetsPluginOptions = ReplaceAssetsOptions | Replacement | ReplacementRule | ReplacementRule[];
123
+
124
+ /**
125
+ * Plugin for replacing assets path
126
+ *
127
+ * 资源路径替换插件
128
+ *
129
+ * @example
130
+ * ```
131
+ * export default defineUserConfig({
132
+ * plugins: [
133
+ * replaceAssetsPlugin('https://cnd.example.com')
134
+ * ]
135
+ * })
136
+ * ```
137
+ */
138
+ declare const replaceAssetsPlugin: (options?: ReplaceAssetsPluginOptions) => Plugin;
139
+
140
+ declare const createFindPattern: (dir: string, extensions: string[]) => RegExp;
141
+ /**
142
+ * Normalize replacement rules
143
+ */
144
+ declare const normalizeRules: (options?: ReplaceAssetsPluginOptions) => ReplacementRule[];
145
+
146
+ /**
147
+ * Check if url matches find
148
+ */
149
+ declare const isMatchUrl: (find: RegExp | string, url: string) => boolean;
150
+ /**
151
+ * Replace asset with rules
152
+ *
153
+ * @example
154
+ * ```ts
155
+ * replacementAssetWithRules([{ find: '/foo/', replacement: 'https://example.com' }], '/foo/a.jpg')
156
+ * // -> 'https://example.com/foo/a.jpg'
157
+ * ```
158
+ */
159
+ declare const replacementAssetWithRules: (rules: ReplacementRule[], url: string) => string | void;
160
+ declare const transformAssets: (code: string, pattern: RegExp, rules: ReplacementRule[]) => string;
161
+
162
+ declare const createVitePluginReplaceAssets: () => (options: ReplacementRule[]) => VitePlugin | VitePlugin[];
163
+ declare const createWebpackPluginReplaceAssets: () => (options: ReplacementRule[]) => WebpackPluginInstance;
164
+
165
+ export { createFindPattern, createVitePluginReplaceAssets, createWebpackPluginReplaceAssets, isMatchUrl, normalizeRules, replaceAssetsPlugin, replacementAssetWithRules, transformAssets };
166
+ export type { ReplaceAssetsOptions, ReplaceAssetsPluginOptions, Replacement, ReplacementRule };
@@ -0,0 +1,2 @@
1
+ import{isFunction as w,isArray as g,removeEndingSlash as x,removeLeadingSlash as j,getBundlerName as P,addViteConfig as b,configWebpack as R}from"@vuepress/helper";import{createVitePlugin as S,createWebpackPlugin as I}from"unplugin";import M from"magic-string";const O="@vuepress/plugin-replace-assets",_=["apng","bmp","png","jpe?g","jfif","pjpeg","pjp","gif","svg","ico","webp","avif","cur","jxl"],k=["mp4","webm","ogg","mp3","wav","flac","aac","opus","mov","m4a","vtt","pdf"],o=(t,e)=>new RegExp(`^/${t}/.*\\.(?:${e.join("|")})(\\?.*)?$`),m=t=>{const e=[];return t?((typeof t=="string"||w(t))&&(t={all:t}),g(t)?(e.push(...t),e):"find"in t?(t.find&&t.replacement&&e.push(t),e):(t.rules&&e.push(...g(t.rules)?t.rules:[t.rules]),(t.image||t.all)&&e.push({find:o("images",_),replacement:t.image||t.all}),(t.media||t.all)&&e.push({find:o("medias",k),replacement:t.media||t.all}),e)):[]},y=t=>{const e=`(${t}.*?)`;return new RegExp([`(?:"${e}")`,`(?:'${e}')`,`(?:\\(${e}\\))`,`(?:\\('${e}'\\))`,`(?:\\("${e}"\\))`,`(?:\\\\"${e}\\\\")`].join("|"),"gu")},f=(t,e)=>t?e?`${x(e)}/${j(t)}`:t:"",d=(t,e)=>typeof t=="string"?t.startsWith("^")||t.endsWith("$")?new RegExp(t).test(e):e.endsWith(t)||e.startsWith(t):t.test(e),p=new Map,h=(t,e)=>{if(p.has(e))return p.get(e);for(const{find:s,replacement:r}of t)if(s&&d(s,e)){const n=typeof r=="function"?f(r(e)):f(e,r);/* istanbul ignore if -- @preserve */if(n)return p.set(e,n),n}},$=(t,e,s)=>{const r=new M(t);let n,a=!1;for(;n=e.exec(t);){const i=n[6]||n[5]||n[4]||n[3]||n[2]||n[1],[l,v]=n[0].startsWith("(")?['("','")']:n[0].startsWith('\\"')?['\\"','\\"']:['"','"'],c=n.index,A=c+n[0].length,u=h(s,i);u&&(a=!0,r.update(c,A,`${l}${u}${v}`))}return a?r.toString():t},W=t=>{const e=y("/[^/]");return{name:"vuepress:replace-assets",enforce:"pre",transform:{filter:{id:{exclude:[/\.json(?:$|\?)/,/\.html?$/]}},handler(s){return $(s,e,t)}}}},E=()=>S(W),N=()=>I(W),U=t=>{const e={name:O},s=m(t);return s.length===0?e:{...e,extendsBundlerOptions(r,n){const a=P(n);if(a==="vite"){const i=E();b(r,n,{plugins:[i(s)]})}a==="webpack"&&R(r,n,i=>{i.plugins??=[];const l=N();i.plugins.push(l(s))})}}};export{o as createFindPattern,E as createVitePluginReplaceAssets,N as createWebpackPluginReplaceAssets,d as isMatchUrl,m as normalizeRules,U as replaceAssetsPlugin,h as replacementAssetWithRules,$ as transformAssets};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/node/constants.ts","../../src/node/normalizeRules.ts","../../src/node/utils.ts","../../src/node/transformAssets.ts","../../src/node/unplugin.ts","../../src/node/replaceAssetsPlugin.ts"],"sourcesContent":["export const PLUGIN_NAME = '@vuepress/plugin-replace-assets'\n\n/**\n * images extensions\n */\nexport const KNOWN_IMAGE_EXTENSIONS: string[] = [\n 'apng',\n 'bmp',\n 'png',\n 'jpe?g',\n 'jfif',\n 'pjpeg',\n 'pjp',\n 'gif',\n 'svg',\n 'ico',\n 'webp',\n 'avif',\n 'cur',\n 'jxl',\n]\n\n/**\n * media extensions\n */\nexport const KNOWN_MEDIA_EXTENSIONS: string[] = [\n 'mp4',\n 'webm',\n 'ogg',\n 'mp3',\n 'wav',\n 'flac',\n 'aac',\n 'opus',\n 'mov',\n 'm4a',\n 'vtt',\n\n 'pdf',\n]\n","import { isArray, isFunction } from '@vuepress/helper'\nimport { KNOWN_IMAGE_EXTENSIONS, KNOWN_MEDIA_EXTENSIONS } from './constants.js'\nimport type { ReplaceAssetsPluginOptions, ReplacementRule } from './types.js'\n\nexport const createFindPattern = (\n dir: string,\n extensions: string[],\n): RegExp => {\n return new RegExp(`^/${dir}/.*\\\\.(?:${extensions.join('|')})(\\\\?.*)?$`)\n}\n\n/**\n * Normalize replacement rules\n */\nexport const normalizeRules = (\n options?: ReplaceAssetsPluginOptions,\n): ReplacementRule[] => {\n const normalized: ReplacementRule[] = []\n\n if (!options) return []\n\n if (typeof options === 'string' || isFunction(options)) {\n // eslint-disable-next-line no-param-reassign\n options = {\n all: options,\n }\n }\n\n if (isArray(options)) {\n normalized.push(...options)\n return normalized\n }\n\n if ('find' in options) {\n if (options.find && options.replacement) normalized.push(options)\n return normalized\n }\n\n if (options.rules) {\n normalized.push(\n ...(isArray(options.rules) ? options.rules : [options.rules]),\n )\n }\n\n if (options.image || options.all) {\n normalized.push({\n find: createFindPattern('images', KNOWN_IMAGE_EXTENSIONS),\n replacement: options.image || options.all!,\n })\n }\n\n if (options.media || options.all) {\n normalized.push({\n find: createFindPattern('medias', KNOWN_MEDIA_EXTENSIONS),\n replacement: options.media || options.all!,\n })\n }\n\n return normalized\n}\n","import { removeEndingSlash, removeLeadingSlash } from '@vuepress/helper'\n\nexport const createAssetPattern = (prefix: string): RegExp => {\n const s = `(${prefix}.*?)`\n return new RegExp(\n [\n `(?:\"${s}\")`, // \"prefix\"\n `(?:'${s}')`, // 'prefix'\n `(?:\\\\(${s}\\\\))`, // (prefix)\n `(?:\\\\('${s}'\\\\))`, // ('prefix')\n `(?:\\\\(\"${s}\"\\\\))`, // (\"prefix\")\n `(?:\\\\\\\\\"${s}\\\\\\\\\")`, // \\\"prefix\\\"\n ].join('|'),\n 'gu',\n )\n}\n\n/**\n * Normalize url\n *\n * @example\n * ```ts\n * normalizeUrl('/bar', '/foo/') // -> /foo/bar\n * ```\n */\nexport const normalizeUrl = (url: string, base?: string): string => {\n if (!url) return ''\n\n if (base) {\n return `${removeEndingSlash(base)}/${removeLeadingSlash(url)}`\n }\n\n return url\n}\n","import MagicString from 'magic-string'\nimport type { ReplacementRule } from './types.js'\nimport { normalizeUrl } from './utils.js'\n\n/**\n * Check if url matches find\n */\nexport const isMatchUrl = (find: RegExp | string, url: string): boolean => {\n if (typeof find === 'string') {\n // like regexp string, start with `^` or end with `$`\n if (find.startsWith('^') || find.endsWith('$')) {\n return new RegExp(find).test(url)\n }\n\n return url.endsWith(find) || url.startsWith(find)\n }\n\n return find.test(url)\n}\n\nconst cache = new Map<string, string>()\n\n/**\n * Replace asset with rules\n *\n * @example\n * ```ts\n * replacementAssetWithRules([{ find: '/foo/', replacement: 'https://example.com' }], '/foo/a.jpg')\n * // -> 'https://example.com/foo/a.jpg'\n * ```\n */\nexport const replacementAssetWithRules = (\n rules: ReplacementRule[],\n url: string,\n): string | void => {\n if (cache.has(url)) return cache.get(url)\n\n for (const { find, replacement } of rules) {\n if (find && isMatchUrl(find, url)) {\n const replaced =\n typeof replacement === 'function'\n ? normalizeUrl(replacement(url))\n : normalizeUrl(url, replacement)\n\n /* istanbul ignore if -- @preserve */\n if (replaced) {\n cache.set(url, replaced)\n return replaced\n }\n }\n }\n return undefined\n}\n\nexport const transformAssets = (\n code: string,\n pattern: RegExp,\n rules: ReplacementRule[],\n): string => {\n const s = new MagicString(code)\n let matched: RegExpExecArray | null\n let hasMatched = false\n // eslint-disable-next-line no-cond-assign\n while ((matched = pattern.exec(code))) {\n const assetUrl =\n matched[6] ||\n matched[5] ||\n matched[4] ||\n matched[3] ||\n matched[2] ||\n matched[1]\n const [left, right] = matched[0].startsWith('(')\n ? ['(\"', '\")']\n : matched[0].startsWith('\\\\\"')\n ? ['\\\\\"', '\\\\\"']\n : ['\"', '\"']\n\n const start = matched.index\n const end = start + matched[0].length\n const resolved = replacementAssetWithRules(rules, assetUrl)\n if (resolved) {\n hasMatched = true\n s.update(start, end, `${left}${resolved}${right}`)\n }\n }\n\n if (!hasMatched) return code\n\n return s.toString()\n}\n","import type {\n UnpluginFactory,\n VitePlugin,\n WebpackPluginInstance,\n} from 'unplugin'\nimport { createVitePlugin, createWebpackPlugin } from 'unplugin'\nimport { transformAssets } from './transformAssets.js'\nimport type { ReplacementRule } from './types.js'\nimport { createAssetPattern } from './utils.js'\n\nconst replaceAssetsFactory: UnpluginFactory<ReplacementRule[]> = (rules) => {\n const pattern = createAssetPattern('/[^/]')\n return {\n name: 'vuepress:replace-assets',\n enforce: 'pre',\n transform: {\n filter: { id: { exclude: [/\\.json(?:$|\\?)/, /\\.html?$/] } },\n handler(code) {\n return transformAssets(code, pattern, rules)\n },\n },\n }\n}\n\nexport const createVitePluginReplaceAssets: () => (\n options: ReplacementRule[],\n) => VitePlugin | VitePlugin[] = () => createVitePlugin(replaceAssetsFactory)\n\nexport const createWebpackPluginReplaceAssets: () => (\n options: ReplacementRule[],\n) => WebpackPluginInstance = () => createWebpackPlugin(replaceAssetsFactory)\n","import { addViteConfig, configWebpack, getBundlerName } from '@vuepress/helper'\nimport type { Plugin } from 'vuepress/core'\nimport { PLUGIN_NAME } from './constants.js'\nimport { normalizeRules } from './normalizeRules.js'\nimport type { ReplaceAssetsPluginOptions } from './types.js'\nimport {\n createVitePluginReplaceAssets,\n createWebpackPluginReplaceAssets,\n} from './unplugin.js'\n\n/**\n * Plugin for replacing assets path\n *\n * 资源路径替换插件\n *\n * @example\n * ```\n * export default defineUserConfig({\n * plugins: [\n * replaceAssetsPlugin('https://cnd.example.com')\n * ]\n * })\n * ```\n */\nexport const replaceAssetsPlugin = (\n options?: ReplaceAssetsPluginOptions,\n): Plugin => {\n const EMPTY_PLUGIN = { name: PLUGIN_NAME }\n\n const rules = normalizeRules(options)\n\n if (rules.length === 0) return EMPTY_PLUGIN\n\n return {\n ...EMPTY_PLUGIN,\n\n extendsBundlerOptions(bundlerOptions, app) {\n const bundle = getBundlerName(app)\n\n if (bundle === 'vite') {\n const replaceAssets = createVitePluginReplaceAssets()\n addViteConfig(bundlerOptions, app, {\n plugins: [replaceAssets(rules)],\n })\n }\n\n if (bundle === 'webpack') {\n configWebpack(bundlerOptions, app, (config) => {\n config.plugins ??= []\n const replaceAssets = createWebpackPluginReplaceAssets()\n config.plugins.push(replaceAssets(rules))\n })\n }\n },\n }\n}\n"],"names":["PLUGIN_NAME","KNOWN_IMAGE_EXTENSIONS","KNOWN_MEDIA_EXTENSIONS","createFindPattern","dir","extensions","normalizeRules","options","normalized","isFunction","isArray","createAssetPattern","prefix","s","normalizeUrl","url","base","removeEndingSlash","removeLeadingSlash","isMatchUrl","find","cache","replacementAssetWithRules","rules","replacement","replaced","transformAssets","code","pattern","MagicString","matched","hasMatched","assetUrl","left","right","start","end","resolved","replaceAssetsFactory","createVitePluginReplaceAssets","createVitePlugin","createWebpackPluginReplaceAssets","createWebpackPlugin","replaceAssetsPlugin","EMPTY_PLUGIN","bundlerOptions","app","bundle","getBundlerName","replaceAssets","addViteConfig","configWebpack","config"],"mappings":"qQAAO,MAAMA,EAAc,kCAKdC,EAAmC,CAC9C,OACA,MACA,MACA,QACA,OACA,QACA,MACA,MACA,MACA,MACA,OACA,OACA,MACA,KACF,EAKaC,EAAmC,CAC9C,MACA,OACA,MACA,MACA,MACA,OACA,MACA,OACA,MACA,MACA,MAEA,KACF,ECnCaC,EAAoB,CAC/BC,EACAC,IAEO,IAAI,OAAO,KAAKD,CAAG,YAAYC,EAAW,KAAK,GAAG,CAAC,YAAY,EAM3DC,EACXC,GACsB,CACtB,MAAMC,EAAgC,CAAA,EAEtC,OAAKD,IAED,OAAOA,GAAY,UAAYE,EAAWF,CAAO,KAEnDA,EAAU,CACR,IAAKA,CACP,GAGEG,E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iBF,CAAoB,EAE/DG,EAEgB,IAAMC,EAAoBJ,CAAoB,ECN9DK,EACXpC,GACW,CACX,MAAMqC,EAAe,CAAE,KAAM5C,CAAY,EAEnCuB,EAAQjB,EAAeC,CAAO,EAEpC,OAAIgB,EAAM,SAAW,EAAUqB,EAExB,CACL,GAAGA,EAEH,sBAAsBC,EAAgBC,EAAK,CACzC,MAAMC,EAASC,EAAeF,CAAG,EAEjC,GAAIC,IAAW,OAAQ,CACrB,MAAME,EAAgBV,IACtBW,EAAcL,EAAgBC,EAAK,CACjC,QAAS,CAACG,EAAc1B,CAAK,CAAC,CAChC,CAAC,CACH,CAEIwB,IAAW,WACbI,EAAcN,EAAgBC,EAAMM,GAAW,CAC7CA,EAAO,UAAY,CAAA,EACnB,MAAMH,EAAgBR,EAAAA,EACtBW,EAAO,QAAQ,KAAKH,EAAc1B,CAAK,CAAC,CAC1C,CAAC,CAEL,CACF,CACF"}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@vuepress/plugin-replace-assets",
3
+ "version": "2.0.0-rc.111",
4
+ "description": "VuePress plugin - replace assets",
5
+ "keywords": [
6
+ "vuepress-plugin",
7
+ "vuepress",
8
+ "plugin",
9
+ "replace assets"
10
+ ],
11
+ "homepage": "https://ecosystem.vuejs.press/plugins/tools/replace-assets.html",
12
+ "bugs": {
13
+ "url": "https://github.com/vuepress/ecosystem/issues"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/vuepress/ecosystem.git",
18
+ "directory": "plugins/tools/plugin-replace-assets"
19
+ },
20
+ "license": "MIT",
21
+ "author": "pengzhanbo",
22
+ "maintainers": [
23
+ {
24
+ "name": "pengzhanbo",
25
+ "email": "volodymyr@foxmail.com"
26
+ }
27
+ ],
28
+ "type": "module",
29
+ "exports": {
30
+ ".": "./lib/node/index.js",
31
+ "./package.json": "./package.json"
32
+ },
33
+ "main": "./lib/node/index.js",
34
+ "types": "./lib/node/index.d.ts",
35
+ "files": [
36
+ "lib"
37
+ ],
38
+ "dependencies": {
39
+ "@vuepress/helper": "2.0.0-rc.111",
40
+ "magic-string": "^0.30.17",
41
+ "unplugin": "^2.3.5"
42
+ },
43
+ "peerDependencies": {
44
+ "vuepress": "2.0.0-rc.24"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "gitHead": "d5246d2b40807aa5227e5320a3759c44a877d8cd"
50
+ }