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

Compiling files from non-default folder #98

Open
italomaia opened this issue Feb 3, 2016 · 1 comment
Open

Compiling files from non-default folder #98

italomaia opened this issue Feb 3, 2016 · 1 comment

Comments

@italomaia
Copy link

I have a project with the following structure:

project
-blueprints
--myblueprint
---coffee
---static

I wish to compile coffeescript files from myblueprint/coffee into myblueprint/static. Is flask-assets capable of such? If not, I would like to leave it as a feature request. Thanks.

@miracle2k
Copy link
Owner

Yes, that should be possible.

The complication is this:

  • The base webassets library has a system of load paths - any paths you like can be used as a source, and all output files are written to 'env.directory'. This allows you to do what you want.
  • flask-assets replaces that system with one based on Flask's blueprints and static folders. This doesn't allow you to do what you want.

In principle you have to choose one of them. If you want the first, you have to forgo the second. That is, you have to set up all paths and urls so that they match the Flask static routing.

In addition, it is now possible to change the configuration for just one bundle. It might be possible to do this:

  coffee = Bundle('foobar.coffee', filters='coffee') 
  coffee.config.directory = 'path/to/coffee/dir
  coffee.config.url = ''  # probably not required, you never want to serve the coffee files directly.

  # Ideally, the rest of the system still uses the Flask-Assets url integration.
  main = Bundle(coffee, other_bundles)

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

2 participants