Reworked as npm workspaces #1014
cawa-93
announced in
BREACKING CNANGES
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Project was restructured. Now all package IS actually independent packages. Each may contain it's own dependencies, building pipeline, linters, tests etc.
Each package is accessed through its name:
Note
Importing
preload
intorenderer
will quietly throw all the data through theelectron.contextBridge.exposeInMainWorld()
, so you don't need to worry about it.This also opens up the possibility to put any logic in separate packages and share them across all app.
After this changes structure of compiled app changed. Now all packages copied into
node_modules
and importer from it.But this lead to a few pitfalls.
By default, electron-builder copies each package into the output compilation entirety,
including the source code, tests, configuration, assets, and any other files.
So you may get compiled app structure like this:
That's why I introduced a new requirement:
Important
Each sub-package MUST define
files
property in it'spackage.json
where explicitly describe what should be included into final app.So if
package-a
in itspackage.json
describesThen in the compilation only those files and
package.json
will be included:Beta Was this translation helpful? Give feedback.
All reactions