-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aebdbc1
commit 2344782
Showing
1 changed file
with
21 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
import { defineNuxtModule, addPlugin, createResolver } from '@nuxt/kit' | ||
import { | ||
addComponent, | ||
createResolver, | ||
defineNuxtModule, | ||
} from '@nuxt/kit' | ||
import react from '@vitejs/plugin-react' | ||
|
||
// Module options TypeScript interface definition | ||
export interface ModuleOptions {} | ||
|
||
export default defineNuxtModule<ModuleOptions>({ | ||
meta: { | ||
name: 'my-module', | ||
configKey: 'myModule' | ||
name: 'nuxt-excalidraw', | ||
compatibility: { | ||
nuxt: '^3.0.0', | ||
}, | ||
}, | ||
// Default configuration options of the Nuxt module | ||
defaults: {}, | ||
setup (options, nuxt) { | ||
|
||
setup(_options, nuxt) { | ||
nuxt.options.vite ||= {} | ||
nuxt.options.vite.plugins ||= [] | ||
nuxt.options.vite.plugins.push(react()) | ||
|
||
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')) | ||
} | ||
addComponent({ | ||
name: 'ExcalidrawBoard', | ||
filePath: resolver.resolve('./runtime/components/ExcalidrawBoard.vue'), | ||
}) | ||
}, | ||
}) |