![]() ![]() "typeRoots":, /* Specify multiple folders that act like */ "rootDirs":, /* Allow multiple folders to be treated as one when resolving modules. "paths":, /* Specify a set of entries that re-map imports to additional lookup locations. "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. "rootDir": "./src", /* Specify the root folder within your source files. "module": "commonjs", /* Specify what module code is generated. "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. "noLib": true, /* Disable including any library files, including the default lib.d.ts. This only applies when targeting 'react' JSX emit. "reactNamespace": "", /* Specify the object invoked for 'createElement'. "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. "jsx": "preserve", /* Specify what JSX code is generated. ![]() "lib":, /* Specify a set of bundled library declaration files that describe the target runtime environment. "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. ![]() "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. tsbuildinfo incremental compilation file. "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to. "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. tsbuildinfo files to allow for incremental compilation of projects. I have attached a screenshot of the project structure and the difference between my dev version and the build version. However my build directory needs to go a folder above to find the html file rather than my where my ts file is located. I have some npm scripts defined which allows me to run dev or do a build. I am trying out express and I am using npm and typescript. Also when using library like multer defining folder path etc the first methods seems to work better with all environmentĬurrently i am confused, so i am asking the community for more feedback. įor example: In the past i used to use the suggested method, but when working in windows sometimes the chances of getting error while defining the path for files in larger projects or possibly due to human error in specifying number of dots. this is how i use the same in all other filesĬonst commands = require(_base + "app/service/commands") īut from my past experience suggested method in the feedback seems to hit issues when developers are working / using different environment. This is how i import my files // this is a one time declaration so that i can use `_base` every where in the project "require("./app/service/commands") " works just as well. Replacing "require(_base + "app/service/commands") " with There is no need to define _base and use it to require js files. I recently got a feedback for one of my open Nodejs project on github and asked me to improve how i define path to import files or folder path into my Nodejs project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |