Giter Club home page Giter Club logo

Comments (18)

cascornelissen avatar cascornelissen commented on June 9, 2024 1

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.

cascornelissen avatar cascornelissen commented on June 9, 2024 1

@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.

ripperdoc avatar ripperdoc commented on June 9, 2024 1

I tested the master version and it seems to fix it! Thanks!

from svg-spritemap-webpack-plugin.

vzaidman avatar vzaidman commented on June 9, 2024 1

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.

cascornelissen avatar cascornelissen commented on June 9, 2024

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?

  1. What exactly do you mean by "not emitted anymore"? Do these files not get created?
  2. Does this only happen in a specific mode (watch, development, production)?
  3. Do older RCs of the plugin work for you (especially 2.0.0-rc.3)?
  4. 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?
  5. 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.

ripperdoc avatar ripperdoc commented on June 9, 2024

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:

  1. Well, without SVGSpritemapPlugin, the expected JS files are emitted to the output directory. With the plugin, no JS files are emitted, just an SVG.
  2. Seems to happen in both
  3. As I check this, it only happens in rc.4, not 3.
  4. I have not, sorry
  5. 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.

cascornelissen avatar cascornelissen commented on June 9, 2024

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.

ripperdoc avatar ripperdoc commented on June 9, 2024

That does not seem to make any difference.

from svg-spritemap-webpack-plugin.

cascornelissen avatar cascornelissen commented on June 9, 2024

@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.

ripperdoc avatar ripperdoc commented on June 9, 2024

I made the edit, but the error seem to persist unfortunately.

from svg-spritemap-webpack-plugin.

cascornelissen avatar cascornelissen commented on June 9, 2024

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.

cascornelissen avatar cascornelissen commented on June 9, 2024

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.

vzaidman avatar vzaidman commented on June 9, 2024

testing

from svg-spritemap-webpack-plugin.

cascornelissen avatar cascornelissen commented on June 9, 2024

@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.

ripperdoc avatar ripperdoc commented on June 9, 2024

Sorry, I haven't had chance to test yet, but will get to it eventually.

from svg-spritemap-webpack-plugin.

cascornelissen avatar cascornelissen commented on June 9, 2024

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.

vzaidman avatar vzaidman commented on June 9, 2024

ill test it in a few hours.

from svg-spritemap-webpack-plugin.

cascornelissen avatar cascornelissen commented on June 9, 2024

@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)

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.