I am a newcomer to utilizing pixi.js for the first time. I went ahead and installed it using npm install pixi.js --save-dev
. However, despite adding the dependency to my package.json file, I encountered difficulties when attempting to import it. Surprisingly, pixi.js was nowhere to be found in the node_modules directory. I even tried uninstalling and reinstalling the package multiple times, but to no avail.
A noteworthy point is that I experimented with importing the DefinitelyTyped version of pixi.js, which I also obtained through npm. Unfortunately, this version lacked some essential definitions needed for pixi.js, prompting me to require the original source of pixi.js for my TypeScript project. Is it feasible to employ .js libraries in TypeScript? (It should be possible, considering TypeScript's compatibility with JavaScript code.)
I attempted importing pixi as follows:
import * as PIXI from 'pixi.js';
import PIXI from 'pixi.js';
var PIXI = require('pixi');
var PIXI = require('pixi.js');
I am striving to access pixi.js from app.ts located in a directory named 'ts-src' outside of node_modules. Could this setup possibly be causing the issue? (I doubt it, but it's worth mentioning.)