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

_setDefaults Syntax #282

Closed
kezike opened this issue Dec 19, 2018 · 4 comments
Closed

_setDefaults Syntax #282

kezike opened this issue Dec 19, 2018 · 4 comments

Comments

@kezike
Copy link

kezike commented Dec 19, 2018

function _setDefaults(options, {

When trying to include jsonld in webpack, I am discovering this seemingly incorrect syntax. For one, there seems to be an assignment within a JSON object in line 1049. Additionally, I am unclear of the propriety of the ellipsis before defaults in line 1050. Again, I am just a messenger of this webpack-generated error and I hope that we can resolve this soon.

@davidlehn
Copy link
Member

See also #279.

It's ES2018 Object spread syntax: https://github.com/tc39/proposal-object-rest-spread. I'm unsure what we'll do about this issue. If you're running webpack yourself you can use a babel plugin just like jsonld.js itself does: https://babeljs.io/docs/en/babel-plugin-transform-object-rest-spread.html.
See package.json for how it's used here.

@kezike
Copy link
Author

kezike commented Dec 20, 2018

Thanks a lot David! That makes a lot of sense. I was able to get around the webPack error after adding something similar to a rule in jsonld's webPack.config. However, I have been coming across another error around regeneratorRuntime not being defined. I think this points to the underlying issue of how to properly incorporate jsonld's webPack.config into another app's webPack.config so that everything is properly loaded and defined. Please let me know if this is a topic appropriate for a separate issue and where I should file that issue if so.

@kezike
Copy link
Author

kezike commented Dec 21, 2018

Check out transform-runtime here: https://babeljs.io/docs/en/babel-plugin-transform-runtime

@kezike kezike closed this as completed Dec 21, 2018
@chigix
Copy link

chigix commented May 19, 2019

A webpack friendly entry should be applied: #317

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