cascornelissen / svg-spritemap-webpack-plugin

SVG spritemap plugin for webpack
MIT License
207 stars 51 forks source link

mix.version() doesn't get along with this package. #88

Closed ziqq closed 5 years ago

ziqq commented 5 years ago

Error: ENOENT: no such file or directory, open 'xyz\spritemap.js'

cascornelissen commented 5 years ago

Are you able to provide a minimal repository with code that reproduces this error for me?

ziqq commented 5 years ago

Are you able to provide a minimal repository with code that reproduces this error for me?

This problem appears only in production when i use mix.version()

https://github.com/ziqq/svg_sprite_map_plugin_error

ziqq commented 5 years ago

I found one of the solutions. We have to add this options output: { chunk: { keep: true } },

cascornelissen commented 5 years ago

Looking at the provided example and the fix you've found out about this makes sense. Laravel Mix seems to be doing something with the chunk (the generated .js file, which is mostly empty) after the files are emitted and this is exactly what the output.chunk.keep option is there for.