fix(core): update
This commit is contained in:
parent
d01905ae99
commit
7ced66fc28
5205
package-lock.json
generated
5205
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,6 @@
|
|||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@gitzone/tsbundle": "^1.0.52",
|
|
||||||
"@gitzone/tsrun": "^1.2.8",
|
"@gitzone/tsrun": "^1.2.8",
|
||||||
"@pushrocks/early": "^3.0.3",
|
"@pushrocks/early": "^3.0.3",
|
||||||
"@pushrocks/lik": "^3.0.19",
|
"@pushrocks/lik": "^3.0.19",
|
||||||
@ -34,7 +33,9 @@
|
|||||||
"@pushrocks/smartlog-destination-local": "^8.0.2",
|
"@pushrocks/smartlog-destination-local": "^8.0.2",
|
||||||
"@pushrocks/smartserve": "^1.1.39",
|
"@pushrocks/smartserve": "^1.1.39",
|
||||||
"@pushrocks/smartshell": "^2.0.25",
|
"@pushrocks/smartshell": "^2.0.25",
|
||||||
"@pushrocks/taskbuffer": "^2.1.1"
|
"@pushrocks/taskbuffer": "^2.1.1",
|
||||||
|
"@types/parcel-bundler": "^1.12.1",
|
||||||
|
"parcel-bundler": "^1.12.4"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
37
ts/tswatch.classes.parcel.ts
Normal file
37
ts/tswatch.classes.parcel.ts
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import * as plugins from './tswatch.plugins';
|
||||||
|
import * as paths from './tswatch.paths';
|
||||||
|
|
||||||
|
export class Parcel {
|
||||||
|
public async start() {
|
||||||
|
const entryFiles = plugins.path.join(paths.cwd, './html/index.html');
|
||||||
|
|
||||||
|
// Bundler options
|
||||||
|
const options: plugins.parcel.ParcelOptions = {
|
||||||
|
outDir: './dist_watch', // The out directory to put the build files in, defaults to dist
|
||||||
|
outFile: 'index.html', // The name of the outputFile
|
||||||
|
publicUrl: '/', // The url to serve on, defaults to '/'
|
||||||
|
watch: true, // Whether to watch the files and rebuild them on change, defaults to process.env.NODE_ENV !== 'production'
|
||||||
|
cache: true, // Enabled or disables caching, defaults to true
|
||||||
|
cacheDir: '.nogit/.parcelcache', // The directory cache gets put in, defaults to .cache
|
||||||
|
contentHash: false, // Disable content hash from being included on the filename
|
||||||
|
global: 'moduleName', // Expose modules as UMD under this name, disabled by default
|
||||||
|
minify: false, // Minify files, enabled if process.env.NODE_ENV === 'production'
|
||||||
|
scopeHoist: false, // Turn on experimental scope hoisting/tree shaking flag, for smaller production bundles
|
||||||
|
target: 'browser', // Browser/node/electron, defaults to browser
|
||||||
|
bundleNodeModules: true, // By default, package.json dependencies are not included when using 'node' or 'electron' with 'target' option above. Set to true to adds them to the bundle, false by default
|
||||||
|
https: null,
|
||||||
|
logLevel: 3, // 5 = save everything to a file, 4 = like 3, but with timestamps and additionally log http requests to dev server, 3 = log info, warnings & errors, 2 = log warnings & errors, 1 = log errors, 0 = log nothing
|
||||||
|
hmr: true, // Enable or disable HMR while watching
|
||||||
|
hmrPort: 3003, // The port the HMR socket runs on, defaults to a random free port (0 in node.js resolves to a random free port)
|
||||||
|
sourceMaps: true, // Enable or disable sourcemaps, defaults to enabled (minified builds currently always create sourcemaps)
|
||||||
|
hmrHostname: '', // A hostname for hot module reload, default to ''
|
||||||
|
detailedReport: false // Prints a detailed report of the bundles, assets, filesizes and times, defaults to false, reports are only printed if watch is disabled
|
||||||
|
};
|
||||||
|
|
||||||
|
const bundler = new plugins.parcel(entryFiles, options);
|
||||||
|
|
||||||
|
// Run the bundler, this returns the main bundle
|
||||||
|
// Use the events if you're using watch mode as this promise will only trigger once and not for every rebuild
|
||||||
|
const bundle = await bundler.serve(3002);
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@ import * as paths from './tswatch.paths';
|
|||||||
import * as interfaces from './interfaces';
|
import * as interfaces from './interfaces';
|
||||||
|
|
||||||
import { Watcher } from './tswatch.classes.watcher';
|
import { Watcher } from './tswatch.classes.watcher';
|
||||||
|
import { Parcel } from './tswatch.classes.parcel';
|
||||||
|
|
||||||
export class TsWatch {
|
export class TsWatch {
|
||||||
public watchmode: interfaces.TWatchModes;
|
public watchmode: interfaces.TWatchModes;
|
||||||
@ -44,18 +45,8 @@ export class TsWatch {
|
|||||||
injectReload: true,
|
injectReload: true,
|
||||||
serveDir: plugins.path.join(paths.cwd, './dist_watch/')
|
serveDir: plugins.path.join(paths.cwd, './dist_watch/')
|
||||||
});
|
});
|
||||||
this.watcherMap.add(
|
const parcel = new Parcel();
|
||||||
new Watcher({
|
await parcel.start();
|
||||||
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
|
|
||||||
commandToExecute: async () => {
|
|
||||||
const tsbundle = new plugins.tsbundle.TsBundle();
|
|
||||||
const htmlHandler = new plugins.tsbundle.HtmlHandler();
|
|
||||||
await tsbundle.buildTest('./ts_web/index.ts', './dist_watch/bundle.js');
|
|
||||||
await htmlHandler.copyHtml(plugins.path.join(process.cwd(), './dist_watch/index.html'));
|
|
||||||
},
|
|
||||||
timeout: null
|
|
||||||
})
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
case 'gitzone_website':
|
case 'gitzone_website':
|
||||||
this.watcherMap.add(
|
this.watcherMap.add(
|
||||||
|
@ -1,13 +1,6 @@
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
export { path };
|
export { path };
|
||||||
|
|
||||||
// @gitzone scope
|
|
||||||
import * as tsbundle from '@gitzone/tsbundle';
|
|
||||||
|
|
||||||
export {
|
|
||||||
tsbundle
|
|
||||||
};
|
|
||||||
|
|
||||||
// @pushrocks scope
|
// @pushrocks scope
|
||||||
import * as lik from '@pushrocks/lik';
|
import * as lik from '@pushrocks/lik';
|
||||||
import * as smartchok from '@pushrocks/smartchok';
|
import * as smartchok from '@pushrocks/smartchok';
|
||||||
@ -20,3 +13,11 @@ import * as smartshell from '@pushrocks/smartshell';
|
|||||||
import * as taskbuffer from '@pushrocks/taskbuffer';
|
import * as taskbuffer from '@pushrocks/taskbuffer';
|
||||||
|
|
||||||
export { lik, smartchok, smartcli, smartdelay, smartlog, smartlogDestinationLocal, smartserve, smartshell, taskbuffer };
|
export { lik, smartchok, smartcli, smartdelay, smartlog, smartlogDestinationLocal, smartserve, smartshell, taskbuffer };
|
||||||
|
|
||||||
|
|
||||||
|
// third party scope
|
||||||
|
import parcel from 'parcel-bundler';
|
||||||
|
|
||||||
|
export {
|
||||||
|
parcel
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user