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

Declare esprima as dependency in package.json #16

Merged
merged 1 commit into from
Aug 6, 2017
Merged

Declare esprima as dependency in package.json #16

merged 1 commit into from
Aug 6, 2017

Conversation

troglotit
Copy link

@troglotit troglotit commented Jul 27, 2017

When I use vue-styleguidist to create a client-side npm-project when I declare styleguidist as a dependency, and because of esprima package is not specified explicitly in package.json - it gets resolved differently. I did see 2.7.3 and 4.0.0 versions in both of my yarn and npm lockfiles, but yarn resolves to 2.7.3 while npm to 4.0.0 in first-level node_modules folder. And Esprima at 2.7.3 used UMD, and for that, syntax like

import esprima from 'esprima'
esprima.parse() // -- is ok

But for 4.0.0 Esprima migrated to Typescript (I think they migrated in 3.0.0 version), and it uses ES modules. And for that, former usage of module would break (because of how named exports).

import { parse } from 'esprima'
parse() // -- this would work

I tried to verify if it works, but because of #15 I couldn't verify it 😅.

Hope everything's clear, feel free to ask anything or edit PR!

@rafaesc
Copy link
Member

rafaesc commented Aug 4, 2017

Thanks for the contribution!

I'll update the package on the weekend

@rafaesc rafaesc merged commit a51a8e1 into vue-styleguidist:master Aug 6, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants