Skip to content

Commit

Permalink
Drop support for jsnext:main
Browse files Browse the repository at this point in the history
  • Loading branch information
zspecza committed Nov 23, 2016
1 parent 029808b commit e00c897
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,14 @@ Check out the [vuex-async](https://github.com/declandewet/vue-meta/tree/master/e

Credit & Thanks for this feature goes to [Sébastien Chopin](https://github.com/Atinux).

## Why doesn't `vue-meta` support `jsnext:main`?

Originally, it did - however, it caused [problems](https://github.com/declandewet/vue-meta/issues/25). Essentially, Vue [does not support](https://github.com/vuejs/vue/issues/2880) `jsnext:main`, and does not introspect for the `default` property that is transpiled from the ES2015 source, thus breaking module resolution.

Given that `jsnext:main` is a non-standard property that won't stick around for long, and `vue-meta` is bundled into one file with no dynamic module internals as well as the fact that if you're using `vue-meta`, you're 99.9% likely to not be using it conditionally - the decision has been made to drop support for it entirely.

If this were not the case, you would have to instruct Babel to convert `default` imports to the proper commonjs module syntax via a plugin, which is not ideal since many users in the Vue landscape write their code in TypeScript, not Babel.

# Examples

To run the examples; clone this repository & run `npm install` in the root directory, and then run `npm run dev`. Head to http://localhost:8080.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"webpack-dev-server": "beta"
},
"homepage": "https://github.com/declandewet/vue-meta",
"jsnext:main": "lib/jsnext/vue-meta.js",
"keywords": [
"attribute",
"google",
Expand All @@ -74,7 +73,6 @@
],
"license": "MIT",
"main": "lib/vue-meta.js",
"module": "lib/jsnext/vue-meta.js",
"nyc": {
"exclude": [
"test/**/*.js"
Expand Down
3 changes: 1 addition & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ const pkg = require('./package.json')
export default {
entry: './src/index.js',
targets: [
{ dest: pkg.main, format: 'umd', moduleName: 'VueMeta' },
{ dest: pkg['jsnext:main'], format: 'es' }
{ dest: pkg.main, format: 'umd', moduleName: 'VueMeta' }
],
plugins: [
json(),
Expand Down

1 comment on commit e00c897

@qgustavor
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.