You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.
I have a libraryproject (lets call it ProjectA) depending on another project (lets call it ProjectB), but I do not want to have ProjectB bundled inside the package so I added it as a peerDependency.
When I only add it as a peerDependency a build fails because it cannot find ProjectB (which is used inside the package).
But when I add it as a devDependency it will build everything and also bundle the whole(!) ProjectB in the build. What I would expect is that sagui only bundles the dependencies imported which are not peer- & devdependencies.
When I install ProjectB per hand and only mention it as a peerDependency (so removing it from dev- & dependencies) it will still get bundled.
Expected behaviour would be that sagui bundles only dependencies from the dependencies-field and ignores/excludes dependencies from the peerDependencies-field (even though they may be found in the node_modules.
Also as stated before treeshaking does not seem to work.
The text was updated successfully, but these errors were encountered:
Further Investigation revealed that the problem is not a general bug but a little more tricky.
We imported stuff from ProjectB like so: import {thing} from 'ProjectB/'
The / is required for PHPStorm (and most likely also WebStorm) to find the Package when clicked on (if ProjectB is scoped).
But now the import does not match what is inside peerDependencies: 'ProjectB/' != 'ProjectB'
So the question is should sagui also externalize${peerDependency}/?
Kadrei
changed the title
Sagui bundles Dependencies in node_modules even though they are peerDependencies
Sagui bundles peerDependency when Importname is not equal peerDependencyname
Oct 5, 2017
I have a libraryproject (lets call it ProjectA) depending on another project (lets call it ProjectB), but I do not want to have ProjectB bundled inside the package so I added it as a
peerDependency
.When I only add it as a
peerDependency
a build fails because it cannot find ProjectB (which is used inside the package).But when I add it as a
devDependency
it will build everything and also bundle the whole(!) ProjectB in the build. What I would expect is that sagui only bundles the dependencies imported which are notpeer-
&devdependencies
.When I install ProjectB per hand and only mention it as a
peerDependency
(so removing it fromdev-
&dependencies
) it will still get bundled.Expected behaviour would be that sagui bundles only dependencies from the
dependencies
-field and ignores/excludes dependencies from thepeerDependencies
-field (even though they may be found in thenode_modules
.Also as stated before treeshaking does not seem to work.
The text was updated successfully, but these errors were encountered: