Give custom components access to project's npm dependencies #617
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Really excited about this one: allow custom Vue components to access node modules installed by the main app itself. This single change has allowed me to create things I could only dream of before 🥬 Might be the last PR you'll ever see from me since now there's nothing in Twill I can't customize.
What does it do?
Allow requiring node modules from the root project folder. Previously, custom Vue components could only use npm packages installed by Twill itself. With this change, any npm package from the main app can be required. We do this by adding the root
npm_modulesfolder to webpack’s module resolver. Should be backwards-compatible since Twill’snode_modulesfolder still has preference.Before
Default resolve order:
['node_modules'].After
New resolve order:
['node_modules', '../../../node_modules']