File tree 1 file changed +11
-4
lines changed 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -90,13 +90,20 @@ export default (userOptions = {}) => {
90
90
return ;
91
91
}
92
92
93
- if ( ! compiler . options . devServer . outputPath ) {
94
- throw new Error ( 'devServer.outputPath is not defined.' ) ;
93
+ // https://github.com/gajus/write-file-webpack-plugin/issues/1
94
+ if ( _ . has ( compiler , 'options.output.path' ) && compiler . options . output . path !== path . sep ) {
95
+ outputPath = compiler . options . output . path ;
95
96
}
96
97
97
- outputPath = compiler . options . devServer . outputPath ;
98
+ if ( ! outputPath ) {
99
+ if ( ! _ . has ( compiler , 'options.devServer.outputPath' ) ) {
100
+ throw new Error ( 'output.path is not accessible and devServer.outputPath is not defined. Define devServer.outputPath.' ) ;
101
+ }
102
+
103
+ outputPath = compiler . options . devServer . outputPath ;
104
+ }
98
105
99
- log ( 'compiler.options.devServer.outputPath is "' + chalk . cyan ( compiler . options . devServer . outputPath ) + '".' ) ;
106
+ log ( 'compiler.options.devServer.outputPath is "' + chalk . cyan ( outputPath ) + '".' ) ;
100
107
101
108
setupStatus = true ;
102
109
You can’t perform that action at this time.
0 commit comments