Code Monkey home page Code Monkey logo

Comments (8)

mrsum avatar mrsum commented on June 29, 2024

@jonespen Hello!

Can you try 3.0.0-alpha.2 version?
documentation here https://github.com/mrsum/webpack-svgstore-plugin/blob/feature/refactor/README.md

from webpack-svgstore-plugin.

jonespen avatar jonespen commented on June 29, 2024

Hey, thanks!

I upgraded, and it works, but I still can't figure out how to specify two different templates. AFAIK svgxhr don't take a template as parameter

from webpack-svgstore-plugin.

mrsum avatar mrsum commented on June 29, 2024

Hi @jonespen i don't understand what you mean about 'templates'

from webpack-svgstore-plugin.

mrsum avatar mrsum commented on June 29, 2024

jade/pug template for compiling data to svg, or different sprites by mask?

from webpack-svgstore-plugin.

mrsum avatar mrsum commented on June 29, 2024

Wherever, if you want compile 2 or more different sprites, you can use

var __svg__ = { path: './svg/folder-1/*.svg', name: 'assets/svg/[hash].icons.svg' };
require('webpack-svgstore-plugin/src/helpers/svgxhr')(__svg__);

var __svg__ = { path: './svg/folder-2/*.svg', name: 'assets/svg/[hash].logos.svg' };
require('webpack-svgstore-plugin/src/helpers/svgxhr')(__svg__);

from webpack-svgstore-plugin.

jonespen avatar jonespen commented on June 29, 2024

Jade/pug template. If this could be customizable, I could create a html file with all the icons in the svgstore.

I can have a look at it (not right now) if you want

from webpack-svgstore-plugin.

mrsum avatar mrsum commented on June 29, 2024

@jonespen You can set up template

new SvgStore({
  template: 'path/to/your/pug/template.pug'
})

from webpack-svgstore-plugin.

ephor avatar ephor commented on June 29, 2024
var __svg__ = { path: './svg/folder-1/*.svg', name: 'assets/svg/[hash].icons.svg' };
require('webpack-svgstore-plugin/src/helpers/svgxhr')(__svg__);
var __svg__ = { path: './svg/folder-2/*.svg', name: 'assets/svg/[hash].logos.svg' };
require('webpack-svgstore-plugin/src/helpers/svgxhr')(__svg__);

Can I use something like this, but in config (not in chunk)?

new SvgStore(
     //=========> input path
     [
         path.join(__dirname + 'public/', 'image/svg_icons/market', '*.svg'),
         path.join(__dirname + 'public/', 'image/svg_icons/portable', '*.svg'),
     ],
     //=========> output path
     [
         path.join(__dirname + 'public/', 'image/svg_sprite/market'),
         path.join(__dirname + 'public/', 'image/svg_sprite/portable'),
     ],
     //=========> options
     {
         name: 'sprite.svg',
         chunk: 'portable.styl',
         prefix: 'svg-',
     }
)

By the way, I can not get the plugin to work. There is no output. Maybe I need to write input path and output path with considering output.path?

from webpack-svgstore-plugin.

Related Issues (20)

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.