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

Commit 1d2099e

Browse files
authored
Merge pull request #115 from netlify/add-nuxt
fix: Add Nuxt
2 parents a6cf94f + b7c7af5 commit 1d2099e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/detectors/nuxt.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(["nuxt"])) return false;
13+
14+
/** everything below now assumes that we are within vue */
15+
16+
const possibleArgsArrs = scanScripts({
17+
preferredScriptsArr: ["start", "dev", "run"],
18+
preferredCommand: "nuxt start"
19+
});
20+
21+
if (!possibleArgsArrs.length) {
22+
// ofer to run it when the user doesnt have any scripts setup! 🤯
23+
possibleArgsArrs.push(["nuxt", "start"]);
24+
}
25+
26+
return {
27+
type: "yarn",
28+
command: getYarnOrNPMCommand(),
29+
port: 8888,
30+
proxyPort: 3000,
31+
env: { ...process.env },
32+
possibleArgsArrs,
33+
urlRegexp: new RegExp(`(http://)([^:]+:)${3000}(/)?`, "g"),
34+
dist: ".nuxt"
35+
};
36+
};

0 commit comments

Comments
 (0)