Skip to content

Conversation

@daun
Copy link
Contributor

@daun daun commented Apr 2, 2020

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_modules folder to webpack’s module resolver. Should be backwards-compatible since Twill’s node_modules folder still has preference.

Before

Default resolve order: ['node_modules'].

After

New resolve order: ['node_modules', '../../../node_modules']

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_modules` folder to webpack’s module resolver. Should be backwards-compatible since Twill’s `node_modules` folder still has preference.

Default resolve order: `['node_modules']`.

New resolve order: `['node_modules', '../../../node_modules']`
@ifox ifox merged commit 360d82c into area17:2.x May 24, 2020
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