Comments (18)
I'll have to look into this some more then, for now you could use 2.0.0-rc.3
.
from svg-spritemap-webpack-plugin.
@ripperdoc, I did some more testing and I can't reproduce your issue when applying the change I've described earlier. I've pushed that change to GitHub, could you try installing the plugin directly from GitHub and report back if that fixes it?
npm install cascornelissen/svg-spritemap-webpack-plugin#master --save-dev
from svg-spritemap-webpack-plugin.
I tested the master version and it seems to fix it! Thanks!
from svg-spritemap-webpack-plugin.
looks fine here as well. other plugins prevent me from migrating to webpack 4 right now, so i cant see if it actually works, but it looks like its fine right now. thanks :)
from svg-spritemap-webpack-plugin.
Thanks for reporting the issue, this seems like a serious problem and I would love to get this fixed. Could you answer a couple of questions for me?
- What exactly do you mean by "not emitted anymore"? Do these files not get created?
- Does this only happen in a specific mode (watch, development, production)?
- Do older RCs of the plugin work for you (especially
2.0.0-rc.3
)? - Have you used the
1.x
version of the plugin before upgrading to webpack 4? If so, did that work for you without any problems? - What OS/NodeJS/npm versions are you on?
It would be even better if you could provide a simple project where you can reproduce this, otherwise could you add your entire webpack.config.js
to this issue?
Let's see what we can make of this 😄
from svg-spritemap-webpack-plugin.
Let me try to give a bit more info, I've cut out almost everything else in my project and it still persists.
Some details below, short answers to your questions:
- Well, without SVGSpritemapPlugin, the expected JS files are emitted to the output directory. With the plugin, no JS files are emitted, just an SVG.
- Seems to happen in both
- As I check this, it only happens in rc.4, not 3.
- I have not, sorry
- OSX/Node 9.8.0/npm 5.6.0
Here is my config:
const SVGSpritemapPlugin = require('svg-spritemap-webpack-plugin');
const path = require('path');
config = {
mode: 'production',
entry: {
app: path.resolve(__dirname, 'assets/js/test.js'),
},
output: {
path: path.resolve(__dirname, 'static/dist'),
filename: '[name].[chunkhash].js',
publicPath: '/static/dist/'
},
plugins: [
new SVGSpritemapPlugin({
src: 'assets/gfx/*.svg',
filename: 'spritemap.[contenthash].svg',
prefix: 'fablr-',
}),
],
resolve: {
modules: ['assets/js', 'node_modules'],
}
}
module.exports = config
Here is my test.js entrypoint:
var utils = require('utils');
(Utils is just some general JS code to have something real)
The output from running with SVGSpritemapPlugin:
> webpack -p
Hash: 9cfb373ec8206974ead6
Version: webpack 4.1.1
Time: 331ms
Built at: 3/11/2018 10:28:48 AM
Asset Size Chunks Chunk Names
spritemap.0ddc6c87790465ed.svg 18.9 KiB 0 [emitted] spritemap
The output if I comment it out:
> webpack -p
Hash: c383ec3ee00f58db5f10
Version: webpack 4.1.1
Time: 1499ms
Built at: 3/11/2018 10:32:09 AM
Asset Size Chunks Chunk Names
app.js 19.3 KiB 0 [emitted] app
Entrypoint app = app.js
[1] ./assets/js/utils.js 6.33 KiB {0} [built]
[2] ./assets/js/test.js 769 bytes {0} [built]
+ 1 hidden module
from svg-spritemap-webpack-plugin.
I might have an idea where this is coming from, could you change your entry to this:
entry: {
app: [path.resolve(__dirname, 'assets/js/test.js')],
},
The string-variant should work as well so I'll have to fix it but let's check if this is your actual problem first. Could you report back if this is working for you?
from svg-spritemap-webpack-plugin.
That does not seem to make any difference.
from svg-spritemap-webpack-plugin.
@ripperdoc, I'm having trouble reproducing your errors but could you try installing 2.0.0-rc.4
again and modifying the node_modules/svg-spritemap-webpack-plugin/lib/index.js
file in your project and changing this line to return;
instead of return true;
and see if that solves the problem for you?
from svg-spritemap-webpack-plugin.
I made the edit, but the error seem to persist unfortunately.
from svg-spritemap-webpack-plugin.
That's strange... The only difference between rc.3
and rc.4
are changes to the svg4everybody helper and since you're not using the helper (it defaults to false
) the only difference you'd run into wouId be the change I suggested earlier.
Any chance you could check that change again or dive into it with help of the changes between rc.3
and rc.4
? I've reproduced this about an hour ago and it was fixed with the change I suggested so it would be great if you could check again.
from svg-spritemap-webpack-plugin.
Since I'm noticing multiple people responding to this issue (@haydencleary, @vzaidman), is there anyone experiencing this issue as well?
If not, I'll release 2.0.0
this weekend either way.
from svg-spritemap-webpack-plugin.
testing
from svg-spritemap-webpack-plugin.
@vzaidman, any updates by any chance? I'll release 2.0.0
tomorrow if I'm not hearing back from anyone.
from svg-spritemap-webpack-plugin.
Sorry, I haven't had chance to test yet, but will get to it eventually.
from svg-spritemap-webpack-plugin.
No problem, any way you could test it today/tomorrow? If not and the issue still persists on your side I'll try to resolve it and release a patch 😉
from svg-spritemap-webpack-plugin.
ill test it in a few hours.
from svg-spritemap-webpack-plugin.
@ripperdoc, great to hear! I've just released v2.0.0
which includes this fix 🚀
npm install svg-spritemap-webpack-plugin --save-dev
from svg-spritemap-webpack-plugin.
Related Issues (20)
- <symbol> id is mangled by SVGO but not the css url anchor #fragment HOT 4
- contenthash not replacing on watch HOT 7
- Question, how generate json file with all file names HOT 3
- Provide option to add custom attributes to SVG element. HOT 2
- Cannot disable individual SVGO plugins. HOT 3
- Module not found: Error: Can't resolve './spritemap.svg' in src HOT 5
- SVG's not scaling with Webpack 5 HOT 7
- Google chrome ignoring <mask> HOT 4
- Glob doesn't find anything on windows HOT 5
- webpack dev server support HOT 8
- Generated SVG is not added to spritemap chunk HOT 7
- version 4.4.1 not compiling HOT 10
- Windows pattern HOT 4
- Rebuilds every time editing js files in watch mode. HOT 4
- Problem with path.join on windows HOT 2
- (node:19636) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'trim' of undefined HOT 1
- 404 Error when `options.output` changed
- Preserve svg with styles attribute HOT 7
- Empty output file when the style attribute contains either "visibility: hidden" or "display: none" HOT 3
- Add `mask` support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svg-spritemap-webpack-plugin.