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)
- V8 Bug! HOT 2
- Bug: Pixi 7 errors: Argument of type '...' is not assignable to parameter of type 'DisplayObject' HOT 9
- Bug: Remove filter again (container.filters = null) throws error
- Bug: getLocalBounds doesn't return correct values after removing a child HOT 1
- Bug: Pixi 8 - WebGL: INVALID_ENUM: activeTexture: texture unit out of range
- Bug: GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is incomplete: Attachment has zero size HOT 1
- Feature request: Drag events HOT 1
- Bug: Can't `await` `Application.init` from top level if bundled using vite HOT 2
- Feature Request: Is it possible to split a texture after exceeding the maximum texture size? HOT 1
- Bug: V8 graphics tint applied in a weird way HOT 3
- Bug: V8 MSDF text rendering quality HOT 1
- Bug: npm run build: error TS2503: Cannot find namespace 'PixiMixins'
- Bug: Error: Unable to auto-detect a suitable renderer. HOT 1
- Bug: too many active WebGL contexts on this page Safari HOT 1
- Bug: use round cap,blendmode not work
- Perfromance: CPU100% in OpenGL mode on a big map when computer does not have GPU even the graph is static HOT 2
- Bug: Error occurs when uninstalling a bitmap font with characters containing a space
- Bug: When Application is proxied by Vue 3(ref), an error occurs when rendering graphics HOT 2
- Bug: about PIXI.Assets:imageResource can not loaded as canvasSource in ios v14.5,perhaps some old ios version
- Feature-Request: V8 support sub-Textures when creating BitmapFont objects HOT 4
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.