Shows off how to bundle external dependancies for use in LWC service components. Specifically using @davidkpiano's XState library.
js/stateMachine.js- Unbundled JavaScript file.force-app/main/default/lwc/stateMachine/stateMachine.js- Bundled JavaScript file.force-app/main/default/lwc/testScreens- Example LWC component to show off use of state machine service component.rollup.config.js- Rollup.js configuration file.
npm run buildto run Rollup. Automatically bundles external dependencies. Builds all files in thejsdirectory. The filename maps to the LWC name so make sure to keep spelling the same.npm run build:rollup:watchto execute the same as above but watch for file changes.