Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No default export #499

Open
MaxSvargal opened this issue Feb 16, 2019 · 3 comments
Open

No default export #499

MaxSvargal opened this issue Feb 16, 2019 · 3 comments

Comments

@MaxSvargal
Copy link

I use npm package within TypeScript and there are no default exports.
Can you add a module prop to package.json?

@Trufi
Copy link
Contributor

Trufi commented Feb 19, 2019

module field point to a module that has ES2015 module syntax. We don't have this module syntax, how can it help you?

@MaxSvargal
Copy link
Author

@Trufi How to use the npm package? There are no any exports.

@Trufi
Copy link
Contributor

Trufi commented Feb 19, 2019

We have main field, which points to a bundle with commonjs module syntax.

import DG from '2gis-maps'; should works with ES2015 module syntax.

But If you use TypeScript, you must add typings for any package. We have no own typings, and you have to do it yourself.

For example, you can create project.d.ts and add:

declare module "2gis-maps" {
  const _: any;
  export default _;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants