Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

Forcing babel-preset-2015 #95

Closed
hogart opened this issue Jun 5, 2016 · 3 comments
Closed

Forcing babel-preset-2015 #95

hogart opened this issue Jun 5, 2016 · 3 comments

Comments

@hogart
Copy link

hogart commented Jun 5, 2016

Hi, I'm making an app which is targeted to modern browsers (which support ES2015 more than 90%), and basically I need babel only for modules support. So I use custom .babelrc, without preset and only with 1 plugin. This reduces resulting bundle and speeds up development.

Unfortunately, latest version of vueify throws errors:
npm install --save-dev babel-preset-es2015 while parsing file: SomeComponent.vue. While this can be quite easily solved by installing said preset, I'd prefer not to clatter my package.json. Can this be solved somehow?

@zigomir
Copy link
Contributor

zigomir commented Jun 24, 2016

@hogart I totally agree. Actually removing or commenting out these lines will get you building vue apps with only two dependencies (vue and vueify), which is kinda really nice.

Only then you need to use commonjs modules in <script> tags like so

<script>
module.exports = {
  data () {
    return {
      msg: 'Hello Vue 2.0!'
    }
  }
}
</script>

instead of

<script>
export default {
  data () {
    return {
      msg: 'Hello Vue 2.0!'
    }
  }
}
</script>

which you already probably know ;)

I might be missing something out, because I only tried it on most trivial hello world example app, but I'd love to be able to use less dependencies too.

@yyx990803 what do you think? We still probably want to keep es2015 as default. I'm working on a solution where you'd say <script lang="noncompiled"> (or something like that) and be able to skip all babel stuff.

This was referenced Jun 24, 2016
@zigomir
Copy link
Contributor

zigomir commented Jun 30, 2016

@hogart #105

@hogart
Copy link
Author

hogart commented Jun 30, 2016

@zigomir awesome!

@hogart hogart closed this as completed Jun 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants