Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Hashed path in manifest.json with svg-spritemap-webpack-plugin and encore >= 1.0.6 #1002

Open
tbernier opened this issue Jun 8, 2021 · 1 comment

Comments

@tbernier
Copy link

tbernier commented Jun 8, 2021

Hello,

This is probably related to #808 although the problem appears with a different version and maybe is not exactly the same.

I've updated and old project from webpack-encore 0.21.0 to 1.0.5 without any difficulty.
But starting from 1.0.6 and up I have the same bug as described in #808. Inside manifest.json i have :

"build/site/spritemap.63178949b242caf19569.svg": "/build/site/spritemap.63178949b242caf19569.svg",

This only occurs with the spritemap generated by svg-spritemap-webpack-plugin. Css, js, and other images are still working as intented.

Encore
  .setOutputPath('public/build/site')
  .setPublicPath('/build/site')
  .cleanupOutputBeforeBuild()

  .addEntry('js/main', './assets/js/site/main.js')
  .addStyleEntry('css/main', './assets/css/site/site.scss')
  .enableSassLoader()
  .autoProvidejQuery()
  .enableSourceMaps(!Encore.isProduction())
  .enableVersioning()

  .copyFiles({
    from: './assets/images/site',
    to: 'images/[path][name].[hash:8].[ext]',
  })

  .addPlugin(
    new SVGSpritemapPlugin('./assets/icons/site/*.svg', {
      output: {
        filename: 'spritemap.[hash].svg',
        svgo: {
          plugins: [
            { name: 'removeStyleElement', active: false, },
            { name: 'removeUselessStrokeAndFill', active: false, },
          ],
        },
      },
      sprite: { prefix: false, },
    })
  )

  .addPlugin(new Dotenv({ path: './.env.local', systemvars: true }))

  .disableSingleRuntimeChunk()

const site = Encore.getWebpackConfig()

Happens with svg-spritemap-webpack-plugin 3.9.1 & 4.0.3.

Let me know if more information is needed.

@carsonbot
Copy link
Collaborator

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants