Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Latest commit

 

History

History
48 lines (31 loc) · 1 KB

README.md

File metadata and controls

48 lines (31 loc) · 1 KB

parcel-plugin-vue-inlinesvg

This plugin allows you to import an SVG file and use it directly with Vue, using the Parcel.js bundler. The SVG itself is rendered inline.

This plugin also minifies and optimizes the SVG through SVGO.

Note You must install parcel-plugin-vue in order to use this plugin.

Installation

Install this package via npm

npm i -D parcel-plugin-vue-inlinesvg parcel-plugin-vue

Usage

When starting the Parcel bundler you should run it with the --no-cache argument

In your Vue component, import thie SVG directly as if it were any other ES module.

<template>
  <div>
    <logo />
  </div>
</template>

<script>
  import Logo from '/assets/logo.svg';

  export default {
    components: {
      Logo,
    }
    data() {
    }
  }
</script>

TODO