mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-18 06:31:27 +00:00
fix(kit): normalize plugin imports paths (#1779)
This commit is contained in:
parent
c577e1991e
commit
82d1741d52
@ -1,5 +1,5 @@
|
|||||||
import { existsSync, promises as fsp } from 'fs'
|
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 lodashTemplate from 'lodash.template'
|
||||||
import hash from 'hash-sum'
|
import hash from 'hash-sum'
|
||||||
import { pascalCase, camelCase, kebabCase } from 'scule'
|
import { pascalCase, camelCase, kebabCase } from 'scule'
|
||||||
@ -90,6 +90,9 @@ export function normalizePlugin (plugin: NuxtPlugin | string): NuxtPlugin {
|
|||||||
throw new Error('Invalid plugin. src option is required: ' + JSON.stringify(plugin))
|
throw new Error('Invalid plugin. src option is required: ' + JSON.stringify(plugin))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Normalize full path to plugin
|
||||||
|
plugin.src = normalize(plugin.src)
|
||||||
|
|
||||||
// Normalize mode
|
// Normalize mode
|
||||||
if (plugin.ssr) {
|
if (plugin.ssr) {
|
||||||
plugin.mode = 'server'
|
plugin.mode = 'server'
|
||||||
|
Loading…
Reference in New Issue
Block a user