mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-22 07:05:24 +00:00
use watchChange plugin hook to detect invalidations
This commit is contained in:
@@ -105,6 +105,13 @@ export class RollupCompiler {
|
|||||||
const mod: any = require(input);
|
const mod: any = require(input);
|
||||||
delete require.cache[input];
|
delete require.cache[input];
|
||||||
|
|
||||||
|
(mod.plugins || (mod.plugins = [])).push({
|
||||||
|
name: 'sapper-internal',
|
||||||
|
watchChange: (file: string) => {
|
||||||
|
this._oninvalid(file);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return mod;
|
return mod;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,8 +154,6 @@ export class RollupCompiler {
|
|||||||
|
|
||||||
case 'BUNDLE_START':
|
case 'BUNDLE_START':
|
||||||
this._start = Date.now();
|
this._start = Date.now();
|
||||||
// TODO figure out which file changed
|
|
||||||
this._oninvalid('[TODO] unknown file');
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'BUNDLE_END':
|
case 'BUNDLE_END':
|
||||||
|
|||||||
Reference in New Issue
Block a user