@@ -6,18 +6,18 @@ const templateLoaderPath = require.resolve('./templateLoader')
66const stylePostLoaderPath = require . resolve ( './stylePostLoader' )
77const { resolveCompiler } = require ( '../compiler' )
88
9- const isESLintLoader = l => / ( \/ | \\ | @ ) e s l i n t - l o a d e r / . test ( l . path )
10- const isNullLoader = l => / ( \/ | \\ | @ ) n u l l - l o a d e r / . test ( l . path )
11- const isCSSLoader = l => / ( \/ | \\ | @ ) c s s - l o a d e r / . test ( l . path )
12- const isCacheLoader = l => / ( \/ | \\ | @ ) c a c h e - l o a d e r / . test ( l . path )
13- const isPitcher = l => l . path !== __filename
14- const isPreLoader = l => ! l . pitchExecuted
15- const isPostLoader = l => l . pitchExecuted
16-
17- const dedupeESLintLoader = loaders => {
9+ const isESLintLoader = ( l ) => / ( \/ | \\ | @ ) e s l i n t - l o a d e r / . test ( l . path )
10+ const isNullLoader = ( l ) => / ( \/ | \\ | @ ) n u l l - l o a d e r / . test ( l . path )
11+ const isCSSLoader = ( l ) => / ( \/ | \\ | @ ) c s s - l o a d e r / . test ( l . path )
12+ const isCacheLoader = ( l ) => / ( \/ | \\ | @ ) c a c h e - l o a d e r / . test ( l . path )
13+ const isPitcher = ( l ) => l . path !== __filename
14+ const isPreLoader = ( l ) => ! l . pitchExecuted
15+ const isPostLoader = ( l ) => l . pitchExecuted
16+
17+ const dedupeESLintLoader = ( loaders ) => {
1818 const res = [ ]
1919 let seen = false
20- loaders . forEach ( l => {
20+ loaders . forEach ( ( l ) => {
2121 if ( ! isESLintLoader ( l ) ) {
2222 res . push ( l )
2323 } else if ( ! seen ) {
@@ -28,8 +28,8 @@ const dedupeESLintLoader = loaders => {
2828 return res
2929}
3030
31- const shouldIgnoreCustomBlock = loaders => {
32- const actualLoaders = loaders . filter ( loader => {
31+ const shouldIgnoreCustomBlock = ( loaders ) => {
32+ const actualLoaders = loaders . filter ( ( loader ) => {
3333 // vue-loader
3434 if ( loader . path === selfPath ) {
3535 return false
@@ -45,7 +45,7 @@ const shouldIgnoreCustomBlock = loaders => {
4545 return actualLoaders . length === 0
4646}
4747
48- module . exports = code => code
48+ module . exports = ( code ) => code
4949
5050// This pitching loader is responsible for intercepting all vue block requests
5151// and transform it into appropriate requests.
@@ -62,7 +62,7 @@ module.exports.pitch = function (remainingRequest) {
6262 // if this is an inline block, since the whole file itself is being linted,
6363 // remove eslint-loader to avoid duplicate linting.
6464 if ( / \. v u e $ / . test ( this . resourcePath ) ) {
65- loaders = loaders . filter ( l => ! isESLintLoader ( l ) )
65+ loaders = loaders . filter ( ( l ) => ! isESLintLoader ( l ) )
6666 } else {
6767 // This is a src import. Just make sure there's not more than 1 instance
6868 // of eslint present.
@@ -78,7 +78,7 @@ module.exports.pitch = function (remainingRequest) {
7878 return
7979 }
8080
81- const genRequest = loaders => {
81+ const genRequest = ( loaders ) => {
8282 // Important: dedupe since both the original rule
8383 // and the cloned rule would match a source import request.
8484 // also make sure to dedupe based on loader path.
@@ -90,7 +90,7 @@ module.exports.pitch = function (remainingRequest) {
9090 const seen = new Map ( )
9191 const loaderStrings = [ ]
9292
93- loaders . forEach ( loader => {
93+ loaders . forEach ( ( loader ) => {
9494 const identifier =
9595 typeof loader === 'string' ? loader : loader . path + loader . query
9696 const request = typeof loader === 'string' ? loader : loader . request
@@ -133,17 +133,17 @@ module.exports.pitch = function (remainingRequest) {
133133 const cacheLoader =
134134 cacheDirectory && cacheIdentifier
135135 ? [
136- `${ require . resolve ( 'cache-loader' ) } ?${ JSON . stringify ( {
137- // For some reason, webpack fails to generate consistent hash if we
138- // use absolute paths here, even though the path is only used in a
139- // comment. For now we have to ensure cacheDirectory is a relative path.
140- cacheDirectory : ( path . isAbsolute ( cacheDirectory )
141- ? path . relative ( process . cwd ( ) , cacheDirectory )
142- : cacheDirectory
143- ) . replace ( / \\ / g, '/' ) ,
144- cacheIdentifier : hash ( cacheIdentifier ) + '-vue-loader-template'
145- } ) } `
146- ]
136+ `${ require . resolve ( 'cache-loader' ) } ?${ JSON . stringify ( {
137+ // For some reason, webpack fails to generate consistent hash if we
138+ // use absolute paths here, even though the path is only used in a
139+ // comment. For now we have to ensure cacheDirectory is a relative path.
140+ cacheDirectory : ( path . isAbsolute ( cacheDirectory )
141+ ? path . relative ( process . cwd ( ) , cacheDirectory )
142+ : cacheDirectory
143+ ) . replace ( / \\ / g, '/' ) ,
144+ cacheIdentifier : hash ( cacheIdentifier ) + '-vue-loader-template'
145+ } ) } `
146+ ]
147147 : [ ]
148148
149149 const preLoaders = loaders . filter ( isPreLoader )
0 commit comments