1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 17:02:09 +02:00
tldr/pages/common/webpack.md
Vitor Henrique af35564618
pages*: do not use config abbreviation (#12118)
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2024-01-25 10:59:16 +05:30

650 B

webpack

Bundle a web project's js files and other assets into a single output file. More information: https://webpack.js.org.

  • Create a single output file from an entry point file:

webpack {{app.js}} {{bundle.js}}

  • Load CSS files too from the JavaScript file (this uses the CSS loader for .css files):

webpack {{app.js}} {{bundle.js}} --module-bind '{{css=css}}'

  • Pass a configuration file (with e.g. the entry script and the output filename) and show compilation progress:

webpack --config {{webpack.config.js}} --progress

  • Automatically recompile on changes to project files:

webpack --watch {{app.js}} {{bundle.js}}