--- DELETE START ---
This is a template repository to help developers quickly build Alpine JS plugins.
- Clone the repository with the "Use this template" button on GitHub
- Run
npm install
to install ES Build - Build your plugin
To compile the code you run npm run build
which will create two files in the
/dist
directory.
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.
- 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 ๐"
The choice of adding a license and what license is best for your project is up to you.
--- DELETE END ---
DESCRIPTION
<script defer src="https://unpkg.com/PLUGIN@latest/dist/FILE.min.js"></script>
<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
yarn add -D PLUGIN
npm install -D PLUGIN
import Alpine from 'alpinejs'
import FILE from 'PLUGIN'
Alpine.plugin(FILE)
Alpine.start()
Examples of how the plugin works.