The source separation by require/import breaks non-esm dependencies
See original GitHub issuePixi’s package.json now separates output sources depending on whether import
or require
was used to import it. This causes issues in webpack with dependencies that were transpiled to umd, as umd will use require
statements. If the primary project uses import
, then the primary project will load the esm dist, and the dependency will load the cjs dist, causing two different pixi runtimes to be imported and breaking the dependency.
Expected Behavior
Only the /cjs/ or /esm/ sources should be imported into the project.
Current Behavior
Both /cjs/ and /esm/ sources will be imported into the project.
Steps to Reproduce
Create a barebones Webpack 5 project. import both pixi.js and pixi3d. /cjs/ and /esm/ modules are now both loaded into the project.
Environment
- pixi.js version 6.4.2
Issue Analytics
- State:
- Created a year ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
improving source separation by explicitly modeling ...
Specifically, we propose to model the dependencies between different sources within a mix- ture by autoregressively factorizing the conditional probability dis-.
Read more >Dependency resolution - Parcel
As Parcel builds your source code, it discovers dependencies, which allow code to be broken into separate files and reused in multiple places....
Read more >Improving Source Separation by Explicitly ... - Papers With Code
We propose a new method for training a supervised source separation system that aims to learn the interdependent relationships between all ...
Read more >Blind separation of sources that have spatiotemporal variance ...
dependencies, which is in stark contrast to most previous methods. Key words: independent component analysis, blind source separation, dependent.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I did try aliasing it and that allowed my barebones repo to function, though that was only if modules use
pixi.js
. I’d imagine that if you’re importing dependencies, you would have to alias every single subpackage. I ran into some other issues with this method in my larger package but haven’t tracked them down yet. I’m not 100% certainalias
is the best way to go as you need to manually alias any possible variation of the imports, but also haven’t yet found the proper way to force either esm or cjs for a dependency. Still digging.@lunarraid If Pixi3D would output ESM as well, would that help?