fix(core): update

This commit is contained in:
2022-03-18 13:18:15 +01:00
parent ef5d4d2a9c
commit 0eec0c04e8
4 changed files with 161 additions and 1010 deletions

View File

@ -43,17 +43,26 @@ export class TsWatch {
);
const smartserve = new plugins.smartserve.SmartServe({
injectReload: true,
serveDir: plugins.path.join(paths.cwd, './ts_web/'),
serveDir: plugins.path.join(paths.cwd, './dist_watch/'),
port: 3002,
});
const tsbundle = new plugins.tsbundle.TsBundle();
const bundleAndReload = async () => {
await tsbundle.build(paths.cwd, './ts_web/index.ts', './dist_watch/bundle.js', {
bundler: 'esbuild'
});
await smartserve.reload();
}
this.watcherMap.add(
new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
commandToExecute: 'npm run bundle',
functionToCall: smartserve.reload,
functionToCall: async () => {
await bundleAndReload();
},
timeout: null,
})
);
await smartserve.start();
/* const parcel = new plugins.smartparcel.Parcel(
plugins.path.join(process.cwd(), './html/index.html'),
plugins.path.join(process.cwd(), './dist_watch'),
@ -69,6 +78,13 @@ export class TsWatch {
timeout: null,
})
);
this.watcherMap.add(
new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
commandToExecute: 'npm run bundle',
timeout: null,
})
);
// client directory
/* const parcelWebsite = new plugins.smartparcel.Parcel(

View File

@ -1,6 +1,13 @@
// node native scope
import * as path from 'path';
export { path };
// @gitzone scope
import * as tsbundle from '@gitzone/tsbundle';
export {
tsbundle
}
// @pushrocks scope
import * as lik from '@pushrocks/lik';
import * as smartchok from '@pushrocks/smartchok';