MakeDirWebpackPlugin
raw JSON → 0.1.0 verified Sat Apr 25 auth: no javascript
A webpack plugin that creates directories during the compilation process. Version 0.1.0 is the latest stable release with no clear release cadence. It is useful when other plugins or loaders expect specific directories to exist (e.g., for output assets). Minimal configuration; niche alternative to using Node.js `mkdir` scripts.
Warnings
gotcha Version 0.1.0 fixed nested directory creation; earlier versions may fail with nested paths. ↓
fix Update to version 0.1.0 or later.
Install
npm install make-dir-webpack-plugin yarn add make-dir-webpack-plugin pnpm add make-dir-webpack-plugin Imports
- MakeDirWebpackPlugin wrong
import MakeDirWebpackPlugin from 'make-dir-webpack-plugin';correctconst MakeDirWebpackPlugin = require('make-dir-webpack-plugin');
Quickstart
const MakeDirWebpackPlugin = require('make-dir-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: __dirname + '/dist',
filename: 'bundle.js'
},
plugins: [
new MakeDirWebpackPlugin({
dirs: [
{ path: './dist/css' },
{ path: './dist/js' }
]
})
]
};