Skip to content

[5.7] Remove lodash dependency when auto registering Vue components #4853

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

Merged
merged 1 commit into from
Nov 13, 2018
Merged

[5.7] Remove lodash dependency when auto registering Vue components #4853

merged 1 commit into from
Nov 13, 2018

Conversation

aryehraber
Copy link
Contributor

Love this new addition, but don't often use the full Lodash library. By using pop() instead of _.last(), everything will continue to work without Lodash being pulled in from bootstrap.js.

@reinink
Copy link
Contributor

reinink commented Nov 13, 2018

This is tight. Could even make this a one-liner if you wanted:

const files = require.context('./', true, /\.vue$/i)
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key)))

@taylorotwell taylorotwell merged commit dc3e768 into laravel:master Nov 13, 2018
@aryehraber
Copy link
Contributor Author

@reinink I like it, I'll submit an additional PR

@aryehraber aryehraber deleted the patch-2 branch November 13, 2018 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.

3 participants