From 083d4aaf5afac2e9ab6f99882014b8d0c67e1e92 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Fri, 20 Nov 2020 21:26:19 +0800 Subject: [PATCH] fix: remove implicit requirement of vue-loader `.loader` is a setter rather than a selector. `.use` alone is sufficient for selecting the loader rule So this expression implicitly introduced a dependency on the `vue-loader` name, and expected it to be vue-loader v15, which, isn't guranteed to be exact the case. Because Vue CLI supports both Vue 2 and Vue 3 in the core service, the `vue-loader` dependency used to be v15 and v16 is aliases as `vue-loader-v16`. But when I tried to upgrade to webpack 5 and make v16 the default `vue-loader` dependency, it breaks this plugin and had to workaround it. See https://github.com/vuejs/vue-cli/pull/6060/commits/7c672bd0d7a816aaea55fffcc8b5fbb5e8cfd5da#diff-e201f09cd938f870f5a24c75f97cf10a2a16819caf5f5b154bcc23c4ff915239R99-R106 --- index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/index.js b/index.js index 9678c0d..4b725c3 100644 --- a/index.js +++ b/index.js @@ -85,7 +85,6 @@ module.exports = (api, options) => { config.module .rule('vue') .use('vue-loader') - .loader('vue-loader') .tap(options => { options.transpileOptions = options.transpileOptions || {} options.transpileOptions.transforms = options.transpileOptions.transforms || {}