Hi guys!
I'm using ver 0.7.1 and trying to compile coffeescript files into js files and I have the following bundle configuration:
coffee_bundle = Bundle('coffee/*.coffee',
filters='coffeescript'
)
jslibs_bundle = Bundle("js/lib/*.js")
jsall_bundle = Bundle(coffee_bundle,jslibs_bundle,
filters="coffeescript,jsmin", output="js/app.js"
)
in my template:
{% assets "jsall_bundle" %}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %}
In debug mode this produces
<script type="text/javascript" src="/static/coffee/test.coffee"></script><!-- DO NOT WANT .coffee (actually expected test.js)-->
<script type="text/javascript" src="/static/js/lib/bootstrap.js"></script>
<script type="text/javascript" src="/static/js/lib/handlebars-1.0.rc.1.js"></script>
<script type="text/javascript" src="/static/js/lib/jquery-1.8.2.js"></script>
As you can see coffescript files aren't compiled, so, I thought maybe I should specify debug=False to the coffee_bundle, but this results in the following error:
BuildError: No output target found for <Bundle output=None, filters=[<webassets.filter.coffeescript.CoffeeScriptFilter object at 0x1019414d0>], contents=('coffee/*.coffee',)>
Ok, lets add output :
coffee_bundle = Bundle('coffee/*.coffee',debug=False,
filters='coffeescript', output="js/coffee.js"
)
Ok, coffescript files are compiling now, but they are merged into one file, which is not a desirable result because it's hard to debug
<script type="text/javascript" src="/static/js/coffee.js?4913d094"></script>
<script type="text/javascript" src="/static/js/lib/bootstrap.js"></script>
<script type="text/javascript" src="/static/js/lib/handlebars-1.0.rc.1.js"></script>
<script type="text/javascript" src="/static/js/lib/jquery-1.8.2.js"></script>
So the question is how can I compile .coffee files one by one in debug mode and merge them with other js files in production mode? Is it possible?
Hi guys!
I'm using ver 0.7.1 and trying to compile coffeescript files into js files and I have the following bundle configuration:
in my template:
{% assets "jsall_bundle" %} <script type="text/javascript" src="{{ ASSET_URL }}"></script> {% endassets %}In debug mode this produces
As you can see coffescript files aren't compiled, so, I thought maybe I should specify
debug=Falseto thecoffee_bundle, but this results in the following error:Ok, lets add
output:Ok, coffescript files are compiling now, but they are merged into one file, which is not a desirable result because it's hard to debug
So the question is how can I compile
.coffeefiles one by one in debug mode and merge them with other js files in production mode? Is it possible?