Enable loading of .vue files from npm packages #214
Merged
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.
There are quite a few Vue packages on npm where the author doesn't provide a compiled version. This change allows users to load
.vuefiles from npm packages, e.g.import Dropdown from 'vue-my-dropdown';.Without this, attempting to import a .vue file from an npm package causes the following error:
The second commit fixes an issue with esModule detection (Meteor modules use a esModule symbol but most transpiled modules are looking for a simple
__esModuleproperty). In combination with the above, this enables the use of packages such asvue-progressbar(#177).An example project (not including the
vue-component) can be found here: https://github.com/nathantreid/vue-component-test/tree/load-vue-component-from-npm.If you're good with this change I can also update the npm section of the vue-component documentation.