forked from electrode-io/electrode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move all dev related stuff to @xarc/app-dev (electrode-io#1707)
- Loading branch information
Showing
68 changed files
with
1,836 additions
and
2,173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("@xarc/app/lib/constants"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
require, | ||
hapiPlugin: require("./lib/webpack-dev-hapi"), | ||
fastifyPlugin: require("./lib/webpack-dev-fastify"), | ||
expressMiddleware: require("./lib/webpack-dev-express"), | ||
koaMiddleware: require("./lib/webpack-dev-koa") | ||
}; | ||
const loadXrunTasks = require("./lib/load-xrun-tasks"); | ||
|
||
loadXrunTasks.require = require; | ||
loadXrunTasks.hapiPlugin = require("./lib/webpack-dev-hapi"); | ||
loadXrunTasks.fastifyPlugin = require("./lib/webpack-dev-fastify"); | ||
loadXrunTasks.expressMiddleware = require("./lib/webpack-dev-express"); | ||
loadXrunTasks.koaMiddleware = require("./lib/webpack-dev-koa"); | ||
|
||
module.exports = loadXrunTasks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"use strict"; | ||
|
||
/* | ||
* Start user's app server from src/server directory in dev mode. | ||
* | ||
* - If user has src/server/dev.js, then just requires that, and expect | ||
* user does all the babel register setup etc in that file. | ||
* - otherwise load babel-register, with babel config to process files | ||
* that are only under CWD and not within CWD/node_modules. | ||
* | ||
* This allows symlinked node modules to work in dev mode without babel | ||
* trying to load .babelrc or process files from them. | ||
* | ||
*/ | ||
const Path = require("path"); | ||
|
||
const serverDir = process.argv[2] || "src/server"; | ||
|
||
let start; | ||
|
||
try { | ||
// Try to load user's dev.js under src/server | ||
start = require(Path.resolve(serverDir, "dev.js")); | ||
} catch (e) { | ||
const archetype = require("../config/archetype")(); | ||
const cwdNM = Path.resolve("node_modules"); | ||
const cwd = process.cwd(); | ||
|
||
// fallback to default action that loads babel-register and then requires | ||
// src/server, under which there should be an index.js file. | ||
require("@babel/register")({ | ||
only: [ | ||
x => { | ||
x = Path.normalize(x); | ||
return x.startsWith(cwd) && !x.startsWith(cwdNM); | ||
} | ||
], | ||
extensions: [".js", ".jsx"] | ||
.concat(archetype.babel.enableTypeScript && [".ts", ".tsx"]) | ||
.filter(x => x), | ||
cache: true | ||
}); | ||
|
||
const fullServerDir = Path.resolve(serverDir); | ||
|
||
start = require(fullServerDir); | ||
} | ||
|
||
if (typeof start === "function") { | ||
start(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.