-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output a separate svg file #23
Comments
Hi @albertogasparin! |
Thanks @kisenka and no worries, enjoy your holiday. |
👍 |
Hey guys, I've added super buggy implementation of separate file creation (v0.0.21). It's just wrapper over the extract-text-webpack-plugin (you should install extract-text-webpack-plugin manually), which does not support filename placeholders yet :) It configuring right like text extract plugin: var ExtractSVGPlugin = require('svg-sprite-loader/lib/extract-svg-plugin');
module.exports = {
module: {
loaders: [
{
test: /\.svg$/,
// extract=true is necessary option
loader: ExtractSVGPlugin.extract('svg-sprite?extract=true')
}
]
},
plugins: [
new ExtractSVGPlugin('test.svg') // placeholders is not supported yet
]
}; |
Hi @kisenka, can you detail how you'd go about using this generated file in a HTML document? |
@Craga89 you can load it via AJAX an inject into document. Or include it in markup after build has finished with some postprocessing. |
I don't understand why the svg-sprite-loader can't work like style-loader? why is the post-processing necessary? |
@wmertens because we need to wrap symbols string ( |
Can you document the new extract option? |
would be great to have this thing working. For some reason the content from css and svg are mixed in one file for me. |
Do you know if there is a way to extract all svg icons and save them as an SVG bundle (in order to load them on page load)?
It would be really helpful on production, instead of having all those icons bundled together with the JS file.
I've tried with Webpack ExtractTextPlugin, but I got no output.
The text was updated successfully, but these errors were encountered: