-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double inclusion of multiple builds in a package #206
Comments
@rmja can you try again with the latest version 5.0.4? Just making sure the issue doesn't get more complicated after that fix. |
@bigopon I have upgraded to 5.0.4 and can confirm that it does not fix the issue:
As can be seen it seems that both builds are still included in the bundle. |
Ping. This issue is still present in version 5.0.5. |
It seems using
Will investigate further. Thanks for the repo @rmja |
My current analysis is this line
If you add these lines to the config, you'll see quite clear what's being imported in stats: {
reasons: true,
modules: true,
}, |
@alexander-akait thanks for your help with the other issue. Can I also please have some help on this one? import { Ability, PureAbility } from "@casl/ability";
import { Aurelia, PLATFORM } from "aurelia-framework";
export async function configure(aurelia: Aurelia) {
aurelia.use.plugin(PLATFORM.moduleName("@casl/aurelia"));
aurelia.use.instance(PureAbility, new AppAbility());
}
class AppAbility extends Ability {} You can see that the following 2 lines import { Ability, PureAbility } from "@casl/ability";
...
aurelia.use.plugin(PLATFORM.moduleName("@casl/aurelia")); are pulling different files in:
There' 2 different module formats being used:
Is there a way to tell webpack to resolve |
I'm submitting a bug report
5.0.3
Please tell us about your environment:
Operating System:
Windows 11
Node Version:
16.14.2
NPM Version:
8.7.0
JSPM OR Webpack AND Version
webpack 5.72.0
Browser:
none
Language:
TypeScript 4.6.4
Current behavior:
I have created a reproducing example here with a description of the problem.
In essence, it seems as if two different builds of a dependency package is included depending on whether e.g.
or
is used. That is probably ok, but if both are used, then only one of the two should be actually included. Currently both are included which causes strange bugs, for example when registering an instance in DI with the key
PureAbility
. The instance is registered with keyPureAbility
from one build, but is resolved with a different version ofPureAbility
from another build.Expected/desired behavior:
Only one build should be resolved for any package dependency.
A workaround currently is to use
NormalModuleReplacementPlugin
like this in the webpack config to force one particular build:The text was updated successfully, but these errors were encountered: