From 7b7017ec0343fd074d73e08c54ffb9698791495e Mon Sep 17 00:00:00 2001 From: wizardchen Date: Sat, 28 Feb 2026 16:10:25 +0800 Subject: [PATCH] feat: update Vite configuration for module resolution - Replaced direct import of '@vue-office/pptx' with require.resolve to improve module resolution in the Vite configuration. - Added createRequire to support CommonJS-style imports in the ES module context. This update enhances compatibility and ensures correct module resolution during the build process. --- frontend/vite.config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 862f2a6b..7ed2c645 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,8 +1,11 @@ import { fileURLToPath, URL } from 'node:url' +import { createRequire } from 'node:module' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' +const require = createRequire(import.meta.url) + export default defineConfig({ plugins: [ vue(), @@ -11,7 +14,7 @@ export default defineConfig({ resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)), - '@vue-office/pptx': '@vue-office/pptx/lib/index.js', + '@vue-office/pptx': require.resolve('@vue-office/pptx/lib/index.js'), }, }, server: {