Scaffolding for Nuxt module
This commit is contained in:
commit
51db5e8b53
19 changed files with 16655 additions and 0 deletions
19
src/module.ts
Normal file
19
src/module.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { defineNuxtModule, addPlugin, createResolver } from '@nuxt/kit'
|
||||
|
||||
// Module options TypeScript interface definition
|
||||
export interface ModuleOptions {}
|
||||
|
||||
export default defineNuxtModule<ModuleOptions>({
|
||||
meta: {
|
||||
name: 'wideangle',
|
||||
configKey: 'myModule'
|
||||
},
|
||||
// Default configuration options of the Nuxt module
|
||||
defaults: {},
|
||||
setup (options, nuxt) {
|
||||
const resolver = createResolver(import.meta.url)
|
||||
|
||||
// Do not add the extension since the `.ts` will be transpiled to `.mjs` after `npm run prepack`
|
||||
addPlugin(resolver.resolve('./runtime/plugin'))
|
||||
}
|
||||
})
|
5
src/runtime/plugin.ts
Normal file
5
src/runtime/plugin.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { defineNuxtPlugin } from '#app'
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
console.log('Plugin injected by wideangle!')
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue