fix(core): update
This commit is contained in:
17
ts/index.ts
17
ts/index.ts
@@ -2,10 +2,14 @@ import * as plugins from './websetup.plugins';
|
||||
|
||||
import { setupGoogleAnalytics } from './tools/ganalytics';
|
||||
import { setupFullStory } from './tools/fullstory';
|
||||
import { setupServiceWoker } from './serviceworker';
|
||||
import { IMetaObject, setupMetaInformation } from './meta';
|
||||
|
||||
export interface IWebSetupConstructorOptions {
|
||||
googleAnalyticsCode?: string;
|
||||
fsCode?: string;
|
||||
metaObject: IMetaObject;
|
||||
serviceworker?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -13,12 +17,21 @@ export interface IWebSetupConstructorOptions {
|
||||
*/
|
||||
export class WebSetup {
|
||||
constructor(optionsArg: IWebSetupConstructorOptions) {
|
||||
// most important, lets get the meta information in place
|
||||
this.setup(optionsArg);
|
||||
}
|
||||
|
||||
async setup(optionsArg: IWebSetupConstructorOptions) {
|
||||
if(optionsArg.serviceworker) {
|
||||
await setupServiceWoker()
|
||||
}
|
||||
|
||||
if (optionsArg.googleAnalyticsCode) {
|
||||
setupGoogleAnalytics(optionsArg.googleAnalyticsCode);
|
||||
await setupGoogleAnalytics(optionsArg.googleAnalyticsCode);
|
||||
}
|
||||
|
||||
if (optionsArg.fsCode) {
|
||||
setupFullStory(optionsArg.fsCode)
|
||||
await setupFullStory(optionsArg.fsCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user