Spirit
Spirit copied to clipboard
Move coffescript sources and mockups out of static
There's no reason for the source files and mockups to be in the static directory. These are all collected by the collectstatic
command and served to the public.
There is. That way the code can be debugged with the web-browser debugging tools and source maps. The generated js file would be pretty hard to debug otherwise.
Ok, I haven't tried to use the tools to edit the js in Spirit.
However, it's still strange to see these files being served: http://community.spirit-project.com/static/spirit/stylesheets/mockups/login.html
And collectstatic
takes a lot longer because of the extra files (very noticeable when using S3).
Try collectstatic -i *.coffee -i *.html -i *.scss
, that should take care of most files you want to exclude. Sadly, there is no way to exclude a path, just files.
Couldn't you write a rule in urls.py that serves those files from a different folder only when in debug?
What about changing the gulp path?
//gulpfile.js
var pathCoffee = jsPath + 'src/';
var pathJs = jsPath + 'js/';
...
Couldn't you write a rule in urls.py that serves those files from a different folder only when in debug?
I'll look into it. My only concern is that may be confusing, but moving them to static_src/
might avoid that.
What about changing the gulp path?
Yeah, that and adding a new url pattern as @alesdotio suggested may work.