fix: copy wrapper.php into api build

This commit is contained in:
Pujit Mehrotra
2025-08-13 11:28:25 -04:00
parent 21466f1b88
commit 17d151a020
+18
View File
@@ -70,6 +70,24 @@ export default defineConfig(({ mode }): ViteUserConfig => {
},
},
}),
// Copy PHP files to assets directory
{
name: 'copy-php-files',
async generateBundle() {
const { readFileSync } = await import('fs');
const { join, basename } = await import('path');
const phpFiles = ['src/core/utils/plugins/wrapper.php'];
phpFiles.forEach((file) => {
const content = readFileSync(file);
this.emitFile({
type: 'asset',
fileName: join('assets', basename(file)),
source: content,
});
});
},
},
],
define: {
// Allows vite to preserve process.env variables and not hardcode them