@@ -6,7 +6,9 @@ module.exports = (api, options) => {
6
6
// Use loadModule to allow users to customize their ESLint dependency version.
7
7
const { resolveModule, loadModule } = require ( '@vue/cli-shared-utils' )
8
8
const cwd = api . getCwd ( )
9
- const eslintPkg = loadModule ( 'eslint/package.json' , cwd , true )
9
+ const eslintPkg =
10
+ loadModule ( 'eslint/package.json' , cwd , true ) ||
11
+ loadModule ( 'eslint/package.json' , __dirname , true )
10
12
11
13
// eslint-loader doesn't bust cache when eslint config changes
12
14
// so we have to manually generate a cache identifier that takes the config
@@ -28,10 +30,6 @@ module.exports = (api, options) => {
28
30
)
29
31
30
32
api . chainWebpack ( webpackConfig => {
31
- webpackConfig . resolveLoader . modules . prepend (
32
- path . join ( __dirname , 'node_modules' )
33
- )
34
-
35
33
const { lintOnSave } = options
36
34
const allWarnings = lintOnSave === true || lintOnSave === 'warning'
37
35
const allErrors = lintOnSave === 'error'
@@ -45,7 +43,7 @@ module.exports = (api, options) => {
45
43
. end ( )
46
44
. test ( / \. ( v u e | ( j | t ) s x ? ) $ / )
47
45
. use ( 'eslint-loader' )
48
- . loader ( 'eslint-loader' )
46
+ . loader ( require . resolve ( 'eslint-loader' ) )
49
47
. options ( {
50
48
extensions,
51
49
cache : true ,
0 commit comments