Copy files (or directories), e.g. from node_modules to a local folder.
npm install webpack-copy-pluginCopies directories from anywhere to anywhere (not limited to webpack build).
If you want to copy files for any reason.
One reason is because angular 2 and webpack has an import problem from node_modules, so this is
a workaround to automatically copy the files from node_modules to a local directory.
Add to package.json & npm install"webpack-copy-plugin": "git+ssh://git@github.com/presencelearning/webpack-copy-plugin"
And ignore the generated file (write directory) to prevent infinite webpack build loops.
``
var WebpackCopyPlugin = require('webpack-copy-plugin');
var WatchIgnorePlugin = webpack.WatchIgnorePlugin;
...
new WebpackCopyPlugin({
dirs: [
{ from: 'node_modules/my-dir1', to: 'src/lib1' },
],
options: {},
}),
new WatchIgnorePlugin([
'src/lib1'
])
``