mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Fixes #387 - Introduce warning in handleFileModified for non-existent paths.
This commit is contained in:
parent
a35e6bdbc3
commit
849c1193b9
@ -16,9 +16,10 @@
|
||||
|
||||
require('raptor-polyfill/string/endsWith');
|
||||
|
||||
var extend = require('raptor-util/extend');
|
||||
var compiler = require('../compiler');
|
||||
var nodePath = require('path');
|
||||
const extend = require('raptor-util/extend');
|
||||
const compiler = require('../compiler');
|
||||
const nodePath = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
var modifiedId = 1;
|
||||
var nextTemplateId = 0;
|
||||
@ -123,6 +124,11 @@ exports.enable = function() {
|
||||
};
|
||||
|
||||
exports.handleFileModified = function(path) {
|
||||
if (!fs.existsSync(path)) {
|
||||
console.log('[marko/hot-reload] WARNING cannot resolve template path: ', path);
|
||||
return;
|
||||
}
|
||||
|
||||
var runtime = _getMarkoRuntime();
|
||||
var basename = nodePath.basename(path);
|
||||
|
||||
@ -152,4 +158,4 @@ exports.handleFileModified = function(path) {
|
||||
compiler.clearCaches();
|
||||
modifiedId++;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user