diff --git a/src/runtime/loader.server.ts b/src/runtime/loader.server.ts
index 33c745e..c85e6bd 100644
--- a/src/runtime/loader.server.ts
+++ b/src/runtime/loader.server.ts
@@ -1,11 +1,11 @@
import type { OfficeAddinVirtualContext } from '../vite/types'
+import { OFFICE_JS_LOADER_SNIPPET } from '../vite/utils'
// @ts-expect-error virtual import
import context from '#office-addin-content'
export default defineNitroPlugin(async (nitroApp) => {
const { manifests, options } = context as OfficeAddinVirtualContext
- const OFFICE_JS_URL = 'https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js'
if (!options || !options.manifests.length)
return
@@ -33,6 +33,6 @@ export default defineNitroPlugin(async (nitroApp) => {
)
if (matches)
- html.head.push(``)
+ html.head.push(OFFICE_JS_LOADER_SNIPPET)
})
})
diff --git a/src/vite/utils.ts b/src/vite/utils.ts
index 260a892..e689afe 100644
--- a/src/vite/utils.ts
+++ b/src/vite/utils.ts
@@ -3,6 +3,9 @@ import { resolve } from 'node:path'
import { loadEnv, normalizePath } from 'vite'
import type { ManifestEntry, ManifestEntryContent } from './types'
+export const OFFICE_JS_URL = 'https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js'
+export const OFFICE_JS_LOADER_SNIPPET = ``
+
export function getPath(paths: string[]) {
return normalizePath(resolve(...paths))
}