@@ -22,12 +22,13 @@ module.exports = (api, projectOptions) => {
22
22
const tsxRule = config . module . rule ( 'tsx' ) . test ( / \. t s x $ / )
23
23
24
24
// add a loader to both *.ts & vue<lang="ts">
25
- const addLoader = ( { loader, options } ) => {
26
- tsRule . use ( loader ) . loader ( loader ) . options ( options )
27
- tsxRule . use ( loader ) . loader ( loader ) . options ( options )
25
+ const addLoader = ( { name , loader, options } ) => {
26
+ tsRule . use ( name ) . loader ( loader ) . options ( options )
27
+ tsxRule . use ( name ) . loader ( loader ) . options ( options )
28
28
}
29
29
30
30
addLoader ( {
31
+ name : 'cache-loader' ,
31
32
loader : require . resolve ( 'cache-loader' ) ,
32
33
options : api . genCacheConfig ( 'ts-loader' , {
33
34
'ts-loader' : require ( 'ts-loader/package.json' ) . version ,
@@ -38,6 +39,7 @@ module.exports = (api, projectOptions) => {
38
39
39
40
if ( useThreads ) {
40
41
addLoader ( {
42
+ name : 'thread-loader' ,
41
43
loader : require . resolve ( 'thread-loader' ) ,
42
44
options :
43
45
typeof projectOptions . parallel === 'number'
@@ -51,11 +53,13 @@ module.exports = (api, projectOptions) => {
51
53
// TODO: I guess the intent is to require the `babel-loader` provided by the Babel vue
52
54
// plugin, but that means we now rely on the hoisting. It should instead be queried
53
55
// against the plugin itself, or through a peer dependency.
56
+ name : 'babel-loader' ,
54
57
// eslint-disable-next-line node/no-extraneous-require
55
58
loader : require . resolve ( 'babel-loader' )
56
59
} )
57
60
}
58
61
addLoader ( {
62
+ name : 'ts-loader' ,
59
63
loader : require . resolve ( 'ts-loader' ) ,
60
64
options : {
61
65
transpileOnly : true ,
0 commit comments