A webpack loader to compiles ts to vue file and auto append template html
To begin, you'll need to install vue-loader and vue-tsx-loader:
npm install vue-loader vue-tsx-loader --save-dev
yarn add vue-loader vue-tsx-loader --save-dev
Then add the loader to your webpack config. For example:
module.exports = {
module: {
rules: [
{
test: /\.vue$/,
user: "vue-loader",
},
{
test: /\.tsx$/,
use: ["vue-loader", "vue-tsx-loader"],
},
],
},
};
<div>Component</div>
import { defineComponent } from 'vue';
import './app.less'
export default defineComponent({
})
you'll need to install jade npm install jade --save-dev
and rename app.html to app.jade
webpack.config.js
{
test: /\.tsx$/,
use: ["vue-loader", "vue-tsx-loader?template=jade"],
}
vue-tsx-loader set options template=jade