mirror of
https://github.com/transloadit/uppy.git
synced 2026-01-23 10:25:33 +00:00
Co-authored-by: Merlijn Vos <merlijn@soverin.net> Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
17 lines
603 B
PHP
17 lines
603 B
PHP
<?php
|
|
|
|
|
|
if(str_starts_with($_SERVER['REQUEST_URI'], '/main.js')) {
|
|
header("Content-Type: text/javascript; charset=UTF-8");
|
|
passthru('corepack yarn outputBundle');
|
|
return true;
|
|
} else if (str_starts_with($_SERVER['REQUEST_URI'], '/uppy.min.css')) {
|
|
header("Content-Type: text/css; charset=UTF-8");
|
|
if(readfile(exec('node -p \'require.resolve("uppy").replace((p=require("uppy/package.json")).main,p.style)\'')) === false) {
|
|
http_response_code(404);
|
|
echo 'Cannot find the CSS file, be sure to run the build command.';
|
|
}
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|