:) If at some point this starts to feel excessively limiting, you could either look into setting up a custom build system for your Electron app (i.e., via Rollup or Parcel or Webpack, etc. Honestly, if the Electron part of your app is pretty lightweight, I wouldn't even worry about it - if it ain't broke, don't fix it. It's hard to know for sure without doing a deep-dive on your repo, but it sounds like you're not using a bundler for your Electron project. Maybe I have to turn my main.ts into a module somehow? You can use electron-builder only to pack your electron app in a AppImage, Snaps, Debian package, NSIS, macOS installer component package ( pkg ) and other. My Preload.js contains the following, which I want to call from my Angular component:ĬontextBridge.exposeInMainWorld("electronAPI", from "./src/app/electron.api" Cannot use import statement outside a module. How am I meant to access my electronAPI in my Angular? I do not have a renderer.js file as I'm using Angular. With this sample, you can : Run your app in a local development environment with Electron & Hot reload. This exposes users of this app to unnecessary security risks. Bootstrap and package your project with Angular 6 (+) and Electron (Typescript + SASS + Hot Reload) for creating Desktop applications. I still get this Security Warning : This renderer process has either no Content Security Policy set or a policy with "unsafe-eval" enabled. For this, I have the loadLocalFile function that I expose in order to avoid setting nodeIntegration to true. I'm looking to load a locally saved video file via electron and play it in my angular component. Posts that consist solely of a link to a tweet are automatically removed. Using the node/electron api is quite easy, simply import the package you want to use, the electron-angular-toolkit provides a webpack-config which prevents. unless the subject is of general interest.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |