Skip to content

Latest commit

 

History

History
93 lines (58 loc) · 2.02 KB

README.md

File metadata and controls

93 lines (58 loc) · 2.02 KB

--- DELETE START ---

Alpine JS Plugin Template

This is a template repository to help developers quickly build Alpine JS plugins.

How to Use

  1. Clone the repository with the "Use this template" button on GitHub
  2. Run npm install to install ES Build
  3. Build your plugin

Compiling

To compile the code you run npm run build which will create two files in the /dist directory.

Testing

In this template you will find a index.html file that you can use for testing how the Alpine JS plugin works.

I recommend using vercel/serve to serve this file.

Things to Change

  • Find and replace "PLUGIN" with the name of your plugin
  • Find and replace "FILE" with the name of your compiled file
  • Find and replace "DESCRIPTION" with a description of your plugin
  • Uncomment "index.html" in the .gitignore file

🚨 Make sure find and replace is case sensitive

If you were creating a plugin called "Alpine JS CSV" you could do the following:

  • "PLUGIN" to "alpinejs-csv"
  • "FILE" to "csv"
  • "DESCRIPTION" to "Transform data into a CSV with Alpine JS 📈"

License

The choice of adding a license and what license is best for your project is up to you.

Adding a License on GitHub

--- DELETE END ---

PLUGIN

DESCRIPTION

Install

With a CDN

<script defer src="https://unpkg.com/PLUGIN@latest/dist/FILE.min.js"></script>

<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>

With a Package Manager

yarn add -D PLUGIN

npm install -D PLUGIN
import Alpine from 'alpinejs'
import FILE from 'PLUGIN'

Alpine.plugin(FILE)

Alpine.start()

Example

Examples of how the plugin works.

Stats