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

FIX: can't resolve json files #412

Merged
merged 2 commits into from
Dec 14, 2016

Conversation

zzhjerry
Copy link
Contributor

I installed Airtable's npm package and noticed it's using implicit require call require('./internal_config') where internal_config is a JSON file. So when I was using this package, webpack was throwing me errors since .json is not a resolvable extension in the config.

I believe this could also happen when other people use other 3rd party packages so I made this patch to fix it.

The implicit require call in Airtable: (https://github.com/Airtable/airtable.js/blob/454f4b3d952ec8f717bcfce841f3937f50bddea0/lib/run_action_with_jquery.js#L4)

@zzhjerry zzhjerry changed the title FIX: can't resolve json files in require call FIX: can't resolve json files Dec 14, 2016
@@ -20,7 +20,7 @@ module.exports = {
filename: '[name].js'
},
resolve: {
extensions: ['', '.js', '.vue'],
extensions: ['', '.js', '.json', '.vue'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should priorize .vue over .json, wouldn't you agree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, will make the modification right away

@LinusBorg LinusBorg self-assigned this Dec 14, 2016
@LinusBorg
Copy link
Contributor

Thanks!

@LinusBorg LinusBorg merged commit aceb839 into vuejs-templates:master Dec 14, 2016
@zzhjerry zzhjerry deleted the resolve-json-file branch December 14, 2016 15:38
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.

2 participants