1

I have this one typescript library being shared with all other projects. Sort of like a commons library. The "main" configured inside the package.json is the index.js. I find myself manually importing and then exporting all the individual modules from this project's source into the main index.js. Is there a better way to export them all much like how public classes are all exposed in Java?

1
  • External modules are external and they're not a part of javascript's functionalities. Commented Apr 20, 2019 at 0:56

1 Answer 1

2

No, this isn't possible. All ECMAScript modules (which TypeScript compiles to) must explicitly export any object they wish to import elsewhere. Nothing can be implicitly exported or imported.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.