lunchboxjs-plugins
v0.0.1
Published
To use:
Downloads
1
Readme
LunchboxJS Official Plugins
To use:
npm i lunchboxjs-plugins
Then, when you're mounting your Lunchbox app:
import { createApp } from 'lunchboxjs'
// example: import a single plugin
import { orbit } from 'lunchboxjs-plugins'
// import all plugins
import * as Plugins from 'lunchboxjs-plugins'
import MyLunchboxApp from 'App.vue'
createApp(MyLunchboxApp
// example: use <orbit/> wrapper
.use(orbit)
// use the <gltf/> wrapper (from wildcard import):
.use(Plugins.gltf)
.mount('#app')
Creating new plugins
To create a new plugin:
- Create a folder called
your-plugin
insrc
. - Add a
your-plugin.ts
file in that folder. - Export a new
Plugin
(ie, an instance ofimport type { Plugin } from 'vue'
) that runs the needed setup in theinstall
function. - Export this new plugin from
src/plugins.ts
(ie,export { yourPlugin } from 'your-plugin/your-plugin.ts
). - Add the new plugin in the
PLUGIN_ENTRY_POINTS
array invite.config.ts
.
Your plugin should now build and export correctly, both as a standalone plugin and part of the full plugins export.