Closed a857430369 closed 2 years ago
tl;dr Q: Is Vue3 supported? A: Yes.
The loader is designed for processing the text as a Webpack Loader. So it is irrelevant to the file type nor the frontend framework.
If you are working with @vue/cli
(tested with 5.0.1):
//vue.config.js
const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
transpileDependencies: true,
chainWebpack: (config) => {
config.module
.rule("vue")
.test(/\.vue$/)
.use("webpack-preprocessor-loader")
.loader("webpack-preprocessor-loader")
.options({
params: {
oops: false,
},
})
.end();
},
});
<template>
<img alt="Vue logo" src="./assets/logo.png">
<!-- #!if oops -->
<h1> This heading should be hidden. </h1>
<!-- #!endif -->
<HelloWorld msg="Welcome to Your Vue.js App"/>
</template>
Read the doc: https://cli.vuejs.org/guide/webpack.html#adding-a-new-loader https://github.com/neutrinojs/webpack-chain#getting-started