Skip to content

Commit

Permalink
fix: fix compatibility with webpack 3
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sodatea committed Dec 16, 2019
1 parent 151995e commit 745d054
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/plugin.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 745d054

Please sign in to comment.