How to import a single PixiJS filter from pixi-filters

Viewed 104

I'm trying to import a single pixi js filter to my project and minimize all bloat.

Currently my project directory has only three files:

  1. index.html
  2. app.js
  3. pixi.js

index.html is the main page of the application. app.js is a module where I import pixi.js and use it:

import * as PIXI from './pixi.js';

I'm trying to import a single additional filter (outline) from pixi-filters. I've installed '@pixi/filter-outline' using npm but have no clue on how to use it properly. On installation I'm provided with the following files:

node_modules
\---@pixi
    \---filter-outline
        |   index.d.ts
        |   LICENSE
        |   package.json
        |   README.md
        |   
        \---dist
                filter-outline.cjs.js
                filter-outline.cjs.js.map
                filter-outline.esm.js
                filter-outline.esm.js.map
                filter-outline.js
                filter-outline.js.map

My questions:

  • What files and how do I need to import to use outline filter?
  • Are all these files really necessary or can I just copy the important ones to my project folder and delete the rest?
  • Are there other things (outside pixi.js and the filter itself) I need to install to make pixi-filters work?
0 Answers
Related