Code Monkey home page Code Monkey logo

laravel-mix-vue-svgicon's People

Contributors

excellentingenuity avatar mikaeljorhult avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-mix-vue-svgicon's Issues

Using the package with testing suite like jest

Thanks for the package as it has been very useful.

I am having an issue where using this package seems to break the jest test with errors like:

 Error: Cannot find module 'SVGPATH/foo.svg' from 'Icon.vue'

I am using the SVGPath in a vue component as follows:

// Icon.vue

getIcon(icon) {
 return require(`SVGPATH/${icon}.svg`);
}

Tried adding the following to jest.setup.js but no luck:

const mix = require('laravel-mix');
require('laravel-mix-vue-svgicon');

Is there any way we can get this working with the test suite? Thanks.

Version 3

Hi there,

First of all, is this package still alive?

I found out there's a v3.01 available through this link , but it's not listed here on Github.

When using the v3 package, I get the following error:

[webpack-cli] TypeError: Cannot redefine property: tap

I'm using laravel-mix v6.

What can I do to fix this?

Object not rendered

Updating the code to 2.1.1 version an error occurred on frontend.

Instead of showing the correct .svg file traslating the <template> code, on frontend it's still the same of the the IconComponent.vue, like this.

<object data="require(SVGPATH/${icon}.svg)" type="${icon}.svg" class="fill-current margin-right-16 width-16"></object>

Why?

Here's the code my webpack.min.js

const mix = require('laravel-mix')
require('laravel-mix-vue-svgicon')
mix.svgicon('./node_modules/svg-repository')

and on my example.vue

import Icon from 'laravel-mix-vue-svgicon/IconComponent.vue'
<icon :icon="logo" />

Thanx

Relative path not correct, Can't resolve 'SVGPATH'

In the docs you say that the default path is ./../public/resources/svg to work with Adam Wathan's Blade SVG package. His package, which I have and works, uses the path resources/svg. If I have mix in the root directory the this should be the correct location since the default doesn't work:

const mix = require('laravel-mix');
require('laravel-mix-tailwind');
require('laravel-mix-purgecss');
require('laravel-mix-vue-svgicon');

mix.js('resources/js/erro.js', 'public/js')
    .sass('resources/sass/erro.scss', 'public/css')
    .tailwind('tailwind.config.js')
    .version()
    .svgicon('resources/svg/logo.svg')
    .purgeCss();

But I get the error Error: Can't resolve 'SVGPATH'.

I have also tried:

.svgicon('./resources/svg/logo.svg')

So not sure why its not working and if you want to be inline with Adam Wathan's package the default should point to /resources/svg/, not the public directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.