Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 838 Bytes

README.md

File metadata and controls

46 lines (39 loc) · 838 Bytes

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>