diff --git a/src/index.js b/src/index.js index f0cbac5..bc46171 100644 --- a/src/index.js +++ b/src/index.js @@ -38,7 +38,7 @@ class Dotenv { apply (compiler) { const variables = this.gatherVariables() const target = compiler.options.target ?? 'web' - const version = compiler.webpack.version + const version = (compiler.webpack && compiler.webpack.version) || '4' const data = this.formatData({ variables, target,