Replace clean-webpack-plugin with initial cleanup in Robofile
We need to share the same output path (assets/build/js) in more configs in order to generate a common manifest.json file. The cleanup plugin and also build-in output.clean setting do the cleanup on emit and that causes that they delete files we want to keep. Using different output paths solves the problem with cleanup but it causes that we generate a bunch of manifest.json files instead of one. As simplest workaround I chose cleaning the output directory before we trigger the Webpack build in the Robofile. [MAILPOET-3214]
This commit is contained in:
committed by
Veljko V
parent
85c4aa7aa1
commit
dac4fb5dd0
@ -66,6 +66,7 @@ class RoboFile extends \Robo\Tasks {
|
||||
if (!is_dir('assets/dist/js')) {
|
||||
mkdir('assets/dist/js', 0777, true);
|
||||
}
|
||||
$this->_exec('rm -rf ' . __DIR__ . '/assets/dist/js/*');
|
||||
$env = ($opts['env']) ?
|
||||
sprintf('./node_modules/.bin/cross-env NODE_ENV="%s"', $opts['env']) :
|
||||
null;
|
||||
|
Reference in New Issue
Block a user