@@ -34,13 +34,28 @@ var defaultLang = {
34
34
script : 'js'
35
35
}
36
36
37
+ // When extracting parts from the source vue file, we want to apply the
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 ) {
44
+ const clonedContext = Object . assign ( { } , context , {
45
+ loaders : context . loaders . filter ( loader => ! excludedPreLoadersRE . test ( loader . path ) )
46
+ } )
47
+ delete clonedContext . remainingRequest
48
+ return loaderUtils . getRemainingRequest ( clonedContext )
49
+ }
50
+
37
51
module . exports = function ( content ) {
38
52
this . cacheable ( )
39
53
var isServer = this . options . target === 'node'
40
54
var isProduction = this . minimize || process . env . NODE_ENV === 'production'
41
55
42
56
var loaderContext = this
43
57
var query = loaderUtils . parseQuery ( this . query )
58
+ var rawRequest = getRawRequest ( this )
44
59
var options = this . options . __vueOptions__ = Object . assign ( { } , this . options . vue , this . vue , query )
45
60
46
61
var filePath = this . resourcePath
@@ -85,7 +100,7 @@ module.exports = function (content) {
85
100
// select the corresponding part from the vue file
86
101
getSelectorString ( type , index || 0 ) +
87
102
// the url to the actual vue file, including remaining requests
88
- loaderUtils . getRemainingRequest ( loaderContext )
103
+ rawRequest
89
104
)
90
105
}
91
106
0 commit comments