mirror of
https://github.com/VueTubeApp/VueTube
synced 2024-10-31 17:02:38 +00:00
refactor: ✨ Add TPPL
TPPL is how vuetube now manages third party plugins (Third Party Plugin Loader)
This commit is contained in:
parent
697ce5f997
commit
7d9d1bc96a
4 changed files with 29 additions and 2 deletions
|
@ -15,6 +15,7 @@ export default {
|
|||
{ src: "~/plugins/youtube", mode: "client" },
|
||||
{ src: "~/plugins/vuetube", mode: "client" },
|
||||
{ src: "~/plugins/ryd", mode: "client" },
|
||||
{ src: "~/plugins/thirdPartyPluginLoader", mode: "client" },
|
||||
],
|
||||
generate: {
|
||||
dir: "../dist",
|
||||
|
|
|
@ -52,8 +52,7 @@ export default {
|
|||
};
|
||||
},
|
||||
async mounted() {
|
||||
const temp = require("~/plugins/demoPlugin.js");
|
||||
this.plugins = [temp];
|
||||
this.plugins = await this.$tppl.list;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
module.exports = {
|
||||
manifest: {
|
||||
name: "Test plugin",
|
||||
vuetube: "*",
|
||||
version: "1.0",
|
||||
author: "Frontesque",
|
||||
description: "A plugin to test how vuetube handles plugins // Add 'Hello, World!' to the home page.",
|
26
NUXT/plugins/thirdPartyPluginLoader.js
Normal file
26
NUXT/plugins/thirdPartyPluginLoader.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
//--- Modules/Imports ---//
|
||||
|
||||
const module = {
|
||||
|
||||
|
||||
//--- Get Plugins ---//
|
||||
list: new Promise((resolve, reject) => {
|
||||
let plugins = new Array();
|
||||
|
||||
// Temp Plugin List
|
||||
plugins.push(require("~/plugins/tempPlugins/demoPlugin"))
|
||||
// End Temp Plugin List
|
||||
|
||||
resolve(plugins);
|
||||
|
||||
})
|
||||
//--- End Get Plugins ---//
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
//--- Start ---//
|
||||
export default ({ app }, inject) => {
|
||||
inject("tppl", module);
|
||||
};
|
Loading…
Reference in a new issue