@vuepress/plugin-redirect 2.0.0-rc.127 → 2.0.0-rc.128
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/dist/cli/index.js +1 -1
- package/package.json +4 -4
package/dist/cli/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"../getRedirectHTML-C9SBJAfB.js";import{removeEndingSlash as t,removeLeadingSlash as n}from"@vuepress/helper";import{createCommand as r}from"commander";import{loadUserConfig as i,resolveAppConfig as a,resolveCliAppConfig as o,resolveUserConfigConventionalPath as s,resolveUserConfigPath as c,transformUserConfigToPlugin as l}from"vuepress/cli";import{createBuildApp as u}from"vuepress/core";import{fs as d,logger as f,path as p}from"vuepress/utils";var m=`2.0.0-rc.
|
|
2
|
+
import{t as e}from"../getRedirectHTML-C9SBJAfB.js";import{removeEndingSlash as t,removeLeadingSlash as n}from"@vuepress/helper";import{createCommand as r}from"commander";import{loadUserConfig as i,resolveAppConfig as a,resolveCliAppConfig as o,resolveUserConfigConventionalPath as s,resolveUserConfigPath as c,transformUserConfigToPlugin as l}from"vuepress/cli";import{createBuildApp as u}from"vuepress/core";import{fs as d,logger as f,path as p}from"vuepress/utils";var m=`2.0.0-rc.128`;const h=r(`vp-redirect`);h.summary(`Generate redirect site`).description(`Generate redirect site for current VuePress project`).option(`--hostname <hostname>`,`Hostname to redirect to (E.g.: https://new.example.com/)`,`/`).option(`-c, --config [config]`,`Set path to config file`).option(`--cache [cache]`,`Set the directory of the cache files`).option(`--temp [temp]`,`Set the directory of the temporary files`).option(`--clean-cache`,`Clean the cache files before generation`).option(`--clean-temp`,`Clean the temporary files before generation`).argument(`<source>`,`Source directory of VuePress project`).argument(`[output]`,`Output folder (default: .vuepress/redirect relative to source folder)`).action(async(r,m,g)=>{process.env.NODE_ENV??=`production`,d.existsSync(r)||h.error(`Source directory ${r} does not exist!`);let _=o(r,{}),{userConfig:v}=await i(g.config?c(g.config):s(_.source)),y=a({defaultAppConfig:{cache:g.cache,temp:g.temp},cliAppConfig:_,userConfig:v});if(y==null)return;let b=u(y);b.use(l(v,_.source)),g.cleanTemp===!0&&(f.info(`Cleaning temp...`),await d.remove(b.dir.temp())),g.cleanCache===!0&&(f.info(`Cleaning cache...`),await d.remove(b.dir.cache()));let x=m?p.join(process.cwd(),m):p.join(b.dir.source(),`.vuepress`,`redirect`);await d.emptyDir(x),f.info(`Initializing VuePress and preparing data...`),await b.init(),f.info(`Generating redirect pages...`),await Promise.all(b.pages.map(r=>{let i=`${t(g.hostname)}${b.siteData.base}${n(r.path)}`,a=p.join(x,n(r.path.replace(/\/$/,`/index.html`)));return d.ensureDir(p.dirname(a)).then(()=>d.writeFile(a,e(i)))}))}),h.version(m),h.showHelpAfterError(`add --help for additional information`),await h.parseAsync();export{};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/plugin-redirect",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.128",
|
|
4
4
|
"description": "VuePress plugin - redirect",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plugin",
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@vuepress/helper": "2.0.0-rc.
|
|
51
|
+
"@vuepress/helper": "2.0.0-rc.128",
|
|
52
52
|
"@vueuse/core": "^14.2.1",
|
|
53
53
|
"commander": "^14.0.3",
|
|
54
54
|
"vue": "^3.5.31"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"vuepress": "2.0.0-rc.
|
|
57
|
+
"vuepress": "2.0.0-rc.28"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "47b25c2008dc496e4638cae7528374846d3660dd"
|
|
60
60
|
}
|