From 1cd2ef1ca22d3791f6d1fda5e8277a3caece369f Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 6 Jun 2023 20:40:47 +0100 Subject: [PATCH] fix: remove placeholder plugin --- src/module.ts | 3 --- src/runtime/plugin.placeholder.ts | 13 ------------- 2 files changed, 16 deletions(-) delete mode 100644 src/runtime/plugin.placeholder.ts diff --git a/src/module.ts b/src/module.ts index ba2fd699b..130360bd2 100644 --- a/src/module.ts +++ b/src/module.ts @@ -144,9 +144,6 @@ ${providers.map(p => ` ['${p.name}']: { provider: ${p.importName}, defaults: ${ if (options.inject) { // Add runtime plugin addPlugin({ src: resolver.resolve('./runtime/plugin') }) - } else if (nuxt.options.dev) { - // Add placeholder runtime plugin - addPlugin({ src: resolver.resolve('./runtime/plugin.placeholder') }) } // TODO: Transform asset urls that pass to `src` attribute on image components diff --git a/src/runtime/plugin.placeholder.ts b/src/runtime/plugin.placeholder.ts deleted file mode 100644 index 2730849c8..000000000 --- a/src/runtime/plugin.placeholder.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { defineNuxtPlugin } from '#imports' - -export default defineNuxtPlugin((nuxtApp) => { - const $img = () => throwImgError() - $img.getImage = () => throwImgError() - $img.getSizes = () => throwImgError() - $img.getMeta = () => throwImgError() - nuxtApp.provide('img', $img) -}) - -function throwImgError () { - throw new Error('[nuxt] [image] `$img` global utility is not enabled. You can enable it by setting `image: { inject: true }` in `nuxt.config`.') -}