-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development mode (debug = true ) with CakePHP 3.0 #277
Comments
Set debug to false. There isn't a way to generate the static files on each request in debug mode. However, the development output is cached so that if input files do not change the development builder uses the cache for better performance. Why do you need the static files regenerated all the time? |
Hi, What should be the development configuration ? Did I misunderstand something ? |
You shouldn't need to use the CLI tool in development mode. An example configuration that I have is ; Define an extension type.
; build targets are prefixed with this value
; are connected when the ini file is parsed.
[js]
paths[] = WEBROOT/js/*
cachePath = WEBROOT/cache/
filters[] = JsMinFilter
[css]
paths[] = WEBROOT/css/*
cachePath = WEBROOT/cache/
[app.js]
files[] = vendor/jquery-2.1.4.js
files[] = repos.js
[app.css]
files[] = base.css
files[] = cake.css And in my Plugin::load('AssetCompress', ['bootstrap' => true]); The debug option in the config file does nothing, instead you should |
Hi, sorry for long time response. Do not know if it is the right way to solve the problem but it seems to work. //$routes->fallbacks('InflectedRoute'); to specify explicitly my own routes. if (Configure::read('debug')) {
Router::scope('/cache_js', function ($routes) {
$routes->fallbacks('InflectedRoute');
});
Router::scope('/cache_css', function ($routes) {
$routes->fallbacks('InflectedRoute');
});
} Note : if the css/js file is present in the webroot/cache_css and webroot/cache_js it will not be overwritten if the source file is modified. So in development mode those directories should by either empty or not present |
Why do you need to define routes? This plugin doesn't use a controller and should be able to respond to URLs even if they have no routes. |
Hi,
The cache is not generated automatically even when debug value is set to 'true' with CakePHP 3.0 application. I have to manually generate the static files via the shell command everytime for every change.
Is there a way to avoid this ?
The text was updated successfully, but these errors were encountered: