2017-08-07 65 views
0

是否在maven插件配置中使用add_import_path選項或者我必須使用compassConfigFile? 設置buildDirectory到哪裏是導入文件的解決方案?使用add_import_path選項的sass-maven插件

我使用這個插件:

http://www.geodienstencentrum.nl/sass-maven-plugin/update-stylesheets-mojo.html

錯誤:

failed: File to import not found or unreadable: theme. 
Load paths: 

而且我也沒有,我需要在加載路徑

我試圖

<sassOptions> 
     <load_paths>${project.basedir}/src/main/webapp/theme/colors/red</load_paths> 
</sassOptions> 
目錄

沒有成功

回答

1

你需要指定load_paths爲數組,這似乎爲我工作:

<load_paths>['${project.basedir}/src/main/webapp/theme/colors/red']</load_paths> 

,使得它的工作就是串繞[ ],使得它似乎在Ruby陣列中的事 - 事情的結束,所以sass gem按照它想要的方式得到它

+0

我沒有嘗試,因爲我改變了插件以使用nodejs,guglp ...任何方式來解答你的答案。 –

0

於是我找到了解決辦法

<configuration> 
<sassOptions> 
    <always_update>true</always_update> 
    <style>${sass.OutputStyle}</style> 
</sassOptions> 
<useCompass>true</useCompass> 
<compassConfigFile>${project.basedir}/src/main/webapp/style/config.rb</compassConfigFile> 
<resources> 
    <resource> 
     <source> 
      <directory>${project.basedir}/src/main/webapp/style/themes/colors/cyan</directory> 
     </source> 
     <destination>${project.build.directory}/${project.build.finalName}/style/themes/colors/cyan</destination> 
    </resource> 
    <resource> 
     <source> 
      <directory>${project.basedir}/src/main/webapp/style/themes</directory> 
     </source> 
     <destination>${project.build.directory}/${project.build.finalName}/style/themes/colors/cyan</destination> 
    </resource> 
</resources> 

第一資源負載SCSS文件在第二資源進口導入的文件avaible。第一個資源在目標中不生成任何東西,但需要節點

相關問題