Create the update-webpack.bat file

The batch file can be a viable alternative if we don't want to delete the /dist/ folder while also avoiding to slowing down our build process.

From Solution Explorer, create a new file within the project's root folder, name it as update-webpack.bat, and fill it with the following contents:

cd %~dp0
node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js

The first line tells the file to change the execution folder to the directory hosting the batch file itself; that will allow the batch file to be executed from anywhere, including the Windows GUI with a double-click. The second and last line executes Webpack, passing the webpack.config.vendor.js configuration file as a parameter.

Once done, navigate through the project's root folder and type the following to execute the file:

> update-webpack

You should be able to tell that everything went okay by looking at the white, green, and yellow output lines:

That's it, the only downside is that we'll have to rerun the batch file everytime we change something in the webpack.config.vendor.js file; luckily enough, that won't happen much.

If you don't like the Command Prompt and/or you're looking for a shortcut to run scripts, batches, and executable files within the Visual Studio GUI, check out the great and free Command Task Runner tool by Mads Kristensen available through NuGet. For additional information, visit https://marketplace.visualstudio.com/items?itemName=MadsKristensen.CommandTaskRunner.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.198.59