@@ -33,18 +33,20 @@ module.exports = {
33
33
. when ( process . env . NODE_ENV === "production" , config => {
34
34
// Use a runtime chunk to optimize cache busting.
35
35
// Otherwise, the runtime information would be added to the entry point.
36
- config
37
- . optimization
38
- . runtimeChunk ( { name : "runtime" } ) ;
36
+ if ( ! process . env . CYPRESS_ENV ) {
37
+ config
38
+ . optimization
39
+ . runtimeChunk ( { name : "runtime" } ) ;
40
+ }
39
41
40
- // Configure path alias for rxjs.
41
- const rxPaths = require ( "rxjs/_esm2015/path-mapping" ) ;
42
- const rxResolvedPaths = rxPaths ( ) ;
43
- for ( const p in rxResolvedPaths ) {
44
- if ( rxResolvedPaths . hasOwnProperty ( p ) ) {
45
- config . resolve . alias . set ( p , rxResolvedPaths [ p ] ) ;
46
- }
42
+ // Configure path alias for rxjs.
43
+ const rxPaths = require ( "rxjs/_esm2015/path-mapping" ) ;
44
+ const rxResolvedPaths = rxPaths ( ) ;
45
+ for ( const p in rxResolvedPaths ) {
46
+ if ( rxResolvedPaths . hasOwnProperty ( p ) ) {
47
+ config . resolve . alias . set ( p , rxResolvedPaths [ p ] ) ;
47
48
}
49
+ }
48
50
49
51
// Configure style purging.
50
52
const purgeOptions = {
@@ -82,6 +84,32 @@ module.exports = {
82
84
return args ;
83
85
} )
84
86
;
87
+
88
+ // Disable fork-ts-checker and switch ts-loader to also perform type checking.
89
+ // Some optimizations are not applied otherwise, thus...
90
+ // Unluckily, this means that we cannot use thread-loader for this ...
91
+ config
92
+ . plugins
93
+ . delete ( "fork-ts-checker" ) ;
94
+
95
+ config
96
+ . module
97
+ . rule ( "ts" )
98
+ . uses
99
+ . delete ( "thread-loader" ) ;
100
+
101
+ config
102
+ . module
103
+ . rule ( "ts" )
104
+ . use ( "ts-loader" )
105
+ . options ( {
106
+ transpileOnly : false ,
107
+ appendTsSuffixTo : [
108
+ "\\.vue$"
109
+ ] ,
110
+ happyPackMode : false ,
111
+ allowTsInNodeModules : true
112
+ } ) ;
85
113
} ) ;
86
114
}
87
115
} ;
0 commit comments