Friday, 29 March 2019

How to import node-js dependency in webpack project if package already includes types definitions?

chalk library already includes types definitions, and there is no need to use deprecated @types/chalk package. However, I got error TS2307: Cannot find module 'chalk'.

enter image description here

The chalk library project structure is:

enter image description here

What I did wrong? I tried colors.js library instead - same error.

Node: my project is build by Webpack for Node.js. Off course, webpack has been configured for node (includes target: 'node' option and nodeExternals plugin usage).



from How to import node-js dependency in webpack project if package already includes types definitions?

No comments:

Post a Comment