Skip to content

Commit 1968706

Browse files
authored
chore(build): simplify analytics config generation (#671)
Templates are what template strings are for. :)
1 parent f2734d7 commit 1968706

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

packages/build/src/analytics.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import util from 'util';
22
import fs from 'fs';
3-
import handlebars from 'handlebars';
4-
5-
/**
6-
* The template.
7-
*/
8-
const TEMPLATE = 'module.exports = { SEGMENT_API_KEY: "{{segmentKey}}" };';
93

104
/**
115
* Create the analytics config.
@@ -15,8 +9,7 @@ const TEMPLATE = 'module.exports = { SEGMENT_API_KEY: "{{segmentKey}}" };';
159
* @returns {string} The compiled template.
1610
*/
1711
export function createAnalyticsConfig(segmentKey: string): string {
18-
const template = handlebars.compile(TEMPLATE);
19-
return template({ segmentKey: segmentKey });
12+
return `module.exports = { SEGMENT_API_KEY: ${JSON.stringify(segmentKey)} };`;
2013
}
2114

2215
/**

0 commit comments

Comments
 (0)