systemjs / builder

SystemJS build tool
MIT License
466 stars 122 forks source link

[issue]considering support jsx in Vue? #861

Open cdll opened 5 years ago

cdll commented 5 years ago

i've got problem with bundling jsx render function in Vue2 with jspm build, such as:

//main.js
import('vue2')
.then(Vue=>{
  const vm= new Vue({
    data: {}
    ,el: '#AppMain'
    ,methods: {
      pageScrolling(){
        store.commit('pageScrolling', event.target.scrollTop)
      }
    }
    ,render(){
      return (
        <div id='AppMain' onScroll={this.pageScrolling}>
          <router-view></router-view>
          <mu-snackbar></mu-snackbar>
        </div>
      )
    }
  })
})

even after i 'd tried

//jspm.config.js
System.config({
  //...
  meta: {
    "*.js": {
      "babelOptions": {
        "es2015": true
        ,preset: ['vue']
        ,plugins: [
          "babel-plugin-transform-vue-jsx"
        ]
      }
    }
  },
  //...
})

but i used to use babel-plugin-transform-vue-jsx in my gulp and gulp-babel task to successly bundle my main.js. could anybody give me some help and thanks a lot~

cdll commented 5 years ago

the error that i got image