@@ -36,15 +36,13 @@ var defaultLang = {
36
36
37
37
// When extracting parts from the source vue file, we want to apply the
38
38
// loaders chained before vue-loader, but exclude some loaders that simply
39
- // produces side effects such as linting. This is a hard-coded list and
40
- // hopefully eslint-loader is the only one.
41
- var excludedPreLoadersRE = / e s l i n t - l o a d e r /
42
-
43
- function getRawRequest ( context ) {
39
+ // produces side effects such as linting.
40
+ function getRawRequest ( context , excludedPreLoaders ) {
41
+ excludedPreLoaders = excludedPreLoaders || / e s l i n t - l o a d e r /
44
42
return loaderUtils . getRemainingRequest ( {
45
43
resource : context . resource ,
46
44
loaderIndex : context . loaderIndex ,
47
- loaders : context . loaders . filter ( loader => ! excludedPreLoadersRE . test ( loader . path ) )
45
+ loaders : context . loaders . filter ( loader => ! excludedPreLoaders . test ( loader . path ) )
48
46
} )
49
47
}
50
48
@@ -55,8 +53,8 @@ module.exports = function (content) {
55
53
56
54
var loaderContext = this
57
55
var query = loaderUtils . getOptions ( this ) || { }
58
- var rawRequest = getRawRequest ( this )
59
56
var options = this . options . __vueOptions__ = Object . assign ( { } , this . options . vue , this . vue , query )
57
+ var rawRequest = getRawRequest ( this , options . excludedPreLoaders )
60
58
61
59
var filePath = this . resourcePath
62
60
var fileName = path . basename ( filePath )
0 commit comments