Add an import alias for shorter filepath imports
This commit is contained in:
parent
1f86b68e4c
commit
e434aea6ac
3 changed files with 10 additions and 2 deletions
|
|
@ -21,5 +21,8 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/glob": "^7.2.0",
|
"@types/glob": "^7.2.0",
|
||||||
"@types/uuid": "^8.3.4"
|
"@types/uuid": "^8.3.4"
|
||||||
|
},
|
||||||
|
"_moduleAliases": {
|
||||||
|
"@": "./dist"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Filepath alias resolution
|
||||||
|
import "module-alias/register";
|
||||||
|
|
||||||
import startWebsocketServer from "./websocket";
|
import startWebsocketServer from "./websocket";
|
||||||
import { Logger } from "tslog";
|
import { Logger } from "tslog";
|
||||||
import toml from "toml";
|
import toml from "toml";
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,9 @@
|
||||||
/* Module Resolution Options */
|
/* Module Resolution Options */
|
||||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
"paths": {
|
||||||
|
"@/*": ["./src/*"]
|
||||||
|
}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||||
// "types": [], /* Type declaration files to be included in compilation. */
|
// "types": [], /* Type declaration files to be included in compilation. */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue