Skip to content
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

Move coffescript sources and mockups out of static #159

Open
alesdotio opened this issue Jan 28, 2017 · 6 comments
Open

Move coffescript sources and mockups out of static #159

alesdotio opened this issue Jan 28, 2017 · 6 comments

Comments

@alesdotio
Copy link
Contributor

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.

@nitely
Copy link
Owner

nitely commented Jan 28, 2017

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.

@alesdotio
Copy link
Contributor Author

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

@nitely
Copy link
Owner

nitely commented Jan 28, 2017

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.

@alesdotio
Copy link
Contributor Author

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

@cryptogun
Copy link
Contributor

What about changing the gulp path?

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

@nitely
Copy link
Owner

nitely commented Jan 29, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants