fix(core): Fixed website watch mode execution method

This commit is contained in:
2024-12-09 02:44:35 +01:00
parent d4414638b6
commit 98a16dd181
5 changed files with 26 additions and 17 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tswatch',
version: '2.0.34',
version: '2.0.35',
description: 'watch typescript projects during development'
}

View File

@ -118,6 +118,7 @@ export class TsWatch {
break;
case 'website':
await (async () => {
const websiteExecution = new plugins.smartshell.SmartExecution('npm run startTs');
const bundleAndReloadWebsite = async () => {
await tsbundle.build(paths.cwd, './ts_web/index.ts', './dist_serve/bundle.js', {
bundler: 'esbuild',
@ -134,7 +135,9 @@ export class TsWatch {
this.watcherMap.add(
new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, `./${tsfolder}/`),
commandToExecute: `npm run startTs`,
functionToCall: async () => {
await websiteExecution.restart();
},
timeout: null,
})
);