@@ -6,7 +6,9 @@ module.exports = (api, options) => {
66 // Use loadModule to allow users to customize their ESLint dependency version.
77 const { resolveModule, loadModule } = require ( '@vue/cli-shared-utils' )
88 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 )
1012
1113 // eslint-loader doesn't bust cache when eslint config changes
1214 // so we have to manually generate a cache identifier that takes the config
@@ -28,10 +30,6 @@ module.exports = (api, options) => {
2830 )
2931
3032 api . chainWebpack ( webpackConfig => {
31- webpackConfig . resolveLoader . modules . prepend (
32- path . join ( __dirname , 'node_modules' )
33- )
34-
3533 const { lintOnSave } = options
3634 const allWarnings = lintOnSave === true || lintOnSave === 'warning'
3735 const allErrors = lintOnSave === 'error'
@@ -45,7 +43,7 @@ module.exports = (api, options) => {
4543 . end ( )
4644 . test ( / \. ( v u e | ( j | t ) s x ? ) $ / )
4745 . use ( 'eslint-loader' )
48- . loader ( 'eslint-loader' )
46+ . loader ( require . resolve ( 'eslint-loader' ) )
4947 . options ( {
5048 extensions,
5149 cache : true ,
0 commit comments