Compare commits

..

8 Commits

Author SHA1 Message Date
27a08f11b7 1.0.72 2022-03-18 20:32:27 +01:00
073f978626 fix(core): update 2022-03-18 20:32:26 +01:00
8d7ab769e1 1.0.71 2022-03-18 20:32:00 +01:00
8ebc438e2d fix(core): update 2022-03-18 20:31:59 +01:00
d0d158ee87 1.0.70 2022-03-18 20:20:07 +01:00
3ada286495 fix(core): update 2022-03-18 20:20:07 +01:00
0514a74a07 1.0.69 2022-03-18 20:16:58 +01:00
587d08239a fix(core): update 2022-03-18 20:16:58 +01:00
3 changed files with 12 additions and 12 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@gitzone/tswatch", "name": "@gitzone/tswatch",
"version": "1.0.68", "version": "1.0.72",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@gitzone/tswatch", "name": "@gitzone/tswatch",
"version": "1.0.68", "version": "1.0.72",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@gitzone/tsbundle": "^1.0.100", "@gitzone/tsbundle": "^1.0.100",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@gitzone/tswatch", "name": "@gitzone/tswatch",
"version": "1.0.68", "version": "1.0.72",
"private": false, "private": false,
"description": "watch typescript projects during development", "description": "watch typescript projects during development",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@@ -17,6 +17,8 @@ export class TsWatch {
* starts the TsWatch instance * starts the TsWatch instance
*/ */
public async start() { public async start() {
const tsbundle = new plugins.tsbundle.TsBundle();
const htmlHandler = new plugins.tsbundle.HtmlHandler();
switch (this.watchmode) { switch (this.watchmode) {
case 'test': case 'test':
this.watcherMap.add( this.watcherMap.add(
@@ -46,9 +48,8 @@ export class TsWatch {
serveDir: plugins.path.join(paths.cwd, './dist_watch/'), serveDir: plugins.path.join(paths.cwd, './dist_watch/'),
port: 3002, port: 3002,
}); });
const tsbundle = new plugins.tsbundle.TsBundle();
const htmlHandler = new plugins.tsbundle.HtmlHandler(); const bundleAndReloadElement = async () => {
const bundleAndReload = async () => {
await tsbundle.build(paths.cwd, './html/index.ts', './dist_watch/bundle.js', { await tsbundle.build(paths.cwd, './html/index.ts', './dist_watch/bundle.js', {
bundler: 'esbuild' bundler: 'esbuild'
}); });
@@ -58,7 +59,7 @@ export class TsWatch {
new Watcher({ new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'), filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
functionToCall: async () => { functionToCall: async () => {
await bundleAndReload(); await bundleAndReloadElement();
}, },
timeout: null, timeout: null,
}) })
@@ -77,7 +78,7 @@ export class TsWatch {
'./dist_watch/index.html' './dist_watch/index.html'
) )
); );
await bundleAndReload(); await bundleAndReloadElement();
}, },
timeout: null, timeout: null,
}) })
@@ -98,17 +99,16 @@ export class TsWatch {
timeout: null, timeout: null,
}) })
); );
const bundleAndReload2 = async () => { const bundleAndReloadWebsite = async () => {
await tsbundle.build(paths.cwd, './ts_web/index.ts', './dist_serve/bundle.js', { await tsbundle.build(paths.cwd, './ts_web/index.ts', './dist_serve/bundle.js', {
bundler: 'esbuild' bundler: 'esbuild'
}); });
await smartserve.reload();
} }
this.watcherMap.add( this.watcherMap.add(
new Watcher({ new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'), filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
functionToCall: async () => { functionToCall: async () => {
await bundleAndReload2(); await bundleAndReloadWebsite();
}, },
timeout: null, timeout: null,
}) })
@@ -127,7 +127,7 @@ export class TsWatch {
'./dist_watch/index.html' './dist_watch/index.html'
) )
); );
await bundleAndReload(); await bundleAndReloadWebsite();
}, },
timeout: null, timeout: null,
}) })