The NPM script copy.externals is used to copy files from externals/ folder into the dist/ folder.
Currently, due Webpack plugin is cleaning the dist folder automatically before compilation, it's needed to exclude the externals/ folder from the plugin configuration + specify the task as a separate NPM script that's run before the NPM webpack script.
A suggestion is to use the copy task as a Webpack hook, after each compilation. More specifically, after the dist/ folder is cleaned up, copy the external files there.
The NPM script
copy.externalsis used to copy files fromexternals/folder into thedist/folder.Currently, due Webpack plugin is cleaning the dist folder automatically before compilation, it's needed to exclude the
externals/folder from the plugin configuration + specify the task as a separate NPM script that's run before the NPMwebpackscript.A suggestion is to use the copy task as a Webpack hook, after each compilation. More specifically, after the
dist/folder is cleaned up, copy the external files there.