@picovoice/eagle-web 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,141 +1,143 @@
1
- import { PvModel } from '@picovoice/web-utils';
2
- export declare enum PvStatus {
3
- SUCCESS = 10000,
4
- OUT_OF_MEMORY = 10001,
5
- IO_ERROR = 10002,
6
- INVALID_ARGUMENT = 10003,
7
- STOP_ITERATION = 10004,
8
- KEY_ERROR = 10005,
9
- INVALID_STATE = 10006,
10
- RUNTIME_ERROR = 10007,
11
- ACTIVATION_ERROR = 10008,
12
- ACTIVATION_LIMIT_REACHED = 10009,
13
- ACTIVATION_THROTTLED = 10010,
14
- ACTIVATION_REFUSED = 10011
15
- }
16
- /**
17
- * EagleModel types
18
- */
19
- export type EagleModel = PvModel;
20
- export declare enum EagleProfilerEnrollFeedback {
21
- AUDIO_OK = 0,
22
- AUDIO_TOO_SHORT = 1,
23
- UNKNOWN_SPEAKER = 2,
24
- NO_VOICE_FOUND = 3,
25
- QUALITY_ISSUE = 4
26
- }
27
- export type EagleProfile = {
28
- /** Buffer containing the speaker profile. */
29
- bytes: Uint8Array;
30
- };
31
- export type EagleOptions = {
32
- /** @defaultValue `best` */
33
- device?: string;
34
- };
35
- export type EagleProfilerOptions = {
36
- /** @defaultValue `best` */
37
- device?: string;
38
- };
39
- export type EagleProfilerEnrollResult = {
40
- feedback: EagleProfilerEnrollFeedback;
41
- percentage: number;
42
- };
43
- export type EagleProfilerWorkerInitRequest = {
44
- command: 'init';
45
- accessKey: string;
46
- modelPath: string;
47
- options: EagleProfilerOptions;
48
- wasmSimd: string;
49
- wasmSimdLib: string;
50
- wasmPThread: string;
51
- wasmPThreadLib: string;
52
- sdk: string;
53
- };
54
- export type EagleProfilerWorkerEnrollRequest = {
55
- command: 'enroll';
56
- inputFrame: Int16Array;
57
- };
58
- export type EagleProfilerWorkerExportRequest = {
59
- command: 'export';
60
- };
61
- export type EagleProfilerWorkerResetRequest = {
62
- command: 'reset';
63
- };
64
- export type EagleProfilerWorkerReleaseRequest = {
65
- command: 'release';
66
- };
67
- export type EagleProfilerWorkerRequest = EagleProfilerWorkerInitRequest | EagleProfilerWorkerEnrollRequest | EagleProfilerWorkerExportRequest | EagleProfilerWorkerResetRequest | EagleProfilerWorkerReleaseRequest;
68
- export type EagleProfilerWorkerFailureResponse = {
69
- command: 'failed' | 'error';
70
- status: PvStatus;
71
- shortMessage: string;
72
- messageStack: string[];
73
- };
74
- export type EagleProfilerWorkerInitResponse = EagleProfilerWorkerFailureResponse | {
75
- command: 'ok';
76
- minEnrollSamples: number;
77
- sampleRate: number;
78
- version: string;
79
- };
80
- export type EagleProfilerWorkerEnrollResponse = EagleProfilerWorkerFailureResponse | {
81
- command: 'ok';
82
- result: EagleProfilerEnrollResult;
83
- };
84
- export type EagleProfilerWorkerExportResponse = EagleProfilerWorkerFailureResponse | {
85
- command: 'ok';
86
- profile: EagleProfile;
87
- };
88
- export type EagleProfilerWorkerResetResponse = EagleProfilerWorkerFailureResponse | {
89
- command: 'ok';
90
- };
91
- export type EagleProfilerWorkerReleaseResponse = EagleProfilerWorkerFailureResponse | {
92
- command: 'ok';
93
- };
94
- export type EagleProfilerWorkerResponse = EagleProfilerWorkerInitResponse | EagleProfilerWorkerEnrollResponse | EagleProfilerWorkerExportResponse | EagleProfilerWorkerResetResponse | EagleProfilerWorkerReleaseResponse;
95
- export type EagleWorkerInitRequest = {
96
- command: 'init';
97
- accessKey: string;
98
- modelPath: string;
99
- speakerProfiles: EagleProfile[];
100
- options: EagleOptions;
101
- wasmSimd: string;
102
- wasmSimdLib: string;
103
- wasmPThread: string;
104
- wasmPThreadLib: string;
105
- sdk: string;
106
- };
107
- export type EagleWorkerProcessRequest = {
108
- command: 'process';
109
- inputFrame: Int16Array;
110
- };
111
- export type EagleWorkerResetRequest = {
112
- command: 'reset';
113
- };
114
- export type EagleWorkerReleaseRequest = {
115
- command: 'release';
116
- };
117
- export type EagleWorkerRequest = EagleWorkerInitRequest | EagleWorkerProcessRequest | EagleWorkerResetRequest | EagleWorkerReleaseRequest;
118
- export type EagleWorkerFailureResponse = {
119
- command: 'failed' | 'error';
120
- status: PvStatus;
121
- shortMessage: string;
122
- messageStack: string[];
123
- };
124
- export type EagleWorkerInitResponse = EagleWorkerFailureResponse | {
125
- command: 'ok';
126
- frameLength: number;
127
- sampleRate: number;
128
- version: string;
129
- };
130
- export type EagleWorkerProcessResponse = EagleWorkerFailureResponse | {
131
- command: 'ok';
132
- scores: number[];
133
- };
134
- export type EagleWorkerResetResponse = EagleWorkerFailureResponse | {
135
- command: 'ok';
136
- };
137
- export type EagleWorkerReleaseResponse = EagleWorkerFailureResponse | {
138
- command: 'ok';
139
- };
140
- export type EagleWorkerResponse = EagleWorkerInitResponse | EagleWorkerProcessResponse | EagleWorkerResetResponse | EagleWorkerReleaseResponse;
1
+ import { PvModel } from '@picovoice/web-utils';
2
+ export declare enum PvStatus {
3
+ SUCCESS = 10000,
4
+ OUT_OF_MEMORY = 10001,
5
+ IO_ERROR = 10002,
6
+ INVALID_ARGUMENT = 10003,
7
+ STOP_ITERATION = 10004,
8
+ KEY_ERROR = 10005,
9
+ INVALID_STATE = 10006,
10
+ RUNTIME_ERROR = 10007,
11
+ ACTIVATION_ERROR = 10008,
12
+ ACTIVATION_LIMIT_REACHED = 10009,
13
+ ACTIVATION_THROTTLED = 10010,
14
+ ACTIVATION_REFUSED = 10011
15
+ }
16
+ /**
17
+ * EagleModel types
18
+ */
19
+ export type EagleModel = PvModel;
20
+ export type EagleProfile = {
21
+ /** Buffer containing the speaker profile. */
22
+ bytes: Uint8Array;
23
+ };
24
+ export type EagleOptions = {
25
+ /** @defaultValue `best` */
26
+ device?: string;
27
+ /** @defaultValue `0.3` */
28
+ voiceThreshold?: number;
29
+ };
30
+ export type EagleProfilerOptions = {
31
+ /** @defaultValue `best` */
32
+ device?: string;
33
+ /** @defaultValue `1` */
34
+ minEnrollmentChunks?: number;
35
+ /** @defaultValue `0.3` */
36
+ voiceThreshold?: number;
37
+ };
38
+ export type EagleProfilerWorkerInitRequest = {
39
+ command: 'init';
40
+ accessKey: string;
41
+ modelPath: string;
42
+ options: EagleProfilerOptions;
43
+ wasmSimd: string;
44
+ wasmSimdLib: string;
45
+ wasmPThread: string;
46
+ wasmPThreadLib: string;
47
+ sdk: string;
48
+ };
49
+ export type EagleProfilerWorkerEnrollRequest = {
50
+ command: 'enroll';
51
+ inputFrame: Int16Array;
52
+ };
53
+ export type EagleProfilerWorkerFlushRequest = {
54
+ command: 'flush';
55
+ };
56
+ export type EagleProfilerWorkerExportRequest = {
57
+ command: 'export';
58
+ };
59
+ export type EagleProfilerWorkerResetRequest = {
60
+ command: 'reset';
61
+ };
62
+ export type EagleProfilerWorkerReleaseRequest = {
63
+ command: 'release';
64
+ };
65
+ export type EagleProfilerWorkerRequest = EagleProfilerWorkerInitRequest | EagleProfilerWorkerEnrollRequest | EagleProfilerWorkerFlushRequest | EagleProfilerWorkerExportRequest | EagleProfilerWorkerResetRequest | EagleProfilerWorkerReleaseRequest;
66
+ export type EagleProfilerWorkerFailureResponse = {
67
+ command: 'failed' | 'error';
68
+ status: PvStatus;
69
+ shortMessage: string;
70
+ messageStack: string[];
71
+ };
72
+ export type EagleProfilerWorkerInitResponse = EagleProfilerWorkerFailureResponse | {
73
+ command: 'ok';
74
+ frameLength: number;
75
+ sampleRate: number;
76
+ version: string;
77
+ };
78
+ export type EagleProfilerWorkerEnrollResponse = EagleProfilerWorkerFailureResponse | {
79
+ command: 'ok';
80
+ result: number;
81
+ };
82
+ export type EagleProfilerWorkerFlushResponse = EagleProfilerWorkerFailureResponse | {
83
+ command: 'ok';
84
+ result: number;
85
+ };
86
+ export type EagleProfilerWorkerExportResponse = EagleProfilerWorkerFailureResponse | {
87
+ command: 'ok';
88
+ profile: EagleProfile;
89
+ };
90
+ export type EagleProfilerWorkerResetResponse = EagleProfilerWorkerFailureResponse | {
91
+ command: 'ok';
92
+ };
93
+ export type EagleProfilerWorkerReleaseResponse = EagleProfilerWorkerFailureResponse | {
94
+ command: 'ok';
95
+ };
96
+ export type EagleProfilerWorkerResponse = EagleProfilerWorkerInitResponse | EagleProfilerWorkerEnrollResponse | EagleProfilerWorkerFlushResponse | EagleProfilerWorkerExportResponse | EagleProfilerWorkerResetResponse | EagleProfilerWorkerReleaseResponse;
97
+ export type EagleWorkerInitRequest = {
98
+ command: 'init';
99
+ accessKey: string;
100
+ modelPath: string;
101
+ options: EagleOptions;
102
+ wasmSimd: string;
103
+ wasmSimdLib: string;
104
+ wasmPThread: string;
105
+ wasmPThreadLib: string;
106
+ sdk: string;
107
+ };
108
+ export type EagleWorkerProcessRequest = {
109
+ command: 'process';
110
+ inputFrame: Int16Array;
111
+ speakerProfiles: EagleProfile[];
112
+ };
113
+ export type EagleWorkerResetRequest = {
114
+ command: 'reset';
115
+ };
116
+ export type EagleWorkerReleaseRequest = {
117
+ command: 'release';
118
+ };
119
+ export type EagleWorkerRequest = EagleWorkerInitRequest | EagleWorkerProcessRequest | EagleWorkerResetRequest | EagleWorkerReleaseRequest;
120
+ export type EagleWorkerFailureResponse = {
121
+ command: 'failed' | 'error';
122
+ status: PvStatus;
123
+ shortMessage: string;
124
+ messageStack: string[];
125
+ };
126
+ export type EagleWorkerInitResponse = EagleWorkerFailureResponse | {
127
+ command: 'ok';
128
+ minProcessSamples: number;
129
+ sampleRate: number;
130
+ version: string;
131
+ };
132
+ export type EagleWorkerProcessResponse = EagleWorkerFailureResponse | {
133
+ command: 'ok';
134
+ scores: number[];
135
+ };
136
+ export type EagleWorkerResetResponse = EagleWorkerFailureResponse | {
137
+ command: 'ok';
138
+ };
139
+ export type EagleWorkerReleaseResponse = EagleWorkerFailureResponse | {
140
+ command: 'ok';
141
+ };
142
+ export type EagleWorkerResponse = EagleWorkerInitResponse | EagleWorkerProcessResponse | EagleWorkerResetResponse | EagleWorkerReleaseResponse;
141
143
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"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tB,yBAAyB,GACzB,uBAAuB,GACvB,yBAAyB,CAAC;AAE9B,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC5B,MAAM,EAAE,QAAQ,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAC/B,0BAA0B,GAC1B;IACE,OAAO,EAAE,IAAI,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEN,MAAM,MAAM,0BAA0B,GAClC,0BAA0B,GAC1B;IACE,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEN,MAAM,MAAM,wBAAwB,GAChC,0BAA0B,GAC1B;IACE,OAAO,EAAE,IAAI,CAAC;CACf,CAAC;AAEN,MAAM,MAAM,0BAA0B,GAClC,0BAA0B,GAC1B;IACE,OAAO,EAAE,IAAI,CAAC;CACf,CAAC;AAEN,MAAM,MAAM,mBAAmB,GAC3B,uBAAuB,GACvB,0BAA0B,GAC1B,wBAAwB,GACxB,0BAA0B,CAAC"}
package/module.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- declare module "*.wasm" {
2
- const content: string;
3
- export default content;
4
- }
5
-
6
- declare module "*.txt" {
7
- const content: string;
8
- export default content;
9
- }
10
-
11
- declare module 'web-worker:*.ts' {
12
- const WorkerFactory: new () => Worker;
13
- export default WorkerFactory;
14
- }
15
-
16
- /// <reference types="vite/client" />
1
+ declare module "*.wasm" {
2
+ const content: string;
3
+ export default content;
4
+ }
5
+
6
+ declare module "*.txt" {
7
+ const content: string;
8
+ export default content;
9
+ }
10
+
11
+ declare module 'web-worker:*.ts' {
12
+ const WorkerFactory: new () => Worker;
13
+ export default WorkerFactory;
14
+ }
15
+
16
+ /// <reference types="vite/client" />
package/package.json CHANGED
@@ -1,73 +1,73 @@
1
- {
2
- "name": "@picovoice/eagle-web",
3
- "description": "Eagle Speaker Recognition engine for web browsers (via WebAssembly)",
4
- "author": "Picovoice Inc",
5
- "license": "Apache-2.0",
6
- "version": "2.0.0",
7
- "keywords": [
8
- "eagle",
9
- "web",
10
- "voice",
11
- "speech",
12
- "ai",
13
- "speaker recognition",
14
- "speaker verification",
15
- "speaker authentication",
16
- "speaker identification",
17
- "offline",
18
- "private",
19
- "dom"
20
- ],
21
- "entry": "src/index.ts",
22
- "module": "dist/esm/index.js",
23
- "iife": "dist/iife/index.js",
24
- "types": "dist/types/index.d.ts",
25
- "scripts": {
26
- "build:all": "rollup --config",
27
- "build:types": "tsc --declaration --declarationMap --emitDeclarationOnly --outDir ./dist/types",
28
- "build": "npm-run-all --parallel build:**",
29
- "lint": "eslint . --ext .js,.ts",
30
- "prepack": "npm-run-all build",
31
- "start": "cross-env TARGET='debug' rollup --config --watch",
32
- "watch": "rollup --config --watch",
33
- "format": "prettier --write \"**/*.{js,ts,json}\"",
34
- "copywasm": "node scripts/copy_wasm.js",
35
- "setup-test": "node scripts/setup_test.js && npx pvbase64 -i ./test/eagle_params.pv -o ./test/eagle_params.js",
36
- "test": "cypress run --spec test/eagle.test.ts --browser chrome",
37
- "test-perf": "cypress run --spec test/eagle_perf.test.ts --browser chrome"
38
- },
39
- "dependencies": {
40
- "@picovoice/web-utils": "=1.4.3"
41
- },
42
- "devDependencies": {
43
- "@babel/core": "^7.20.12",
44
- "@babel/plugin-transform-runtime": "^7.19.6",
45
- "@babel/preset-env": "^7.20.2",
46
- "@babel/runtime": "^7.20.13",
47
- "@rollup/plugin-babel": "^6.0.3",
48
- "@rollup/plugin-commonjs": "^24.0.1",
49
- "@rollup/plugin-node-resolve": "^15.0.1",
50
- "@rollup/plugin-terser": "^0.4.0",
51
- "@rollup/pluginutils": "^5.0.2",
52
- "@types/emscripten": "1.40.0",
53
- "@types/node": "^18.13.0",
54
- "@typescript-eslint/eslint-plugin": "^5.51.0",
55
- "@typescript-eslint/parser": "^5.51.0",
56
- "async-mutex": "^0.4.0",
57
- "cross-env": "^7.0.3",
58
- "cypress": "^12.5.1",
59
- "eslint": "^8.22.0",
60
- "eslint-plugin-cypress": "^2.12.1",
61
- "npm-run-all": "^4.1.5",
62
- "prettier": "^2.8.3",
63
- "rollup": "^2.79.1",
64
- "rollup-plugin-typescript2": "^0.34.1",
65
- "rollup-plugin-web-worker-loader": "^1.6.1",
66
- "tslib": "^2.5.0",
67
- "typescript": "^4.9.5",
68
- "wasm-feature-detect": "^1.5.0"
69
- },
70
- "engines": {
71
- "node": ">=18"
72
- }
73
- }
1
+ {
2
+ "name": "@picovoice/eagle-web",
3
+ "description": "Eagle Speaker Recognition engine for web browsers (via WebAssembly)",
4
+ "author": "Picovoice Inc",
5
+ "license": "Apache-2.0",
6
+ "version": "3.0.0",
7
+ "keywords": [
8
+ "eagle",
9
+ "web",
10
+ "voice",
11
+ "speech",
12
+ "ai",
13
+ "speaker recognition",
14
+ "speaker verification",
15
+ "speaker authentication",
16
+ "speaker identification",
17
+ "offline",
18
+ "private",
19
+ "dom"
20
+ ],
21
+ "entry": "src/index.ts",
22
+ "module": "dist/esm/index.js",
23
+ "iife": "dist/iife/index.js",
24
+ "types": "dist/types/index.d.ts",
25
+ "scripts": {
26
+ "build:all": "rollup --config",
27
+ "build:types": "tsc --declaration --declarationMap --emitDeclarationOnly --outDir ./dist/types",
28
+ "build": "npm-run-all --parallel build:**",
29
+ "lint": "eslint . --ext .js,.ts",
30
+ "prepack": "npm-run-all build",
31
+ "start": "cross-env TARGET='debug' rollup --config --watch",
32
+ "watch": "rollup --config --watch",
33
+ "format": "prettier --write \"**/*.{js,ts,json}\"",
34
+ "copywasm": "node scripts/copy_wasm.js",
35
+ "setup-test": "node scripts/setup_test.js && npx pvbase64 -i ./test/eagle_params.pv -o ./test/eagle_params.js",
36
+ "test": "cypress run --spec test/eagle.test.ts --browser chrome",
37
+ "test-perf": "cypress run --spec test/eagle_perf.test.ts --browser chrome"
38
+ },
39
+ "dependencies": {
40
+ "@picovoice/web-utils": "=1.4.3"
41
+ },
42
+ "devDependencies": {
43
+ "@babel/core": "^7.20.12",
44
+ "@babel/plugin-transform-runtime": "^7.19.6",
45
+ "@babel/preset-env": "^7.20.2",
46
+ "@babel/runtime": "^7.20.13",
47
+ "@rollup/plugin-babel": "^6.0.3",
48
+ "@rollup/plugin-commonjs": "^24.0.1",
49
+ "@rollup/plugin-node-resolve": "^15.0.1",
50
+ "@rollup/plugin-terser": "^0.4.0",
51
+ "@rollup/pluginutils": "^5.0.2",
52
+ "@types/emscripten": "1.40.0",
53
+ "@types/node": "^18.13.0",
54
+ "@typescript-eslint/eslint-plugin": "^5.51.0",
55
+ "@typescript-eslint/parser": "^5.51.0",
56
+ "async-mutex": "^0.4.0",
57
+ "cross-env": "^7.0.3",
58
+ "cypress": "^12.5.1",
59
+ "eslint": "^8.22.0",
60
+ "eslint-plugin-cypress": "^2.12.1",
61
+ "npm-run-all": "^4.1.5",
62
+ "prettier": "^2.8.3",
63
+ "rollup": "^2.79.1",
64
+ "rollup-plugin-typescript2": "^0.34.1",
65
+ "rollup-plugin-web-worker-loader": "^1.6.1",
66
+ "tslib": "^2.5.0",
67
+ "typescript": "^4.9.5",
68
+ "wasm-feature-detect": "^1.5.0"
69
+ },
70
+ "engines": {
71
+ "node": ">=18"
72
+ }
73
+ }
package/rollup.config.js CHANGED
@@ -1,75 +1,75 @@
1
- 'use strict';
2
- const path = require('path');
3
- const { nodeResolve } = require('@rollup/plugin-node-resolve');
4
- const commonjs = require('@rollup/plugin-commonjs');
5
- const typescript = require('rollup-plugin-typescript2');
6
- const workerLoader = require('rollup-plugin-web-worker-loader');
7
- const pkg = require('./package.json');
8
- const { babel } = require('@rollup/plugin-babel');
9
- const terser = require('@rollup/plugin-terser');
10
- const { DEFAULT_EXTENSIONS } = require('@babel/core');
11
- const { base64 } = require('@picovoice/web-utils/plugins');
12
-
13
- const extensions = [...DEFAULT_EXTENSIONS, '.ts'];
14
-
15
- console.log(process.env.TARGET);
16
- console.log(extensions);
17
-
18
- function capitalizeFirstLetter(string) {
19
- return string.charAt(0).toUpperCase() + string.slice(1);
20
- }
21
-
22
- const iifeBundleName = pkg.name
23
- .split('@picovoice/')[1]
24
- .split('-')
25
- .map(word => capitalizeFirstLetter(word))
26
- .join('');
27
- console.log(iifeBundleName);
28
-
29
- export default {
30
- input: [path.resolve(__dirname, pkg.entry)],
31
- output: [
32
- {
33
- file: path.resolve(__dirname, pkg.module),
34
- format: 'esm',
35
- sourcemap: false,
36
- },
37
- {
38
- file: path.resolve(__dirname, 'dist', 'esm', 'index.min.js'),
39
- format: 'esm',
40
- sourcemap: false,
41
- plugins: [terser()],
42
- },
43
- {
44
- file: path.resolve(__dirname, pkg.iife),
45
- format: 'iife',
46
- name: iifeBundleName,
47
- sourcemap: false,
48
- },
49
- {
50
- file: path.resolve(__dirname, 'dist', 'iife', 'index.min.js'),
51
- format: 'iife',
52
- name: iifeBundleName,
53
- sourcemap: false,
54
- plugins: [terser()],
55
- },
56
- ],
57
- plugins: [
58
- nodeResolve({ extensions }),
59
- commonjs(),
60
- workerLoader({ targetPlatform: 'browser', sourcemap: false }),
61
- typescript({
62
- typescript: require('typescript'),
63
- cacheRoot: path.resolve(__dirname, '.rts2_cache'),
64
- clean: true,
65
- }),
66
- babel({
67
- extensions: extensions,
68
- babelHelpers: 'runtime',
69
- exclude: '**/node_modules/**',
70
- }),
71
- base64({
72
- include: ['./src/lib/*.wasm', './src/lib/*.txt'],
73
- })
74
- ],
75
- };
1
+ 'use strict';
2
+ const path = require('path');
3
+ const { nodeResolve } = require('@rollup/plugin-node-resolve');
4
+ const commonjs = require('@rollup/plugin-commonjs');
5
+ const typescript = require('rollup-plugin-typescript2');
6
+ const workerLoader = require('rollup-plugin-web-worker-loader');
7
+ const pkg = require('./package.json');
8
+ const { babel } = require('@rollup/plugin-babel');
9
+ const terser = require('@rollup/plugin-terser');
10
+ const { DEFAULT_EXTENSIONS } = require('@babel/core');
11
+ const { base64 } = require('@picovoice/web-utils/plugins');
12
+
13
+ const extensions = [...DEFAULT_EXTENSIONS, '.ts'];
14
+
15
+ console.log(process.env.TARGET);
16
+ console.log(extensions);
17
+
18
+ function capitalizeFirstLetter(string) {
19
+ return string.charAt(0).toUpperCase() + string.slice(1);
20
+ }
21
+
22
+ const iifeBundleName = pkg.name
23
+ .split('@picovoice/')[1]
24
+ .split('-')
25
+ .map(word => capitalizeFirstLetter(word))
26
+ .join('');
27
+ console.log(iifeBundleName);
28
+
29
+ export default {
30
+ input: [path.resolve(__dirname, pkg.entry)],
31
+ output: [
32
+ {
33
+ file: path.resolve(__dirname, pkg.module),
34
+ format: 'esm',
35
+ sourcemap: false,
36
+ },
37
+ {
38
+ file: path.resolve(__dirname, 'dist', 'esm', 'index.min.js'),
39
+ format: 'esm',
40
+ sourcemap: false,
41
+ plugins: [terser()],
42
+ },
43
+ {
44
+ file: path.resolve(__dirname, pkg.iife),
45
+ format: 'iife',
46
+ name: iifeBundleName,
47
+ sourcemap: false,
48
+ },
49
+ {
50
+ file: path.resolve(__dirname, 'dist', 'iife', 'index.min.js'),
51
+ format: 'iife',
52
+ name: iifeBundleName,
53
+ sourcemap: false,
54
+ plugins: [terser()],
55
+ },
56
+ ],
57
+ plugins: [
58
+ nodeResolve({ extensions }),
59
+ commonjs(),
60
+ workerLoader({ targetPlatform: 'browser', sourcemap: false }),
61
+ typescript({
62
+ typescript: require('typescript'),
63
+ cacheRoot: path.resolve(__dirname, '.rts2_cache'),
64
+ clean: true,
65
+ }),
66
+ babel({
67
+ extensions: extensions,
68
+ babelHelpers: 'runtime',
69
+ exclude: '**/node_modules/**',
70
+ }),
71
+ base64({
72
+ include: ['./src/lib/*.wasm', './src/lib/*.txt'],
73
+ })
74
+ ],
75
+ };