Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions packages/build/src/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import util from 'util';
import fs from 'fs';
import handlebars from 'handlebars';

/**
* The template.
*/
const TEMPLATE = 'module.exports = { SEGMENT_API_KEY: "{{segmentKey}}" };';

/**
* Create the analytics config.
Expand All @@ -15,8 +9,7 @@ const TEMPLATE = 'module.exports = { SEGMENT_API_KEY: "{{segmentKey}}" };';
* @returns {string} The compiled template.
*/
export function createAnalyticsConfig(segmentKey: string): string {
const template = handlebars.compile(TEMPLATE);
return template({ segmentKey: segmentKey });
return `module.exports = { SEGMENT_API_KEY: ${JSON.stringify(segmentKey)} };`;
}

/**
Expand Down