meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ixc2024:tech:tools:webpack [2024/05/22 12:07] salsabeel-tnixc2024:tech:tools:webpack [2024/08/26 05:10] (current) salsabeel-tn
Line 9: Line 9:
 Use content hashing to create unique filenames for your assets, which helps in long-term caching. Use content hashing to create unique filenames for your assets, which helps in long-term caching.
 Example: Example:
- +''
-javascript +
-Copy code+
 module.exports = { module.exports = {
   output: {   output: {
Line 17: Line 15:
     path: path.resolve(__dirname, 'dist')     path: path.resolve(__dirname, 'dist')
   },   },
-  // other configurations... 
 }; };
-Using HtmlWebpackPlugin:+'' 
 +\\ 
 + 
 +Using HtmlWebpackPlugin to clean the code structure: 
  
-javascript 
-Copy code 
 const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
  
Line 37: Line 36:
   // other configurations...   // other configurations...
 }; };
 +
 +\\
 Green Development Practices Green Development Practices
-Green Aspect: 
  
 Development Server: Use Webpack’s development server efficiently to avoid unnecessary resource usage. Development Server: Use Webpack’s development server efficiently to avoid unnecessary resource usage.
Line 46: Line 46:
 Example: Example:
  
-javascript +
-Copy code+
 module.exports = { module.exports = {
   devServer: {   devServer: {