0.0.1 • Published 3 years ago
lunchboxjs-plugins v0.0.1
LunchboxJS Official Plugins
To use:
npm i lunchboxjs-pluginsThen, 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-plugininsrc. - Add a
your-plugin.tsfile in that folder. - Export a new
Plugin(ie, an instance ofimport type { Plugin } from 'vue') that runs the needed setup in theinstallfunction. - 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_POINTSarray invite.config.ts.
Your plugin should now build and export correctly, both as a standalone plugin and part of the full plugins export.
0.0.1
3 years ago