Skip to content

Commit 1bead9f

Browse files
committed
Merge pull request #37 from tommytroylin/master
Fix TypeError when working with webpack-dev-server
2 parents 348b62b + d61ce4f commit 1bead9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ const getOutputDir = (compiler) => {
2424
return compiler.options.output.path;
2525
}
2626

27-
const outputPath = compiler.options.devServer.outputPath;
27+
const devServer = compiler.options.devServer;
2828

29-
if (!outputPath || outputPath === '/') {
29+
if (!devServer || !devServer.outputPath || devServer.outputPath === '/') {
3030
throw new Error('CopyWebpackPlugin: to use webpack-dev-server, devServer.outputPath must be defined in the webpack config');
3131
}
3232

33-
return outputPath;
33+
return devServer.outputPath;
3434
};
3535

3636
export default (patterns = [], options = {}) => {

0 commit comments

Comments
 (0)