Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions packages/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ program
const addHandler = (filePath) => {
logger.info(`[${new Date().toLocaleTimeString()}] Reload for file add: ${filePath}`);
logger.info('Synchronizing opened pages list before reload');
const normalizedActiveUrls = liveServer.getActiveUrls().map(url => fsUtil.removeExtension(url));
const normalizedActiveUrls = liveServer.getActiveUrls().map((url) => {
const completeUrl = path.extname(url) === '' ? path.join(url, 'index') : url;
return fsUtil.removeExtension(completeUrl);
});
site.changeCurrentOpenedPages(normalizedActiveUrls);
Promise.resolve('').then(() => {
if (site.isFilepathAPage(filePath) || site.isDependencyOfPage(filePath)) {
Expand All @@ -156,7 +159,10 @@ program
const changeHandler = (filePath) => {
logger.info(`[${new Date().toLocaleTimeString()}] Reload for file change: ${filePath}`);
logger.info('Synchronizing opened pages list before reload');
const normalizedActiveUrls = liveServer.getActiveUrls().map(url => fsUtil.removeExtension(url));
const normalizedActiveUrls = liveServer.getActiveUrls().map((url) => {
const completeUrl = path.extname(url) === '' ? path.join(url, 'index') : url;
return fsUtil.removeExtension(completeUrl);
});
site.changeCurrentOpenedPages(normalizedActiveUrls);
Promise.resolve('').then(() => {
if (path.basename(filePath) === SITE_CONFIG_NAME) {
Expand All @@ -174,7 +180,10 @@ program
const removeHandler = (filePath) => {
logger.info(`[${new Date().toLocaleTimeString()}] Reload for file deletion: ${filePath}`);
logger.info('Synchronizing opened pages list before reload');
const normalizedActiveUrls = liveServer.getActiveUrls().map(url => fsUtil.removeExtension(url));
const normalizedActiveUrls = liveServer.getActiveUrls().map((url) => {
const completeUrl = path.extname(url) === '' ? path.join(url, 'index') : url;
return fsUtil.removeExtension(completeUrl);
});
site.changeCurrentOpenedPages(normalizedActiveUrls);
Promise.resolve('').then(() => {
if (site.isFilepathAPage(filePath) || site.isDependencyOfPage(filePath)) {
Expand Down