-
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
2.0 alpha #91
Comments
Great, trying to test it out now. Everything seems to compile well, but the sprite is not injecting into the body as with v1. Do I need to make an explicit call to trigger this now? |
@eugene1g sprite should injects automatically. Which webpack version is used? |
Webpack2. {
test: /\.svg$/,
include: [faModulesSrcDir + "/fa-icon"],
use: [
{
loader: "svg-sprite-loader",
options: {
symbolId: "[name]_[hash:base64:8]",
spriteModule: "svg-sprite-loader/runtime/browser-sprite.build"
}
},
"svgo-loader"
]
} If I leave out |
Ok two separate notes -
|
@eugene1g I need your setup for case №1, could you please create a gist/repo with minimal setup which can reproduce described behaviour. |
You're right. Seems like logic |
Ok I made a simple demo, but there the injection works as described - so something must be weird within my main environment. Only the |
Okay, |
Thanks! Fixes my use-case. Perhaps there is merit in optimistic execution - especially if somebody is loading your script async, or on-demand, or lazily later on. In those cases |
|
Also browser-sprite example added. |
@rocking42 merged, published as 2.0.0-alpha.4 |
I have a use-case which seems to be broken with the alpha builds. I've updated my webpack config to match the browser-sprite example.
But when I run webpack I get this error. All the source code can be found here (haven't pushed the alpha changes) Should I use a different approach or is it a bug in the alpha versions? Thanks! |
@alexandernanberg there is an error in your webpack.config.js, you should replace |
@kisenka Ahh... Weird that I haven't been affected by that until now. Thanks anyway! 😄 |
webpack 2 is surprisingly backwards compatible and as part of that translates all |
Does anyone else have this error?
Using |
@oliverturner this is not an error, but I'll fix it. |
@kisenka thank you! Much appreciated 👍 |
🎉 2.0 is out, please read migration guide & overview. |
Hi all! I am preparing to release big update, it's already accessible as
svg-sprite-loader@2.0.0-alpha.4
.Please read carefully about upcoming breaking changes, new features and bugfixes.
Breaking changes
Node.js >= 6 required
¯_(ツ)_/¯
If you think that Node.js < 6 should be supported, please vote up in this issue.
Targeting Webpack 2
¯_(ツ)_/¯
If you think that Webpack 1 should be supported, please vote up in this issue.
Loader should always be configured with plugin, otherwise error is thrown.
Reason: architectural changes.
Migration: just add a plugin in your webpack config
name
config option renamed tosymbolId
Reason: more obviously.
regExp
config option was removedReason:
symbolId
should cover most of naming cases.prefixize
config option was removedReason: all symbol elements isolated by default.
angularBaseWorkaround
config option was removedReason: Angular introduced ability to remove the base tag requirement, see correspondent issue comment. If you still need it check angular-svg-base-fix.
Runtime has changed
Instead of symbol id runtime module now returns an object (class instance actually) which contains
id
,viewBox
andcontent
fields. See SpriteSymbol class and runtime generator.Reason: make runtime more flexible, also it was requested in #32.
Migration:
If you think that loader should provide compatibility in this case, please vote up in this issue.
Features, improvements and bugfixes
Auto configuring
Some magic now happens by default, viz:
module.exports = ...
for webpack 1,export default ...
for webpack 2.Sprite generator
Client runtime
runtimeGenerator
option (check default runtime generator for example).id
,viewBox
andcontent
fields. See SpriteSymbol class.style
attributes (via svg-baker-runtime).Server side rendering
Extract sprite/sprites as separate file/files
TODO
The text was updated successfully, but these errors were encountered: