question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

copied svg asset broken

See original GitHub issue

i’am using flag-icon-css, and loaded by mix, some of the svg assets copied by mix to public/fonts are broken, but when copied manuelly work.

This is my mix config:

const { mix } = require('laravel-mix');

mix.disableNotifications();

mix
    .js('resources/assets/js/welcome/welcome-vendor.js', 'public/js')
    .js('resources/assets/js/welcome/welcome.js', 'public/js')
    .sass('resources/assets/sass/welcome/welcome-vendor.scss', 'public/css')
    .sass('resources/assets/sass/welcome/welcome.scss', 'public/css')
    .sourceMaps()
    .version();

is there a way to tel me mix to not copy these dependencies, or to use a custom shell script to copy dependencies?

Thank you for mix.disableNotification() 😃

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:28 (12 by maintainers)

github_iconTop GitHub Comments

11reactions
stephan-vcommented, Jun 22, 2017

Lmao here we go again. I have already made a issue about this previously but I guess we will just wait for more issues to coming flowing in. I find it absurd that all svg’s are treated as fonts per default.

7reactions
priithansencommented, Sep 20, 2017

It seems that starting with laravel-mix v1.4.3 we can manipulate the webpack config before its handed over for processing.

So in the meantime something like this is possible:

Mix.listen('configReady', (webpackConfig) => {

    // Add "svg" to image loader test
    let imageLoaderConfig = webpackConfig.module.rules.find(rule => String(rule.test) === String(/\.(png|jpe?g|gif)$/));

    imageLoaderConfig.test =  /\.(png|jpe?g|gif|svg)$/;
    imageLoaderConfig.exclude = /(fonts)/;

    // Exclude 'img' folder from font loader
    let fontLoaderConfig = webpackConfig.module.rules.find(rule => String(rule.test) === String(/\.(woff2?|ttf|eot|svg|otf)$/))

    fontLoaderConfig.exclude = /(assets\/img)/;

})
Read more comments on GitHub >

github_iconTop Results From Across the Web

copied svg asset broken · Issue #214 · laravel-mix ... - GitHub
i'am using flag-icon-css, and loaded by mix, some of the svg assets copied by mix to public/fonts are broken, but when copied manuelly...
Read more >
Why is my SVG failing to load in Vector Asset Studio
Android Studio's Vector Asset Studio is currently not support all the features of SVG. You can convert SVG to VectorDrawable using this tool....
Read more >
SVG Export Issue - Figma Community Forum
When I export svg and png versions, my svg exports are missing many elements from the original design and many elements become broken....
Read more >
SVGs broken - InVision Support
Any SVG dragged into Studio has recently appearing as open/broken paths ... I have copied and pasted the same SVGs into competitor products ......
Read more >
Image sets from Frameworks broken - Apple Developer
I have a framework (my own pod) that defines image sets as assets. They are exported as a bundle in the framework, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found