Skip to content

Commit

Permalink
chore: added chore(build): create bundler-free ESM distribution and a…
Browse files Browse the repository at this point in the history
…dd browser entry poin
  • Loading branch information
samuelOsborne committed Feb 10, 2025
1 parent 7bb4114 commit be56c22
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.js",
"browser": "dist/browser/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
Expand Down
16 changes: 14 additions & 2 deletions packages/react/tsup.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { defineConfig } = require('tsup');

module.exports = defineConfig({
const config = {
bundle: true,
metafile: false,
splitting: false,
Expand All @@ -15,4 +15,16 @@ module.exports = defineConfig({
target: ['es2020'],
tsconfig: 'tsconfig.build.json',
external: ['react'],
});
};

module.exports = defineConfig([
config,
// CDN build: Self-contained
{
...config,
dts: false,
format: ['esm'],
noExternal: Object.keys(require('./package.json').dependencies),
outDir: 'dist/browser',
},
]);
6 changes: 6 additions & 0 deletions packages/web/src/dotlottie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ export class DotLottie {
newValue: new_value,
});
},
state_machine_observer_on_trigger_fired: (_dotlottie_instance_id: number, trigger_name: string) => {
this._eventManager.dispatch({
type: 'stateMachineTriggerFired',
triggerName: trigger_name,
});
},
state_machine_observer_on_string_trigger_value_change: (
_dotlottie_instance_id: number,
trigger_name: string,
Expand Down

0 comments on commit be56c22

Please sign in to comment.