Skip to content

Commit

Permalink
fix(webpack-plugin): create output folder with mkdirp (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhsu978 authored and gregberge committed Mar 19, 2019
1 parent 6090e8a commit 3767f28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/webpack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
},
"peerDependencies": {
"webpack": ">=4.6.0"
},
"dependencies": {
"mkdirp": "^0.5.1"
}
}
3 changes: 2 additions & 1 deletion packages/webpack-plugin/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const nodePath = require('path')
const fs = require('fs')
const mkdirp = require('mkdirp')

class LoadablePlugin {
constructor({
Expand Down Expand Up @@ -57,7 +58,7 @@ class LoadablePlugin {

try {
if (!fs.existsSync(outputFolder)) {
fs.mkdirSync(outputFolder)
mkdirp.sync(outputFolder)
}
} catch (err) {
if (err.code !== 'EEXIST') {
Expand Down

0 comments on commit 3767f28

Please sign in to comment.