0
我用django壓縮器使用手寫筆和coffeeScript,它在Dev中完美工作。這是我的Jade模板:Django壓縮器無法壓縮生產中的coffeeScript文件
- load compress
!!! 5
html
head
title Super Page
- compress css
link(rel='stylesheet',type='text/stylus',href='{{STATIC_URL}}styles/base.styl')
link(rel='stylesheet',type='text/stylus',href='{{STATIC_URL}}styles/style.styl')
- endcompress
- compress js
script(type='text/coffeescript',src='{{STATIC_URL}}app/coolscript.coffee')
script(type='text/coffeescript',src='{{STATIC_URL}}app/evencooler.coffee')
- endcompress
body
block content
對於部署,我使用Heroku和Amazon S3作爲靜態文件。一旦部署,我訪問該網站,並加載罰款和風格看起來如預期,但腳本不起作用。 檢查<head>
我看到樣式被壓縮成一個css文件,但coffeeScript文件不是。該瀏覽器獲取的CS源文件:
<script type="text/coffeescript" src="http://supercoolapp.s3.amazonaws.com/static/app/coolscript.coffee"></script>
<script type="text/coffeescript" src="http://supercoolapp.s3.amazonaws.com/static/app/evencooler.coffee"></script>
I
有人工作之前,我曾經有過這個問題,但我不記得是什麼原因,我覺得整個編譯過程是悄無聲息,我沒有唐不知道如何調試它。