vue-svg-component-loader
v1.0.0
Published
zero-dependency webpack loader that turns SVG files into Vue components
Downloads
2
Readme
vue-svg-component-loader
Zero-dependency webpack loader that turns SVG files into Vue components. This loader doesn't do anything else.
Installation
npm install vue-svg-component-loader --save-dev
Configuration
module.exports = {
module: {
rules: [
{
test: /\.svg$/,
use: [
'raw-loader', // not included, install separately
'svgo-loader', // not included, install separately
'vue-svg-component-loader',
],
},
],
},
};
Usage
<template>
<div>
<AppLogo />
</div>
</template>
<script>
import AppLogo from 'path/to/logo.svg';
export default {
components: {
AppLogo,
},
};
</script>