Monday, 20 March 2023

Webpack for Beginners #3 - The webpack.config File

>> Tutorial Webpack for Beginners

1. Create webpack.config

module.exports = {

//define entry point
entry: './src/script-1.js',

//define output point
output: {
path: 'dist',
filename: 'bundle.js'
},
}; 

- entry: entry point

- output: output point

+ path: this is distribution folder (output folder)

+ filename: this is filename bundle.js

* Note: need put all file to src

2. Running webpack

webpack

=> output file dist/bundle.js using in index.html

>> Soure change on Github

>> Tutorial Webpack for Beginners

Thank you




No comments:

Post a Comment

Golang Advanced Interview Q&A