-
Notifications
You must be signed in to change notification settings - Fork 57
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
Import in Angular 9 #57
Comments
as said in README,
if it doesnt work for you - im sorry, i cant support angular 9 because i am not writing on angular 9 stuff. There were manuy issues with that in pixi plugins, we are working on new super-system for all plugins that will solve it. |
Thanks for the quick response, I tried that as well, doesn't work. Any ETA for the new "super-system"? Any recommendation how I could merge the two js myself to use as one combined js? |
ETA - Previous year :) |
Thanks, I know that feeling, we wanted to launch with pixi magic two years ago! :) But seriously, any realistic chance of having this new framework available soon? Just trying to get an idea so we can plan things accordingly. Thanks a ton! |
add PIXI into script to load directly in angular.json, in build options:
Then no need to |
The only way we were able to run pixi, pixi-layers and Angular was by using a custom webpack configuration to provide PIXI globally. This way webpack can also bundle up all dependencies, which would not be possible when importing the minifed script directly as stated by @lycwed. // custom-webpack-config.js
const webpack = require("webpack");
module.exports = {
plugins: [
new webpack.ProvidePlugin({
PIXI: "pixi.js",
}),
],
}; Adapt your angular.json accordingly: "architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"customWebpackConfig": {
"path": "./custom-webpack.config.js"
},
...
},
},
"serve": {
"builder": "@angular-builders/custom-webpack:dev-server",
...
}
} This requires two new dependencies: You can read more about custom webpack configurations in Angular here: https://www.digitalocean.com/community/tutorials/angular-custom-webpack-config |
Trying to get pixi-layers plugin to work with angular & webpack, but no success for now. @ChristophWalter also tried the approach with custom webpack config, but got following error Code:
Maybe something wrong with the imports? |
I don't use this package anymore, but here's how I did it :
If you use PIXI layer to use zOrder, you better use pixijs v5 and zIndex, it's what I use now ;) |
Going to try it out. The problem with PIXI zIndex is that the index only sorts all childs within a parent. In my application i need to sort through several parents. As far as i know this is not possible with PIXI zIndex. |
|
import * as PIXI from 'pixi.js';
import 'pixi-layers';
doesn't work, tried a lot of other variations also but to no avail.
Please advise how we can import it with Angular 9, thanks!
The text was updated successfully, but these errors were encountered: