Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit 2292c2c

Browse files
committed
fix: Add vuepress detector
1 parent 70ebc46 commit 2292c2c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/detectors/vuepress.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const {
2+
hasRequiredDeps,
3+
hasRequiredFiles,
4+
getYarnOrNPMCommand,
5+
scanScripts
6+
} = require("./utils/jsdetect");
7+
8+
module.exports = function() {
9+
// REQUIRED FILES
10+
if (!hasRequiredFiles(["package.json"])) return false;
11+
// REQUIRED DEPS
12+
if (!hasRequiredDeps(["vuepress"])) return false;
13+
14+
/** everything below now assumes that we are within vue */
15+
16+
const possibleArgsArrs = scanScripts({
17+
preferredScriptsArr: ["docs:dev", "dev", "run"],
18+
preferredCommand: "vuepress dev"
19+
});
20+
21+
if (!possibleArgsArrs.length) {
22+
// ofer to run it when the user doesnt have any scripts setup! 🤯
23+
possibleArgsArrs.push(["vuepress", "dev"]);
24+
}
25+
26+
return {
27+
type: "vuepress",
28+
command: getYarnOrNPMCommand(),
29+
port: 8888,
30+
proxyPort: 8080,
31+
env: { ...process.env },
32+
possibleArgsArrs,
33+
urlRegexp: new RegExp(`(http://)([^:]+:)${8080}(/)?`, "g"),
34+
dist: ".vuepress/dist"
35+
};
36+
};

0 commit comments

Comments
 (0)