caoxiemeihao / nuxt-electron

Integrate Nuxt and Electron
MIT License
191 stars 21 forks source link

Whole repository ends up in resources/app folder #85

Open JulienChampagnol opened 4 months ago

JulienChampagnol commented 4 months ago

The whole repository ends up in the resources/app folder after npm run package

Here is a reproduction link: https://github.com/Geode-solutions/TestNuxtElectron

Maybe related to https://github.com/electron/forge/issues/3334

BotellaA commented 3 months ago

@caoxiemeihao any idea of the origin of the issue?

@kingyue737 you seem to understand this repo, maybe you have an idea?

kingyue737 commented 3 months ago

Seems not related to nuxt-electron, it may be an issue of electron/forge. Sorry I use electron-builder instead so I can't give any advice currently.

BotellaA commented 3 months ago

Thanks for the feedback. So you have no issue with electron builder? Is there any recommendations for choosing builder or forge?

twilson90 commented 1 month ago

I just encountered this and was mystified. I used a debugger to step by step figure out exactly why it was targeting a parent folder. Here's the relevant bit:

      if (packageJSON.config && packageJSON.config.forge) {
        d('electron-forge compatible package.json found in', testPath);
        return mDir;
      }

      if (packageJSON.devDependencies?.['@electron-forge/cli'] || packageJSON.devDependencies?.['@electron-forge/core']) {
        d('package.json with forge dependency found in', testPath);
        return mDir;
      }

The directory is determined by the package.json that matches these criteria. Once I figured that out I was good. I don't know why it doesn't just look for the forge.config.* file and go from there though. That would make a lot more sense.