Skip to content

hewson99/vue-enhance-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

webpack loader plugin

this loader allows you to resue component's template and don't need to create the SFC file for the component

<component name="welcome">
    <HelloWorld msg="Welcome to Your Vue.js App"/>
</component>
<component name="mytitle">
    <h1>title</h1>
</component>

<template>
  <div id="app">
    <h1>with vue-enhance-loader</h1>
    <mytitle />
    <welcome />
    <mytitle />
    <welcome />
  </div>
</template>

<sciprt>
import HelloWorld from 'path/to/...' 
export default {
  component: {
    HelloWorld
  }
}
</sciprt>

How to Use

it's very simple and easy to use.

// in vue.config.js
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  chainWebpack(config) {
    config.module
    .rule('vue')
    .use('my-enhance-vue-loader')
    .loader('path/to/vue-enhance-loader.js')
  }
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published