You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/WebpackConfig.js
+17-5Lines changed: 17 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -129,11 +129,23 @@ class WebpackConfig {
129
129
}
130
130
131
131
if(!fs.existsSync(outputPath)){
132
-
// for safety, we won't recursively create directories
133
-
// this might be a sign that the user has specified
134
-
// an incorrect path
135
-
if(!fs.existsSync(path.dirname(outputPath))){
136
-
thrownewError(`outputPath directory does not exist: ${outputPath}. Please check the path you're passing to setOutputPath() or create this directory`);
132
+
// If the parent of the output directory does not exist either
133
+
// check if it is located under the context directory before
134
+
// creating it and its parent.
135
+
constparentPath=path.dirname(outputPath);
136
+
if(!fs.existsSync(parentPath)){
137
+
constcontext=path.resolve(this.getContext());
138
+
if(outputPath.indexOf(context)!==0){
139
+
thrownewError(`outputPath directory "${outputPath}" does not exist and is not located under the context directory "${context}". Please check the path you're passing to setOutputPath() or create this directory.`);
0 commit comments