[email protected] contains 115 MiB of vue-cli

Created on 10 Dec 2020  Â·  5Comments  Â·  Source: visualfanatic/vue-svg-loader

The npm package [email protected] contains 115 MiB of vue-cli – https://unpkg.com/browse/[email protected]/

Please re-package in a clean environment.

Most helpful comment

I gave up waiting and replaced vue-svg-loader with a minimalistic loader stored in the project itself:

// vue-svg-loader.js
module.exports = function VueSvgLoader(svg) {
  this.cacheable();
  return `<template>${svg}</template>`;
};

// vue.config.js
module.exports = {
  chainWebpack: (config) => {
    config.module.rule("svg").uses.clear();
    config.module
      .rule("svg")
      .use("vue-loader")
      .loader("vue-loader")
      .end()
      .use("./vue-svg-loader")
      .loader("./vue-svg-loader");
  },
};

All 5 comments

Is this being looked into?

I gave up waiting and replaced vue-svg-loader with a minimalistic loader stored in the project itself:

// vue-svg-loader.js
module.exports = function VueSvgLoader(svg) {
  this.cacheable();
  return `<template>${svg}</template>`;
};

// vue.config.js
module.exports = {
  chainWebpack: (config) => {
    config.module.rule("svg").uses.clear();
    config.module
      .rule("svg")
      .use("vue-loader")
      .loader("vue-loader")
      .end()
      .use("./vue-svg-loader")
      .loader("./vue-svg-loader");
  },
};

This solution worked fine for me

I gave up waiting and replaced vue-svg-loader with a minimalistic loader stored in the project itself:

// vue-svg-loader.js
module.exports = function VueSvgLoader(svg) {
  this.cacheable();
  return `<template>${svg}</template>`;
};

// vue.config.js
module.exports = {
  chainWebpack: (config) => {
    config.module.rule("svg").uses.clear();
    config.module
      .rule("svg")
      .use("vue-loader")
      .loader("vue-loader")
      .end()
      .use("./vue-svg-loader")
      .loader("./vue-svg-loader");
  },
};

@simon04 You don't seem to optimize your svg code with svgo like vue-svg-loader would do.

@pmrotule, you're right. My use-case was to load bootstrap-icons. Thus, using svgo seemed unnecessary.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

santigarcor picture santigarcor  Â·  8Comments

leopoldkristjansson picture leopoldkristjansson  Â·  5Comments

Peppe87 picture Peppe87  Â·  4Comments

dsbert picture dsbert  Â·  6Comments

Chucheen picture Chucheen  Â·  5Comments