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.

vue-cli-service compiling time increase drastically when svg-spritemap-webpack-plugin is added

See original GitHub issue

I am using webpack@4.28.4 on a VueJS 2.6.10 project, and “svg-spritemap-webpack-plugin”: “3.3.7” My vue.config.js looks like :

const SVGSpritemapPlugin = require("svg-spritemap-webpack-plugin");

module.exports = {
  devServer: {
    port: "8082"
  },
  configureWebpack: {
    plugins: [
      new SVGSpritemapPlugin()
    ]
  }
};

The compiling time was ~150ms before installing the plugin, after installation it went to ~8000ms. I’ve commented the line new SVGSpritemapPlugin() and the compiling time went back to normal (around 150ms)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wal0xcommented, Jul 23, 2019

I investigated the spritemap I found two symbol tags. I rendred the svg and “surprisingly” I found two diagrams I have never seen before and I have no idea where it come from. (5min later)… I found the two SVGs in two dependencies in my node_modules. To tell the plugin to look for SVGs only inside the svgs folder I changed my vue.config.js to look like this :

const SVGSpritemapPlugin = require("svg-spritemap-webpack-plugin");

module.exports = {
  devServer: {
    port: "8082"
  },
  configureWebpack: {
    plugins: [new SVGSpritemapPlugin("svgs/**/*.svg")]
  }
};

My folder s tree is like this :

|__node_modules
|__public
|__src
|__svgs
|__vue.config.js
|...

And the problem is SOLVED

0reactions
cascornelissencommented, Jul 23, 2019

That’s probably because it’s matching more SVGs but I can’t know for sure without a configuration object. You could open the spritemap SVG in an editor and check some id’s of the symbols, that might help finding the SVGs.

The best way is to pass a specific glob as the first argument instead of using the default that just matches all SVGs recursively.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue-cli-service build crash · Issue #7180 - GitHub
Count me in, I picked a bad time to try and prune our peer dependencies - was sure it was something I'd done....
Read more >
Unable to run "vue-cli-service serve" [vue 3] - Stack Overflow
A couple issues: Your project depends on vue-cli-service 4.x (which only uses Webpack 4) and on webpack 5. For Webpack 5, vue-cli-service ......
Read more >
CLI Service - Vue CLI
Inside a Vue CLI project, @vue/cli-service installs a binary named vue-cli-service . You can access the binary directly as vue-cli-service in ...
Read more >
Speed Up Your Vue.js Single-Page App - Sommer IT Consulting
With Vue.js you are able to quickly build a Single Page application. ... component can drastically increase your rendering performance.
Read more >
How to Migrate from Vue CLI to Vite - Vue School Blog
Learn how to migrate from Vue CLI to Vite in 9 simple steps for a faster and more streamlined developer experience.
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