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

Import an SVG file and use it directly with Parcel.js and Vue 2.0

Notifications You must be signed in to change notification settings

seanogdev/parcel-plugin-vue-inlinesvg

Repository files navigation

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

About

Import an SVG file and use it directly with Parcel.js and Vue 2.0

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages