mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
fix: error when plugin not specify js extension (#3692)
This commit is contained in:
parent
aa09a20ce8
commit
3a825dc773
@ -446,8 +446,9 @@ export default class Builder {
|
||||
|
||||
// Check plugins exist then set alias to their real path
|
||||
await Promise.all(this.plugins.map(async (p) => {
|
||||
if (!await fsExtra.pathExists(p.src)) {
|
||||
throw new Error(`Plugin not found: ${p.src}`)
|
||||
const pluginFile = `${p.src}${path.extname(p.src) ? '' : '.js'}`
|
||||
if (!await fsExtra.pathExists(pluginFile)) {
|
||||
throw new Error(`Plugin not found: ${pluginFile}`)
|
||||
}
|
||||
|
||||
const src = this.relativeToBuild(p.src)
|
||||
|
2
test/fixtures/with-config/nuxt.config.js
vendored
2
test/fixtures/with-config/nuxt.config.js
vendored
@ -26,7 +26,7 @@ export default {
|
||||
loadingIndicator: 'circle',
|
||||
extensions: 'ts',
|
||||
plugins: [
|
||||
'~/plugins/test.js',
|
||||
'~/plugins/test',
|
||||
{ src: '~/plugins/only-client.js', ssr: false }
|
||||
],
|
||||
loading: '~/components/loading',
|
||||
|
Loading…
Reference in New Issue
Block a user