sass-maven-plugin 使用 add_import_path 选项
sass-maven-plugin using add_import_path option
是否可以在 maven 插件配置中使用 add_import_path 选项,或者我必须使用 compassConfigFile ?
将 buildDirectory 设置为导入文件所在的路径是一个解决方案吗?
我用这个插件:
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>
没有成功
所以我找到了解决方案
<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文件在第二个资源导入文件中可用。第一个资源在目的地不生成任何东西,但需要节点。
您需要将 load_paths
指定为数组,这似乎对我有用:
<load_paths>['${project.basedir}/src/main/webapp/theme/colors/red']</load_paths>
使它起作用的是字符串周围的 [ ]
,使它成为一个数组,它看起来在 ruby 的末尾,所以 sass gem 随心所欲
是否可以在 maven 插件配置中使用 add_import_path 选项,或者我必须使用 compassConfigFile ? 将 buildDirectory 设置为导入文件所在的路径是一个解决方案吗?
我用这个插件:
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>
没有成功
所以我找到了解决方案
<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文件在第二个资源导入文件中可用。第一个资源在目的地不生成任何东西,但需要节点。
您需要将 load_paths
指定为数组,这似乎对我有用:
<load_paths>['${project.basedir}/src/main/webapp/theme/colors/red']</load_paths>
使它起作用的是字符串周围的 [ ]
,使它成为一个数组,它看起来在 ruby 的末尾,所以 sass gem 随心所欲