Before webpack packaging, we must ensure that the following work has been completed: 1) Install webpack: Recommended global command npm install -g webpack View webpack version webpack -v 2) Errors may occur when packaging the files at this time, prompting scaffolding file errors, because in the webpack4 version, CLI has been separated out, so we need to install it separately and execute the global command npm install -g webpack-cli. After installing the scaffolding, it stands to reason that the webpack command can be used for normal packaging. The general syntax for using webpack to package files is: ( This is what the webpack introductory tutorial on Jianshu says ) # {extry file} fills in the path of the entry file. In this article, it is the path of the main.js mentioned above. # Fill in the storage path of the packaged file in {destination for bundled file}# No need to add {} when filling in the path webpack {entry file} {destination for bundled file} # Webpack is not installed globally node_modules/.bin/webpack app/main.js public/bundle.js So I executed the packaging command webpack a.js bundle.js, but the error WARNING in configuration The 'mode' option has….. The screenshots are as follows: This error message is not because our environment is installed incorrectly, but because webpack 4 has stricter requirements on webpack syntax after the update. The previous command was revised to webpack a.js –output-filename bundle.js. When this command was executed, the packaging was successful. The screenshots are as follows: This is the end of this article about webpack file packaging errors and exceptions. For more related webpack packaging errors, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Database query which object contains which field method statement
>>: Detailed explanation of the difference between docker-compose ports and expose
Table of contents mysql log files binlog Binlog l...
Preface: In the daily use of the database, it is ...
1. mysql export file: SELECT `pe2e_user_to_compan...
By turning on the Recycle Bin function, you can r...
SQL (Structured Query Language) statement, that i...
{ {}} Get the value, the original content of the ...
Basic Use <!DOCTYPE html> <html lang=&qu...
How to achieve internationalization in React? The...
Original : http://developer.yahoo.com/performance...
(Win7 system) VMware virtual machine installation...
This article example shares the specific code of ...
Due to work reasons, it is often not possible to ...
It took me more than an hour to open ssh in Ubunt...
Table of contents Introduction Example: Event del...
If the words in the sql statement conflict with t...