⊗tlWpAsCGP 50 of 55 menu

Customizing the Asset Group Path in Webpack

You can set a save path for each asset group. This is done using the generator setting, specified for each group:

export default { entry: './src/index.js', output: { filename: 'bundle.js', path: path.resolve('dist'), }, module: { rules: [ { test: /\.png$/, type: 'asset/resource', generator: { filename: 'images/[name].[hash][ext]' } } ] }, plugins: [ new HtmlWebpackPlugin(), ], };

Place all images with the extension .png in the folder images/png.

Place all images with the extension .jpg in the folder images/jpg.

Place all files with the extension .zip into the folder download.

Place all files with the extension .zip or .rar into the folder download.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline