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

Not working for typescript #34

Closed
beeing opened this issue Nov 12, 2018 · 7 comments
Closed

Not working for typescript #34

beeing opened this issue Nov 12, 2018 · 7 comments

Comments

@beeing
Copy link

beeing commented Nov 12, 2018

After updating to latest version, typescript compiler will throw error on:

import * as glob from 'tiny-glob'

But this is fine in older version.

@terkelg
Copy link
Owner

terkelg commented Nov 14, 2018

I don't use TypeScript myself. Can you help and try to have a look at this?

@beeing
Copy link
Author

beeing commented Nov 15, 2018

Ok, I've tried fixing it and all we need is just replace = to default

export default glob

and to use:

import glob from 'tiny-glob'

@armano2
Copy link
Contributor

armano2 commented Nov 15, 2018

@beeing @terkelg you can use it like this:

import glob = require('tiny-glob');

https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require

@terkelg
Copy link
Owner

terkelg commented Nov 15, 2018

Thanks @beeing and @armano2. I assume no changes are needed in the source code then?

@armano2
Copy link
Contributor

armano2 commented Nov 15, 2018

you don't have to change code, but you can add this to documentation for newcomers

@beeing
Copy link
Author

beeing commented Nov 16, 2018

That works too. Thanks @armano2.

Only thing is the import statement looks different from the others using from keyword.

@terkelg
Copy link
Owner

terkelg commented Nov 17, 2018

Anyone open to doing a PR with an updated readme with TypeScript instructions?

@terkelg terkelg closed this as completed Feb 8, 2019
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

3 participants