V
V
Viktor Babiy2018-09-19 16:40:58
JavaScript
Viktor Babiy, 2018-09-19 16:40:58

TypeScript import from subdirectory?

There is a module with the following folder structure: (module1)
5ba2508b9b543402423359.png
This module will be imported in another module (module2)
How to make it so that only a single file can be imported from the Navigator/index.ts folder

module2

import { someFunc } from 'module1/Navigator'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Demian Smith, 2018-09-19
@search

If `someFunc` is supposed to be stored in its own file, then `Navigator/index.ts` should contain the line `export * from './some-func'`. Where some-func is the name of the file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question