Need help installing plugin

I’m trying to install this plugin to my project.
I built it using npm install then npm run build, and got the js file.
I put it inside lib folder inside my project with the following hierarchy:

index.html
game.js
lib/phaser.min.js
lib/ninepatch.min.js

Then I have included it in my index.html file like this:

<script src="lib/phaser.min.js" type="text/javascript"></script>
<script src="lib/ninepatch.min.js" type="text/javascript"></script>
<script src="game.js" type="text/javascript"></script>

Then in the preload() function I loaded the plugin like this:

this.load.plugin('ninepatchplugin', "lib/ninepatch.min.js", true);

However, I get a warning: Invalid Plugin: ninepatchplugin and the plugin didn’t get loaded.
Is this something wrong with the plugin itself? Or a bug? Or did I do anything wrong?

The second parameter - string lib/ninepatch.min.js" is the url of plugin file. It seems that engine can’t download plugin file from url lib/ninepatch.min.js".

Hey, thanks for the quick reply!
Can it not download from a local file?
Any solutions for this then?

I have another nine-patch plugin, here is a live demo, and document

1 Like

Oh wow, I should’ve looked there first before asking here.
Anyway, thanks for the plugin!