⊗tlWpPnBH 20 of 55 menu

Hash in a build file in Webpack

We've already discussed the problem of file caching. Webpack can easily solve this problem. Webpack allows you to append a special hash to the file name, which is a unique random string generated based on the contents of the build file.

This means that with each new build, if changes were made to the project files, the hash of the build file will also change.

You can add a hash to a file name using a special command [contenthash]. Let's do it:

export default { entry: [ './src/test1.js', './src/test2.js' ], output: { filename: 'build.[contenthash].js', } };

Add the hash to your build file name. Build the project. Look at the file name.

Make a change to the project files. Build the project. Look at the name of the new file.

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