No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Need for transpiling to ES5

    Help
    2
    3
    1792
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dsl101 last edited by

      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…

      1 Reply Last reply Reply Quote 0
      • rstoenescu
        rstoenescu Admin last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • D
          dsl101 last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post