@@ -706,22 +706,33 @@ export default class Manager {
706706 Object . keys ( this . transpiledModules [ path ] . tModules ) . forEach ( query => {
707707 const tModule = this . transpiledModules [ path ] . tModules [ query ] ;
708708
709- // Only save modules that are not precomputed
710- if ( tModule . module . requires == null ) {
709+ if (
710+ ! this . manifest . contents [ tModule . module . path ] ||
711+ ( tModule . module . path . endsWith ( '.js' ) &&
712+ tModule . module . requires == null )
713+ ) {
714+ // Only save modules that are not precomputed
711715 serializedTModules [ tModule . getId ( ) ] = tModule . serialize ( ) ;
712716 }
713717 } ) ;
714718 } ) ;
715719
716720 const dependenciesQuery = this . getDependencyQuery ( ) ;
717721
722+ const meta = { } ;
723+ Object . keys ( getCombinedMetas ( ) || { } ) . forEach ( p => {
724+ const dir = pathUtils . dirname ( p . replace ( '/node_modules' , '' ) ) ;
725+ meta [ dir ] = meta [ dir ] || [ ] ;
726+ meta [ dir ] . push ( pathUtils . basename ( p ) ) ;
727+ } ) ;
728+
718729 return {
719730 transpiledModules : serializedTModules ,
720731 cachedPaths : this . cachedPaths ,
721732 version : SCRIPT_VERSION ,
722733 timestamp : new Date ( ) . getTime ( ) ,
723734 configurations : this . configurations ,
724- meta : getCombinedMetas ( ) ,
735+ meta ,
725736 dependenciesQuery ,
726737 } ;
727738 }
@@ -767,7 +778,13 @@ export default class Manager {
767778 version === SCRIPT_VERSION &&
768779 dependenciesQuery === this . getDependencyQuery ( )
769780 ) {
770- setCombinedMetas ( meta ) ;
781+ const combinedMetas = { } ;
782+ Object . keys ( meta ) . forEach ( dir => {
783+ meta [ dir ] . forEach ( file => {
784+ combinedMetas [ `/node_modules` + dir + '/' + file ] = true ;
785+ } ) ;
786+ } ) ;
787+ setCombinedMetas ( combinedMetas ) ;
771788
772789 this . cachedPaths = cachedPaths ;
773790 this . configurations = configurations ;
@@ -794,7 +811,8 @@ export default class Manager {
794811 }
795812 } catch ( e ) {
796813 if ( process . env . NODE_ENV === 'development' ) {
797- console . error ( e ) ;
814+ console . warn ( 'Problems parsing cache' ) ;
815+ console . warn ( e ) ;
798816 }
799817 }
800818 this . clearCache ( ) ;
0 commit comments