它看起來像SASS默認暴露scss文件,我覺得很討厭。有沒有辦法將SASS配置爲在不在Web根目錄中的文件夾中查找scss文件,但將它們編譯到public/stylesheets
文件夾中?我可以配置SASS使scss文件不在web根目錄下嗎?
1
A
回答
1
是的!
如果您使用Compass,那麼您將擁有一個如下所示的文件/config/compass.rb。在這裏,我有在app /樣式我SASS文件,並在TMP /樣式儲蓄編譯(幫助Heroku的部署)
/config/compass.rb
# This configuration file works with both the Compass command line tool and within Rails.
# Require any additional compass plugins here.
project_type = :rails
project_path = Compass::AppIntegration::Rails.root
#project_path = RAILS_ROOT if defined?(RAILS_ROOT)
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "tmp/stylesheets"
sass_dir = "app/stylesheets"
environment = Compass::AppIntegration::Rails.env
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
0
老問題,但它實際上是簡單做,你只需將目錄傳遞給sass而不是特定的.scss就好了;
青菜--watch /位置/到/你/ SCSS /:/位置/到/你/ CSS
然後SCSS的任何更改將被保存到你的CSS目錄中,它也將遵循同樣的結構你的scss目錄。
相關問題
- 1. .SCSS文件不在同一個根目錄下可以編輯.CSS文件嗎?
- 2. 我可以讓webpack-dev-server在web根目錄下運行嗎?
- 3. 我可以在wordpress根目錄下創建「inc」文件夾嗎?
- 4. 如何在我的Webpack sass-loader配置中爲SCSS指定資源根目錄?
- 5. 我可以使用SASS/SCSS變量來設置類名嗎?
- 6. JavaScript可以檢索Web根目錄之上的文件嗎?
- 7. 可以安全地在web根目錄下保存.git目錄嗎?
- 8. 如何在我的HTML項目中使用sass/scss文件?
- 9. 可以讀取文件以發送web根目錄之外的內容處置頭使用文件嗎?
- 10. Rails 3.1 SCSS - 我可以在SASS for循環中調用SASS函數嗎?
- 11. 我們可以更改DispatcherServlet上下文配置文件名嗎?
- 12. 可以在項目的根目錄下編碼嗎?
- 13. 我可以用Flash下載多個文件到目錄嗎?
- 14. 可能參考文檔根目錄下的javascript文件嗎?
- 15. 我可以根據IntegrationTest的名稱設置工作目錄嗎?
- 16. 我可以檢出svn:externals到父目錄的根目錄嗎?
- 17. 可以在web根目錄下有live站點的git倉庫嗎?
- 18. 從另一個目錄導入.scss(sass)文件?
- 19. 我可以搜索目錄和子目錄的頭文件嗎?
- 20. 我可以使用Tomcat上下文參數配置Log4j嗎?
- 21. 你可以在SASS/SCSS CSS中使用多個條件:
- 22. Webpack - 導出SASS(.scss)文件
- 23. 如果我使用OpenID登錄,我可以訪問配置文件信息嗎?
- 24. 使SASS生成的行註釋開始在項目根目錄而不是文件系統根目錄
- 25. Maven - 我可以在配置文件定義中引用配置文件ID嗎?
- 26. 我的iPhone可以配置兩個配置文件嗎?
- 27. 我可以把我的web服務在子目錄中嗎?
- 28. 我可以使用.NET創建IOC控件以放置在Web項目中嗎?
- 29. 我可以在jboss 4.2中全局更改Web應用程序根目錄嗎?
- 30. sass/scss/compass:如何設置默認項目文件結構
任何想法如何做到這一點,沒有指南針? – 2011-03-16 20:50:39
@Alex - 您可以使用sasswatch並手動將文件從一個文件直接複製到公共/樣式表。 – 2011-03-16 20:52:24
謝謝傑西,這正是我一直在尋找的! – 2011-03-17 00:02:05