Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const/let converto var #2070

Open
zacard-orc opened this issue Apr 6, 2024 · 0 comments
Open

const/let converto var #2070

zacard-orc opened this issue Apr 6, 2024 · 0 comments

Comments

@zacard-orc
Copy link

hi , i want to use webpack in chrome <40, but can't run normally when use default config in babel/vue-loader

i try to use these terms, but not work

 {
            test: /\.vue$/,
            loader: 'vue-loader',
            options: {
                transformAssetUrls: {
                    video: ['src', 'poster'],
                    source: 'src',
                    img: 'src',
                    image: 'xlink:href'
                },
                babelPresets: ['@babel/preset-env'],
                babelPlugins: ['@babel/plugin-transform-block-scoping']
            }          
        }

the phrase 1 converted js also has const/let keyword, eg:

import { render } from "./TabList.vue?vue&type=template&id=71e458cc"
import script from "./TabList.vue?vue&type=script&lang=js"
export * from "./TabList.vue?vue&type=script&lang=js"

import "./TabList.vue?vue&type=style&index=0&id=71e458cc&lang=scss"

import exportComponent from "/Users/macbookpro/Documents/mylab/vue3_wp5/node_modules/vue-loader/dist/exportHelper.js"
const __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])

export default __exports__
const __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])

these middleware file will save into webpack dist file,just like

        const u = (0, i.Z)(o, [["render", function (n, t, o, i, u, c) {
            return (0, e.openBlock)(), (0, e.createElementBlock)("div", l, [r, (0, e.createElementVNode)("div", {
                class: "tab-area",
                ref: "rfTab",
                onScroll: t[1] || (t[1] = function () {
                    return n.onScroll && n.onScroll.apply(n, arguments)
                })
            }, 

so , it can't nor run in chrome<43, chrome will throw error about const/let

how can i config the file to transform "const exports = /#PURE/exportComponent(script, [['render',render]])"
to "var exports = /#PURE/exportComponent(script, [['render',render]])"

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant