mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-02 10:27:15 +00:00
16 lines
421 B
TypeScript
16 lines
421 B
TypeScript
import { addVitePlugin, addWebpackPlugin, useNuxt } from '@nuxt/kit'
|
|
import scriptSetupPlugin from 'unplugin-vue2-script-setup'
|
|
|
|
export const setupScriptSetup = () => {
|
|
const nuxt = useNuxt()
|
|
|
|
addVitePlugin(scriptSetupPlugin.vite())
|
|
addWebpackPlugin(scriptSetupPlugin.webpack())
|
|
|
|
nuxt.hook('prepare:types', ({ references }) => {
|
|
references.push({
|
|
types: 'unplugin-vue2-script-setup/types'
|
|
})
|
|
})
|
|
}
|