symfony / webpack-encore

A simple but powerful API for processing & compiling assets built around Webpack
https://symfony.com/doc/current/frontend.html
MIT License
2.23k stars 198 forks source link

configureImageRule and configureFontRule [ext] is different from copyFiles #1001

Open Seb33300 opened 3 years ago

Seb33300 commented 3 years ago

The filename option of configureImageRule and configureFontRule is not consistent with copyFiles.

With copyFiles, [ext] doesn't include the dot => jpg With configureImageRule, [ext] includes the dot => .jpg

This means we have to set 2 different config to achieve the same result:

.configureImageRule({filename: '[path][name].[hash:8][ext]'})
.copyFiles([{context: './', from: './assets/images', to: '[path][name].[hash:8].[ext]'}])
sacerro commented 8 months ago

Hi, I have the same issue. Is there any news on this? Maybe my config (similar to @Seb33300) is wrong?

.configureImageRule({
  type: 'asset',
  filename: `images/[name]${(Encore.isProduction() ? '.[hash:8]' : '')}[ext]`,
})
carsonbot commented 1 month ago

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