File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export type LoaderContext = {
59
59
options : ?{
60
60
isAbsolute : boolean ,
61
61
}
62
- ) => TranspiledModule , // eslint-disable-line no-use-before-define
62
+ ) => ? TranspiledModule , // eslint-disable-line no-use-before-define
63
63
addDependenciesInDirectory : (
64
64
depPath : string ,
65
65
options : {
@@ -252,7 +252,7 @@ export default class TranspiledModule {
252
252
depPath . startsWith ( 'babel-runtime' ) ||
253
253
depPath . startsWith ( 'codesandbox-api' )
254
254
) {
255
- return ;
255
+ return null ;
256
256
}
257
257
258
258
try {
@@ -497,10 +497,18 @@ export default class TranspiledModule {
497
497
}
498
498
499
499
postEvaluate ( manager : Manager ) {
500
+ // For non cacheable transpilers we remove the cached evaluation
501
+ if (
502
+ manager . preset
503
+ . getLoaders ( this . module , this . query )
504
+ . some ( t => ! t . transpiler . cacheable )
505
+ ) {
506
+ this . compilation = null ;
507
+ }
508
+
500
509
// There are no other modules calling this module, so we run a function on
501
510
// all transpilers that clears side effects if there are any. Example:
502
511
// Remove CSS styles from the dom.
503
-
504
512
if ( this . initiators . size === 0 && ! this . isEntry ) {
505
513
manager . preset . getLoaders ( this . module , this . query ) . forEach ( t => {
506
514
t . transpiler . cleanModule ( this . getLoaderContext ( manager , t . options ) ) ;
You can’t perform that action at this time.
0 commit comments