mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 10:34:17 +00:00
allow custom aliases
This commit is contained in:
parent
50c6335a32
commit
3c45cf6e67
@ -53,7 +53,7 @@ if (process.env.LOG_REQUESTS === "true") {
|
||||
global.DEFAULT_MIDDLEWARES.push(require("morgan")(process.env.NODE_ENV === "development" ? "dev" : "combined"))
|
||||
}
|
||||
|
||||
function registerBaseAliases(fromPath) {
|
||||
function registerBaseAliases(fromPath, customAliases = {}) {
|
||||
if (typeof fromPath === "undefined") {
|
||||
if (module.parent.filename.includes("dist")) {
|
||||
fromPath = path.resolve(process.cwd(), "dist")
|
||||
@ -63,6 +63,7 @@ function registerBaseAliases(fromPath) {
|
||||
}
|
||||
|
||||
moduleAlias.addAliases({
|
||||
...customAliases,
|
||||
"@controllers": path.resolve(fromPath, "controllers"),
|
||||
"@middlewares": path.resolve(fromPath, "middlewares"),
|
||||
"@models": path.resolve(fromPath, "models"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user