Closed finscn closed 3 years ago
this are some information about this .
but I know nothing about rollup , So I don't know how to modify it .
package.json already has an entry for module, so Rollup should automatically pull in an ES6 version of the library. You'll need to look into why you are pulling in the dist/pixi-particles.js
version instead. The first thing you should check is to make sure that you are importing the pixi-particles
library from node_modules, rather than dist/pixi-particles.js
directly.
I forked pixi-particles
, and I want to use my forked pixi-particles in ES5 with "use strict" .
And whatever , the this.PIXI
is a bad code.
I've used
pixi-filters
pixi-projection
pixi-tilemap
in my project .
When I include them , I don't meet any problem.
But pixi-particles
puzzles me.
Could you do something to pixi-particles like pixi-filters , pixi-projection, pixi-tilemap ?
The main
, bundle
, and module
values in package.json are actually what Pixi.js v5 uses, so I am trusting them that it is the right thing.
When I use "use strict" , and mix my js file and pixi.js into one file (named all-in-one.js),
the this.PIXI
can't run , the error is this is undefined
.
You need to change your Rollup configuration to pull in the module export instead of dist/pixi-particles.js
. This may involve just removing existing configuration that specifies that path, if you have it present.
the struct of pixi-particles dist file is like this :
In es6 & es5 with
strict mode
, thethis
is undefined .So I think you should refactor the build scripts of pixi-particles.