Need for transpiling to ES5



  • Anyone got any opinions on this? I don’t know what would be involved in changing a Vue/Quasar project to stay at ES6 (whilst still compressing, packing, etc.). But it would be interesting to see the performance differences…


  • Admin

    I’d say we’re still behind the day when we won’t need Babel transpilation. There are still plenty of browsers out there with big market share that don’t support ES6.
    However, haven’t done the experiment but you can just remove babel loaders within build/webpack.base.conf.js (from ‘module: rules’). Example:

    { // remove completely this entry
            test: /\.js$/,
            loader: 'babel-loader',
            include: projectRoot,
            exclude: /(node_modules|external)/
          },
          {
            test: /\.vue$/,
            loader: 'vue-loader',
            options: {
              postcss: cssUtils.postcss,
              loaders: merge(
                 {js: 'babel-loader'}, // << REMOVE; merge() also becomes useless
                cssUtils.styleLoaders({
                  sourceMap: useCssSourceMap,
                  extract: env.prod
                })
               )
            }
          }
    

    Might be other places where babel needs to be removed. Do a further search for ‘babel’ in /build and /config.
    Would be an interesting experiment. If you got time, drop a message how it went.

    Cheers.



  • I’m way behind the curve on babel, but I didn’t find any other references to it. However, I am using ES6 modules, which isn’t really supported in browsers at all yet, so I guess I will still need it. A couple of other options are this though: https://github.com/babel/babel-preset-env, and also babel-preset-modern-browsers. I tried those, but the code size generated was practically the same, and I don’t have enough time at the moment to do proper performance testing. I guess at least the option is there though as browsers evolve.


Log in to reply
 

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.