We have a build script that minimizes javascript/css and then copies it into the public folder.
What I'd like is for development boxes to load files from the app folder, where the unminimized scripts are stored on dev boxes, but still run the minimized scripts on production.
WHAT I'VE TRIED SO FAR:
-Changing the public path:
if (App::environment() == 'development') {
App::bind('path.public', function () {
return app_path() . '/unminimized';
});
}
This works for anywhere we use public_path(), but the front-end programmer uses relative paths, not URL::asset() (or whatnot), to load javascript (we use a framework, so this isn't easy to change). His javascript is still loaded from the public folder
-Changing nginx: I've tried changing the root_path in nginx from /website/public to /website/code. This loads the javascript correctly, but then my routes don't fire.
Does anyone have any ideas how to accomplish this?
If you modify nginx to point to /website/code on the dev box and then copy the index.php file from /website/public to /website/code it should fix your routes.
You will need to modify the following lines in index.php:
and
to match the new location so they can include those files correctly.