Skip to content

Commit

Permalink
fix(kit): normalize plugin imports paths (nuxt#1779)
Browse files Browse the repository at this point in the history
  • Loading branch information
b87ee58351 authored Nov 9, 2021
1 parent c577e19 commit 82d1741
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/kit/src/module/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, promises as fsp } from 'fs'
import { basename, extname, parse, resolve } from 'pathe'
import { basename, extname, normalize, parse, resolve } from 'pathe'
import lodashTemplate from 'lodash.template'
import hash from 'hash-sum'
import { pascalCase, camelCase, kebabCase } from 'scule'
Expand Down Expand Up @@ -90,6 +90,9 @@ export function normalizePlugin (plugin: NuxtPlugin | string): NuxtPlugin {
throw new Error('Invalid plugin. src option is required: ' + JSON.stringify(plugin))
}

// Normalize full path to plugin
plugin.src = normalize(plugin.src)

// Normalize mode
if (plugin.ssr) {
plugin.mode = 'server'
Expand Down

0 comments on commit 82d1741

Please sign in to comment.