Skip to content

Commit 47a28e0

Browse files
committed
fix: plugin sub node_module directory should have higher priority in resolveLoader.modules
in case of interference of unwanted top level dependency hoisting
1 parent fed948a commit 47a28e0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/@vue/cli-plugin-babel/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = (api, options) => {
55
const cliServicePath = require('path').dirname(require.resolve('@vue/cli-service'))
66

77
api.chainWebpack(webpackConfig => {
8-
webpackConfig.resolveLoader.modules.add(path.join(__dirname, 'node_modules'))
8+
webpackConfig.resolveLoader.modules.prepend(path.join(__dirname, 'node_modules'))
99

1010
const jsRule = webpackConfig.module
1111
.rule('js')

packages/@vue/cli-plugin-eslint/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = (api, options) => {
2424
)
2525

2626
api.chainWebpack(webpackConfig => {
27-
webpackConfig.resolveLoader.modules.add(path.join(__dirname, 'node_modules'))
27+
webpackConfig.resolveLoader.modules.prepend(path.join(__dirname, 'node_modules'))
2828

2929
webpackConfig.module
3030
.rule('eslint')

packages/@vue/cli-plugin-typescript/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = (api, options) => {
55
const useThreads = process.env.NODE_ENV === 'production' && options.parallel
66

77
api.chainWebpack(config => {
8-
config.resolveLoader.modules.add(path.join(__dirname, 'node_modules'))
8+
config.resolveLoader.modules.prepend(path.join(__dirname, 'node_modules'))
99

1010
if (!options.pages) {
1111
config.entry('app')

0 commit comments

Comments
 (0)