Skip to content

Commit f8fe036

Browse files
committed
feat: tsup config updated and cues added in examples
1 parent 55633f5 commit f8fe036

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

examples/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom/client';
3-
import { InteractiveVideo } from '../dist/index';
3+
import { InteractiveVideo } from '@interactive-video-labs/react';
44

55
const App = () => {
66
return (
@@ -13,6 +13,17 @@ const App = () => {
1313
onAnalyticsEvent={(event, payload) => {
1414
console.log('Analytics Event:', event, payload);
1515
}}
16+
cues={[
17+
{
18+
id: 'cue1',
19+
time: 2,
20+
payload: {
21+
type: 'quiz',
22+
question: 'What is the capital of France?',
23+
answers: ['Paris', 'London', 'Berlin', 'Madrid'],
24+
},
25+
},
26+
]}
1627
/>
1728
</div>
1829
</div>

tsup.config.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
import { defineConfig } from 'tsup';
22
import pkg from './package.json';
33

4-
export default defineConfig({
4+
export default defineConfig((options) => ({
55
entry: ['src/index.tsx'],
66
format: ['esm', 'cjs'],
7+
outExtension({ format }) {
8+
return {
9+
js: `.${format === 'esm' ? 'mjs' : 'cjs'}`,
10+
};
11+
},
712
dts: true,
13+
watch: options.watch,
814
clean: true,
915
banner: {
1016
js: `/**
1117
* ${pkg.name} v${pkg.version}
1218
* Author: ${pkg.author}
19+
* @license MIT
1320
*/
14-
`,
21+
`,
1522
},
16-
});
23+
}));

0 commit comments

Comments
 (0)