Inside node_modules
there is directory:
data/lib/
With files:
index.js
index.ts
Data.js
Data.ts
How to use this module using import?
I have tried:
import import * as d from 'data/lib';
I says that:
`index.d.ts' is not a module
File `index.d.ts' is empty
You need an index.d.ts
beside the index.js
. You need to generate a build from your .ts
files to be able to import it in other projects. There is a property on tsconfig.json
called declaration that you can set to true, and then when you call tsc
to generate your build, it will create the .d.ts
files automatically for you. Take a look .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.