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
|
|
@ -7,7 +7,7 @@
|
|||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "tsc",
|
||||
"start": "node dist/main.js"
|
||||
},
|
||||
},
|
||||
"author": "Oliver Akins",
|
||||
"license": "UNLICENSED",
|
||||
"dependencies": {
|
||||
|
|
@ -21,5 +21,8 @@
|
|||
"devDependencies": {
|
||||
"@types/glob": "^7.2.0",
|
||||
"@types/uuid": "^8.3.4"
|
||||
},
|
||||
"_moduleAliases": {
|
||||
"@": "./dist"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
// Filepath alias resolution
|
||||
import "module-alias/register";
|
||||
|
||||
import startWebsocketServer from "./websocket";
|
||||
import { Logger } from "tslog";
|
||||
import toml from "toml";
|
||||
|
|
|
|||
|
|
@ -46,7 +46,9 @@
|
|||
/* Module Resolution Options */
|
||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
// "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. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
// "types": [], /* Type declaration files to be included in compilation. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue