Comments (4)
I would probably try to look for a Rollup plugin that could statically inline dynamic imports. We are now using dynamic imports which helps tree-shaking and up-front filesize costs for some bundlers. Since we added another big renderer in v8, it's just not practical to load everything at once.
Quick search found this issue:
rollup/rollup#3490
from pixijs.
Thanks for the issue reference @bigtimebuddy, I checked it and ESM on CanIUse:
The ESM is already supported by ~96% of browsers, and the version range is great.
Changing the build to use esm
directly looks to be the right approach.
I still have other things broken after migrate to v8 that is mentioned on the following issue: #10299
So, when I run the project, on the browser I get the following error:
Uncaught TypeError: Failed to resolve module specifier "@pixi/core". Relative references must start with either "/", "./", or "../".
The browser was not able to load the Pixi core, and those are the built files:
I'll wait for the other issue and keep doing some tests to see how to fix it.
from pixijs.
hey guys, question about v8 and the ESM build, the following code is being included on the top of the build files:
import { SCALE_MODES, extensions as extensions$1, ExtensionType as ExtensionType$1, ObjectRenderer, Buffer as Buffer$1, utils, Shader, Program, Matrix as Matrix$1, Geometry as Geometry$1, Texture as Texture$1, groupD8 as groupD8$1, DRAW_MODES } from '@pixi/core';
import { Container as Container$1, Bounds as Bounds$1 } from '@pixi/display';
I don't have @pixi/display
and @pixi/core
as dependencies or dev dependencies on my project because I didn't need it on v7, but now it is being included on the build file and when the browser try to load it, I get the following error Uncaught TypeError: Failed to resolve module specifier "@pixi/core". Relative references must start with either "/", "./", or "../".
because it is not being included on build file.
if I define it to load from CDN it works and the error goes away:
paths: {
'@pixi/core': 'https://cdn.skypack.dev/@pixi/core',
'@pixi/display': 'https://cdn.skypack.dev/@pixi/display',
},
is this an expected behavior/approach? I would like to not need this map with the CDN to fill all the needs of Pixi on my build...
can someone please give me some guidance about it? thanks!
from pixijs.
the issue is that @pixi/tilemap
and other plugins are still on v7, so they need to be upgraded, after that, the build will work as expected.
Closing as there's nothing to be done here by Pixi team.
from pixijs.
Related Issues (20)
- Is there a way to simulate 3d projection/rotation in Pixi v8
- Bug: [v8.0.2] Sprite not updated correctly when its texture's frame is changed HOT 2
- Bug: [v8 regression] `Container.destroy()` is very slow on crowded containers HOT 5
- Bug: Publishing v7.x doesn't update latest dist-tags
- Bug: [v8 regression] moving a crowded `Container` drastically cuts performance HOT 8
- Bug: [v8] When adding `onRender` to a class extension, it does not work as expected
- Feature Request: [v8] Is there any way to pass a canvas instance to the new WebGLRenderer? HOT 2
- Bug: export image empty on firefox
- Bug: v8 Using webcam stream as source errors in Chrome HOT 3
- Bug: [v8] passing `fill(0)` or `fill(0x000000)` to graphics shows white instead of black
- [v8] Cannot read property 'addRenderable' of undefined HOT 4
- Bug: [v8] The filter is not taking the RenderTexture's frame's offset into account when being applied HOT 1
- Bug: Fill hex for black produces unpredictable results HOT 1
- Bug: Could not render app.canvas to normal canvas correctly in Windows chrome HOT 1
- Bug: roundPixels=true causing precision issues HOT 2
- [V8] Error with `new Sprite(null)` HOT 2
- Bug: v8.x Sprites not rendering in Chrome/Edge Windows 11 HOT 5
- Bug: [V8] Container.removeChildren performance issue HOT 2
- Bug: `loadTextures` ignores provided format HOT 4
- Feature Request: Put again sync methods in ExtractSystem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixijs.