parcel-plugin-vue-inlinesvg

1.0.4 • Public • Published

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

Package Sidebar

Install

npm i parcel-plugin-vue-inlinesvg

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

21.8 kB

Total Files

15

Last publish

Collaborators

  • seanogdev