Skip to content

Commit fed948a

Browse files
committed
fix: also look up loaders in local node_modules in case deps are not hoisted
closes #2599
1 parent e31e2ac commit fed948a

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ 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'))
9+
810
const jsRule = webpackConfig.module
911
.rule('js')
1012
.test(/\.jsx?$/)

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const path = require('path')
2+
13
module.exports = (api, options) => {
24
if (options.lintOnSave) {
35
const extensions = require('./eslintOptions').extensions(api)
@@ -22,6 +24,8 @@ module.exports = (api, options) => {
2224
)
2325

2426
api.chainWebpack(webpackConfig => {
27+
webpackConfig.resolveLoader.modules.add(path.join(__dirname, 'node_modules'))
28+
2529
webpackConfig.module
2630
.rule('eslint')
2731
.pre()

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
const path = require('path')
2+
13
module.exports = (api, options) => {
24
const fs = require('fs')
35
const useThreads = process.env.NODE_ENV === 'production' && options.parallel
46

57
api.chainWebpack(config => {
8+
config.resolveLoader.modules.add(path.join(__dirname, 'node_modules'))
9+
610
if (!options.pages) {
711
config.entry('app')
812
.clear()

0 commit comments

Comments
 (0)