How to avoid ugly imports in TS Triple-Slash Directives Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceTest if a variable is a list or tupleAccessing a property in a parent Component in Angular2 with TypeScriptTypescript. Are Triple-Slash references still required when using “import from”Cannot find module './in-memory-data-service' in tour of heroes for Angular2TypeScript 2: Using Namespaces without reference Triple-Slash DirectiveHow to define a typescript import path relative to some root (using webpack)?How to use typescript triple-slash reference comments to import another module and use the functions?importing global.d.ts without triple-slash directivesTriple-slash references when splitting namespaces across files?Using typings.d.ts in Angular library without tripple-slash reference
Make it rain characters
Can't figure this one out.. What is the missing box?
How to say that you spent the night with someone, you were only sleeping and nothing else?
Can smartphones with the same camera sensor have different image quality?
Cold is to Refrigerator as warm is to?
Is there folklore associating late breastfeeding with low intelligence and/or gullibility?
If I can make up priors, why can't I make up posteriors?
Using "nakedly" instead of "with nothing on"
How did the aliens keep their waters separated?
Writing Thesis: Copying from published papers
How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time
How do I automatically answer y in bash script?
What are the performance impacts of 'functional' Rust?
Is it possible to ask for a hotel room without minibar/extra services?
Why is there no army of Iron-Mans in the MCU?
How many spell slots should a Fighter 11/Ranger 9 have?
Complexity of many constant time steps with occasional logarithmic steps
If A makes B more likely then B makes A more likely"
Array/tabular for long multiplication
Is above average number of years spent on PhD considered a red flag in future academia or industry positions?
Does the STL have a way to apply a function before calling less than?
How to rotate it perfectly?
Stop battery usage [Ubuntu 18]
Who can trigger ship-wide alerts in Star Trek?
How to avoid ugly imports in TS Triple-Slash Directives
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceTest if a variable is a list or tupleAccessing a property in a parent Component in Angular2 with TypeScriptTypescript. Are Triple-Slash references still required when using “import from”Cannot find module './in-memory-data-service' in tour of heroes for Angular2TypeScript 2: Using Namespaces without reference Triple-Slash DirectiveHow to define a typescript import path relative to some root (using webpack)?How to use typescript triple-slash reference comments to import another module and use the functions?importing global.d.ts without triple-slash directivesTriple-slash references when splitting namespaces across files?Using typings.d.ts in Angular library without tripple-slash reference
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have a nested order structure. If I now used the triple slash directives, I have a long data path depending on the file like this:
/// <reference path="../../../../global.d.ts" />
The question I'm asking myself now is there a way to stop it from doing this?
typescript types
add a comment |
I have a nested order structure. If I now used the triple slash directives, I have a long data path depending on the file like this:
/// <reference path="../../../../global.d.ts" />
The question I'm asking myself now is there a way to stop it from doing this?
typescript types
add a comment |
I have a nested order structure. If I now used the triple slash directives, I have a long data path depending on the file like this:
/// <reference path="../../../../global.d.ts" />
The question I'm asking myself now is there a way to stop it from doing this?
typescript types
I have a nested order structure. If I now used the triple slash directives, I have a long data path depending on the file like this:
/// <reference path="../../../../global.d.ts" />
The question I'm asking myself now is there a way to stop it from doing this?
typescript types
typescript types
edited Mar 22 at 9:26
Pureferret
3,351954110
3,351954110
asked Mar 22 at 7:21
CkappoCkappo
121111
121111
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Since TypeScript 1.5 (see section "Lightweight, portable projects"), the syntax /// <reference is replaced by a configuration file tsconfig.json.
An example for Node.js:
// tsconfig.json
"compilerOptions":
"module": "commonjs",
"target": "es6",
"outDir": "dist"
,
"exclude": [
"dist",
"node_modules"
]
In the tsconfig.json file, include and exclude properties can be defined. When an exclude property is defined, then all the rest is by default included. Now your project could look like:
- project-directory/
|- dist/
|- node_modules/
|- src/
|- global.d.ts
|- path/to/other/files.ts
|- tsconfig.json
ok so in the tsconfig.json I can... include the global.d.ts? Can you give me an example with the global.d.ts? Should it be in the path object?
– Ckappo
Mar 22 at 10:06
@Ckappo I edited. If you exclude something, all the rest will be included. You can putglobal.d.tsin the project root directory or in any non-excluded sub-directory.
– Paleo
Mar 22 at 10:28
Ty Paleo. Works like I want
– Ckappo
Mar 25 at 8:23
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55294686%2fhow-to-avoid-ugly-imports-in-ts-triple-slash-directives%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Since TypeScript 1.5 (see section "Lightweight, portable projects"), the syntax /// <reference is replaced by a configuration file tsconfig.json.
An example for Node.js:
// tsconfig.json
"compilerOptions":
"module": "commonjs",
"target": "es6",
"outDir": "dist"
,
"exclude": [
"dist",
"node_modules"
]
In the tsconfig.json file, include and exclude properties can be defined. When an exclude property is defined, then all the rest is by default included. Now your project could look like:
- project-directory/
|- dist/
|- node_modules/
|- src/
|- global.d.ts
|- path/to/other/files.ts
|- tsconfig.json
ok so in the tsconfig.json I can... include the global.d.ts? Can you give me an example with the global.d.ts? Should it be in the path object?
– Ckappo
Mar 22 at 10:06
@Ckappo I edited. If you exclude something, all the rest will be included. You can putglobal.d.tsin the project root directory or in any non-excluded sub-directory.
– Paleo
Mar 22 at 10:28
Ty Paleo. Works like I want
– Ckappo
Mar 25 at 8:23
add a comment |
Since TypeScript 1.5 (see section "Lightweight, portable projects"), the syntax /// <reference is replaced by a configuration file tsconfig.json.
An example for Node.js:
// tsconfig.json
"compilerOptions":
"module": "commonjs",
"target": "es6",
"outDir": "dist"
,
"exclude": [
"dist",
"node_modules"
]
In the tsconfig.json file, include and exclude properties can be defined. When an exclude property is defined, then all the rest is by default included. Now your project could look like:
- project-directory/
|- dist/
|- node_modules/
|- src/
|- global.d.ts
|- path/to/other/files.ts
|- tsconfig.json
ok so in the tsconfig.json I can... include the global.d.ts? Can you give me an example with the global.d.ts? Should it be in the path object?
– Ckappo
Mar 22 at 10:06
@Ckappo I edited. If you exclude something, all the rest will be included. You can putglobal.d.tsin the project root directory or in any non-excluded sub-directory.
– Paleo
Mar 22 at 10:28
Ty Paleo. Works like I want
– Ckappo
Mar 25 at 8:23
add a comment |
Since TypeScript 1.5 (see section "Lightweight, portable projects"), the syntax /// <reference is replaced by a configuration file tsconfig.json.
An example for Node.js:
// tsconfig.json
"compilerOptions":
"module": "commonjs",
"target": "es6",
"outDir": "dist"
,
"exclude": [
"dist",
"node_modules"
]
In the tsconfig.json file, include and exclude properties can be defined. When an exclude property is defined, then all the rest is by default included. Now your project could look like:
- project-directory/
|- dist/
|- node_modules/
|- src/
|- global.d.ts
|- path/to/other/files.ts
|- tsconfig.json
Since TypeScript 1.5 (see section "Lightweight, portable projects"), the syntax /// <reference is replaced by a configuration file tsconfig.json.
An example for Node.js:
// tsconfig.json
"compilerOptions":
"module": "commonjs",
"target": "es6",
"outDir": "dist"
,
"exclude": [
"dist",
"node_modules"
]
In the tsconfig.json file, include and exclude properties can be defined. When an exclude property is defined, then all the rest is by default included. Now your project could look like:
- project-directory/
|- dist/
|- node_modules/
|- src/
|- global.d.ts
|- path/to/other/files.ts
|- tsconfig.json
edited Mar 22 at 10:25
answered Mar 22 at 8:50
PaleoPaleo
9,4782343
9,4782343
ok so in the tsconfig.json I can... include the global.d.ts? Can you give me an example with the global.d.ts? Should it be in the path object?
– Ckappo
Mar 22 at 10:06
@Ckappo I edited. If you exclude something, all the rest will be included. You can putglobal.d.tsin the project root directory or in any non-excluded sub-directory.
– Paleo
Mar 22 at 10:28
Ty Paleo. Works like I want
– Ckappo
Mar 25 at 8:23
add a comment |
ok so in the tsconfig.json I can... include the global.d.ts? Can you give me an example with the global.d.ts? Should it be in the path object?
– Ckappo
Mar 22 at 10:06
@Ckappo I edited. If you exclude something, all the rest will be included. You can putglobal.d.tsin the project root directory or in any non-excluded sub-directory.
– Paleo
Mar 22 at 10:28
Ty Paleo. Works like I want
– Ckappo
Mar 25 at 8:23
ok so in the tsconfig.json I can... include the global.d.ts? Can you give me an example with the global.d.ts? Should it be in the path object?
– Ckappo
Mar 22 at 10:06
ok so in the tsconfig.json I can... include the global.d.ts? Can you give me an example with the global.d.ts? Should it be in the path object?
– Ckappo
Mar 22 at 10:06
@Ckappo I edited. If you exclude something, all the rest will be included. You can put
global.d.ts in the project root directory or in any non-excluded sub-directory.– Paleo
Mar 22 at 10:28
@Ckappo I edited. If you exclude something, all the rest will be included. You can put
global.d.ts in the project root directory or in any non-excluded sub-directory.– Paleo
Mar 22 at 10:28
Ty Paleo. Works like I want
– Ckappo
Mar 25 at 8:23
Ty Paleo. Works like I want
– Ckappo
Mar 25 at 8:23
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55294686%2fhow-to-avoid-ugly-imports-in-ts-triple-slash-directives%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown