Based on make-dir-webpack-plugin by Monokh
Make directories at webpack compilation. Webpack 5 compatible. Useful when another webpack plugin depends on a directory existing.
npm install create-dir-webpack-plugin --save-dev
var CreateDirPlugin = require('create-dir-webpack-plugin');
module.exports = {
...
plugins: [
new CreateDirPlugin([
'./dist/folder1',
'./dist/folder2'
])
]
};