You can install vue-extensions manually too, if you want (instead of invoking vue add extensions
):
npm install vue-extensions
and add the following code:
Create a file, e.g. named extensions.js
, which exports all of your extensions as default (you can e.g. automate the creation of this file in a script):
import FooPlugin from '@/extensions/fooplugin'
import BarPlugin from 'my/path/to/some/extensions/barextension.js'
export default {
FooExtension,
BarExtension
}
Now import that file into main.js
and pass it as "extensions" option to vue-extensions
:
import Extensionpoints from 'vue-extensions'
import AppExtensions from '@/extensions' // you can freely rename that
Vue.use(Extensionpoints, {extensions: AppExtensions})
new Vue({
//...
})
Note that you have to enable Vue's runtime compiler if you want to render single file template components as extensions!
// vue.config.js
module.exports = {
runtimeCompiler: true
}