mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 10:34:17 +00:00
15 lines
405 B
JavaScript
15 lines
405 B
JavaScript
const path = require("node:path")
|
|
const moduleAlias = require("module-alias")
|
|
|
|
module.exports = function registerBaseAliases(fromPath, customAliases = {}) {
|
|
if (typeof fromPath === "undefined") {
|
|
if (module.parent.filename.includes("dist")) {
|
|
fromPath = path.resolve(process.cwd(), "dist")
|
|
} else {
|
|
fromPath = path.resolve(process.cwd(), "src")
|
|
}
|
|
}
|
|
|
|
moduleAlias.addAliases(customAliases)
|
|
}
|