Added deCache support

This commit is contained in:
斟酌 鵬兄 2015-06-03 14:45:45 +08:00
parent 4b6d913ef9
commit 07a26a2568

View File

@ -13,7 +13,7 @@ Package.prototype.rootNS = function( name, path )
rootNS[ name ] = fs.realpathSync( path ) + "/"; rootNS[ name ] = fs.realpathSync( path ) + "/";
}; };
Package.prototype.load = function( _class ) Package.prototype.load = function( _class, deCache )
{ {
var fSep = _class.indexOf( "." ); var fSep = _class.indexOf( "." );
var nsdomain = _class.substr( 0, fSep ); var nsdomain = _class.substr( 0, fSep );
@ -24,6 +24,10 @@ Package.prototype.load = function( _class )
var lClass = require( file ); var lClass = require( file );
// TODO: Implements filewatcher // TODO: Implements filewatcher
if( deCache )
{
delete require.cache[ require.resolve( file ) ];
}
return lClass; return lClass;
}; };