Skip to content

My past Questions and Answers. #1

@duurland

Description

@duurland

Here are a few questions I've seen multiple times or asked for myself in discord, along with how I solved it. Not sure if they fit in here or not. As I suck at wording I'm just gonna leave them here in case someone wants to make a proper Q&A out of them. 😃


Is it possible to provide my own express instance / webpack-dev-server for my quasar.config.js, rather than quasar creating one for me?

I wanted to bundle my server and client repo, and let the server serve the client code too. Specially in development mode, same origin and all that.

I ended up using http-proxy-middleware. I proxied all /frontend/** requests to the webpack server, and kept handling everything else on my existing instance.


Tips on debugging app-extensions, specifically the server / build steps, which isn't hot reloaded.

I also wanted to debug the main process (my app extension index file) as I was making changes to the quasar/webpack config, which isn't being watched? What I ended up doing was setting a flag to exit the node process once my extension runner was done, skipping the whole front-end build and just quit early (process.exit()). Something like nodemon could be added to the mix for hot-reloading / re-start.


[Electron] Is it possible having a nodejs server inside a quasar application?

You can init server-side packages (expressjs, feathersjs, etc) in /src-electron/main-process when using electron, just be careful and make sure to protect it!


[Electron] Is it possible to hot-reload the main-process / server?

This is how I solved my hot reloading problem. I avoid importing my server (feathersjs) with require or import as quasar will then watch the file and shut down electron if any changes are detected. Instead I watch the file myself with chokidar, I import the module with __non_webpack_require__, upon changes I walk through the cache and delete the stuff related to my module (__non_webpack_require__.cache) and then re-require it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions