Spirit icon indicating copy to clipboard operation
Spirit copied to clipboard

Move coffescript sources and mockups out of static

Open alesdotio opened this issue 8 years ago • 6 comments

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.

alesdotio avatar Jan 28 '17 15:01 alesdotio

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.

nitely avatar Jan 28 '17 17:01 nitely

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).

alesdotio avatar Jan 28 '17 17:01 alesdotio

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.

nitely avatar Jan 28 '17 18:01 nitely

Couldn't you write a rule in urls.py that serves those files from a different folder only when in debug?

alesdotio avatar Jan 28 '17 19:01 alesdotio

What about changing the gulp path?

//gulpfile.js
    var pathCoffee = jsPath + 'src/';
    var pathJs = jsPath + 'js/';
...

cryptogun avatar Jan 28 '17 21:01 cryptogun

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.

nitely avatar Jan 29 '17 22:01 nitely