You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[feature request] manual select between browser and nodejs mode when create new RiveScripr object to allow any front end library like angular which use npm to import module would work nicely.
E.g. const rivescript = new RiveScript({mode:”browser”});
The text was updated successfully, but these errors were encountered:
What does your workflow look like when you use RiveScript with Angular?
Webpack is commonly used for bundling a JavaScript app for web browsers (creating a single bundled.min.js script to include in your HTML), and before that, Browserify was one people used. RiveScript-js used those to produce the dist/rivescript.js bundle for easy web browser embedding, and both of these tools would set the process.browser variable for run-time detection in the script.
The raw Node.js sources for RiveScript aren't suitable for a browser (no require() keyword supported), so your workflow must be doing something to bundle them? If so there might be a way to auto-detect it that RiveScript could use instead.
I do like the idea of a constructor option fallback just in case, but curious to hear what you're doing with Angular and RiveScript.
Auto-detect is a nice feature but in some cases for some frontend projects that do not use Webpack nor Browserify for bundling and run their npm packages would have troubles to run. I use TypeScript which is the default standard language for both Angular and React but it does not use Webpack nor Browserify, so it would be very nice to have a fallback option.
[feature request] manual select between browser and nodejs mode when create new RiveScripr object to allow any front end library like angular which use npm to import module would work nicely.
E.g. const rivescript = new RiveScript({mode:”browser”});
The text was updated successfully, but these errors were encountered: