CopyWebpackPlugin-webpack plug-in, syntax is as follows
new CopyWebpackPlugin([{ from: '**/*', to: 'relative/path/to/dest/' }
{ from: '**/*', to: '/absolute/path/to/dest/' }
], options)
< H2 > you can achieve < / H2 > by adding arrays to webpack.dev.conf.js and webpack..conf.js.
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
},
// dist
{
from: path.join(__dirname, '../*.txt'),
to: path.join(__dirname, '../dist/')
}
])
can be deleted by direct verification. There is no need to keep it in the root directory
if it is 3.0, configure it in config.js.