1👍
✅
Step 1
Add loader config in vue.config.js
chainWebpack: (config) => {
config.output.filename("[name].[hash:8].js");
const types = ["vue-modules", "vue", "normal-modules", "normal"];
types.forEach((type) =>
addStyleResource(config.module.rule("scss").oneOf(type))
);
config.module
.rule("thejs")
.test(/\.js$/)
.include.add(path.resolve("src"))
.add(path.resolve("node_modules/element-ui/packages"))
.end()
.use("babel-loader")
.loader("babel-loader")
.end();
},
Step 2
Install these two packages for compiling JSX
babel-helper-vue-jsx-merge-props & babel-loader
Step 3
Add babel.config.js
file to the root directory
Also add the following code to it
module.exports = {
presets: ["@vue/app"],
};
Don’t forget to restart the app
Source:stackexchange.com