diff --git a/packages/webpack-plugin/package.json b/packages/webpack-plugin/package.json index 049087f1..df9dcd5b 100644 --- a/packages/webpack-plugin/package.json +++ b/packages/webpack-plugin/package.json @@ -22,5 +22,8 @@ }, "peerDependencies": { "webpack": ">=4.6.0" + }, + "dependencies": { + "mkdirp": "^0.5.1" } } diff --git a/packages/webpack-plugin/src/index.js b/packages/webpack-plugin/src/index.js index c31bbaa1..cd50aa9e 100644 --- a/packages/webpack-plugin/src/index.js +++ b/packages/webpack-plugin/src/index.js @@ -1,5 +1,6 @@ const nodePath = require('path') const fs = require('fs') +const mkdirp = require('mkdirp') class LoadablePlugin { constructor({ @@ -57,7 +58,7 @@ class LoadablePlugin { try { if (!fs.existsSync(outputFolder)) { - fs.mkdirSync(outputFolder) + mkdirp.sync(outputFolder) } } catch (err) { if (err.code !== 'EEXIST') {