Giter Site home page Giter Site logo

svg-sprite-webpack-plugin's Issues

Make icon file's public path configurable

Right now, the generated icon file is expected to be found inside the /static directory. My original rationale for using that instead of the publicPath in the webpack config was because <use> tags don't support cross-origin requests, and publicPath is often used to set to a CDN's domain. A better, more widely usable solution would be to take a config option in the plugin's constructor, have publicPath as a setting, and fallback to the webpack default publicPath if one is not specified.

Nested <defs> don't seem to work

This one needs more research. It appears an icon's internal <defs> aren't getting pulled out properly, or are at least causing something to break. In our usage, this hasn't been a huge issue, since I can just inline any of those defs into the icon itself, but it's definitely an annoying step in between a simple export from Sketch/Inkscape/Illustrator and using the icon.

Take a regex to identify the icon file in webpackIsomorphicParser

Currently, webpackIsomorphicParser has a hard-coded const iconsFileRE = /icons-[a-f0-9]+\.svg/i;. Ideally, there'd be some way for the parser to access the plugin from the webpack config, and get the filename from there. A slightly lesser solution would be to simple take in the same pattern that the plugin does, and let the user deal with keeping that in sync.

Webpack 2 Support

Based on reading the migration guide, it looks like all of the config options should still work, although module.loaders is referred to as a "legacy option". ExtractTextPlugin, which has some similar functionality to this one, changed its API for v2, although I haven't found an explanation of how the internals changed yet, so we should at least consider doing the same.

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.