Skip to content

How to Build this Plugin From Source

Sal Ferrarello edited this page Apr 29, 2022 · 2 revisions

Here in GitHub we have the source files. This plugin will not work unless you "build" the source files.

How to Build the Files

  1. You should be running version 12 of node. This value is defined in .nvmrc so if you are using nvm, running nvm use will switch you to the correct version of node.
  2. Run npm install to pull in all the packages needed to build the source files
  3. Run npm run build to create the built file

Where do the built files live?

The built files are added to the /build directory. Specifically, after building the plugin you will see:

  • /build/index.asset.php
  • /build/index.js

If these files do not appear in your plugin, it will not work.

Development Mode

During development it can be maddening to run npm run build every time you make a change. Running npm run dev instead will allow the process to keep running and listen for changes. Every time your JavaScript changes, the built files will automatically be updated (note: you still need to refresh the browser page for these changes to take effect).

Clone this wiki locally