Skip to content

Commit 1957398

Browse files
committed
fix: add plugin order warning
1 parent f78823d commit 1957398

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/vite-plugin/src/importPlugin.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { extname } from 'path'
2-
import { PluginOption } from 'vite'
2+
import { Plugin, PluginOption } from 'vite'
33
import { generateImports } from '@vuetify/loader-shared'
44
import { parse as parseUrl, URLSearchParams } from 'url'
55

@@ -15,6 +15,11 @@ function parseId (id: string) {
1515
export function importPlugin (): PluginOption {
1616
return {
1717
name: 'vuetify:import',
18+
configResolved (this: Plugin, config) {
19+
if (config.plugins.indexOf(this) < config.plugins.findIndex(plugin => plugin.name === 'vite:vue')) {
20+
throw new Error('Vuetify plugin must be loaded after the vue plugin')
21+
}
22+
},
1823
async transform (code, id) {
1924
const { query, path } = parseId(id)
2025
if (extname(path) === '.vue' && !query) {

0 commit comments

Comments
 (0)