Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.11 KB

File metadata and controls

44 lines (31 loc) · 1.11 KB

PATH ALIAS

THE PROBLEM

UNDER CONSTRUCTION

PREREQUISITES

  • NODEMON: FOLLOW THE INSTRUCTIONS HERE.
  • TYPESCRIPT: FOLLOW THE INSTRUCTIONS HERE.

CONFIGURATIONS

  • ADD THE FOLLOWING PROPERTY TO package.json:

    "imports":{
        "#pathJavascriptExamples/*": "./folderSource/folderTopics/*",
        "#pathTypescriptExamples/*": "./folderDist/folderTopics/*"
    },
  • ADD THE FOLLOWING PROPERTY IN compilerOptions OF tsconfig.json (ONLY IF WORKING WITH TYPESCRIPT):

    // ADDED BY ME
    "paths": {
        "#pathJavascriptExamples/*": ["./folderSource/folderTopics/*"],
        "#pathTypescriptExamples/*": ["./folderDist/folderTopics/*", "./folderSource/folderTopics/*"]
    },
    /////

EXAMPLE WITH JAVASCRIPT

npx nodemon ./folderSource/folderTopics/folderPathAlias/examplePathAlias.js

EXAMPLE WITH TYPESCRIPT

npm run tsc-nodemon --jsfile=./folderDist/folderTopics/folderPathAlias/examplePathAlias.js