From 745d0542ef8ae6f6f740dfe2aeea1ba208ea293a Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 16 Dec 2019 17:41:29 +0800 Subject: [PATCH] fix: fix compatibility with webpack 3 According to the documentation https://vue-loader.vuejs.org/guide/extract-css.html#webpack-3 and some private feedbacks, there are still many users use vue-loader v15 along with webpack 3. --- lib/plugin.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plugin.js b/lib/plugin.js index 87848bf6b..f9bbb0d7d 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -1,7 +1,7 @@ const webpack = require('webpack') let VueLoaderPlugin = null -if (webpack.version[0] > 4) { +if (webpack.version && webpack.version[0] > 4) { // webpack5 and upper VueLoaderPlugin = require('./plugin-webpack5') } else { diff --git a/package.json b/package.json index 178ab3100..8c9c073fc 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ }, "peerDependencies": { "css-loader": "*", - "webpack": "^4.1.0 || ^5.0.0-0" + "webpack": "^3.0.0 || ^4.1.0 || ^5.0.0-0" }, "peerDependenciesMeta": { "cache-loader": {