Open framerate opened 8 years ago
The short answer is Yes. When it encounters another package.json
when walk through the folder structure, it will consider that is another project and stop on that.
Do you know why Electron recommends to place package.json
inside app folder?
Yeah, actually. I've been struggling to get a nice solid electron foundation setup the last few days that builds multi-platform.
They have a nice write up here on why they recommend the two package system.
Personally, after setting it up I kind of like having electron stuff separate from my app itself (so the app could be built for web etc) but I don't really want the two pjson's since webpack builds all my dependencies anyways.
@lijunle Could you point me a direction of where the package.json skipping happens? Maybe I can add a flag or something that will ignore that file.
It is using the depcheck project to check the usage of dependencies. The code logic is here: https://github.com/depcheck/depcheck/blob/master/src/check.js#L155
@framerate one idea that I took from a project someplace and added here is to use the root package.json to contain all the dependencies, but as part of the build step, copy it into app
and rewrite it. This solves the issue with npm-check and also with eslint-plugin-import.
electron-userland/electron-builder recommends a two package.json format, with your compile tools in
/package.json
and your project/electron specific deps inapp/package.json
Running
npm-check
in/
just reports everything missing, since they're imported from/app/src/js/
etc.I'm imagining it sees package.json inside
/app
and stops parsing that folder? Is that intentional?