-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathindex.mjs
More file actions
37 lines (26 loc) · 1.16 KB
/
index.mjs
File metadata and controls
37 lines (26 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* global process:readonly */
import 'core-js/features/object/entries.js';
import createAdapters from './createAdapters.mjs';
const buildTool = process.env.build_tool;
const moduleFormat = process.env.module_format;
const version = process.env.npm_package_version;
const buildInfo = { buildTool, moduleFormat, version };
export { buildInfo, createAdapters };
if (typeof HTMLDocument !== 'undefined' && typeof document !== 'undefined' && document instanceof HTMLDocument) {
const version = process.env.npm_package_version;
const versionMeta = document.createElement('meta');
versionMeta.setAttribute('name', 'botframework-directlinespeech:version');
versionMeta.setAttribute('content', version);
document.head.appendChild(versionMeta);
const packageMeta = document.createElement('meta');
packageMeta.setAttribute('name', 'botframework-directlinespeech');
packageMeta.setAttribute('content', `version=${version}; build_tool=${buildTool}; format=${moduleFormat}`);
document.head.appendChild(packageMeta);
}
if (moduleFormat === 'global') {
window.DirectLineSpeech = Object.freeze({
...window.DirectLineSpeech,
buildInfo,
createAdapters
});
}