【问题标题】:Sprite generation with Compass and SASS maven plugin missing load path使用 Compass 和 SASS maven 插件生成精灵缺少加载路径
【发布时间】:2013-07-01 08:08:09
【问题描述】:

我正在尝试使用具有 useCompass 选项的 sass-maven-plugin。我想在一个目录中精灵图像,但是我不能让目录被“看到”。我不断收到的错误是说加载路径匹配 icons/*.png 没有找到任何文件。有关完整错误,请参见下文。

注意:如果我只使用 compass compile 从命令行运行它,它就可以工作。但是使用 Maven 目标运行它我仍然得到错误。

pom.xml
|-src
 |-main
   |-scss
     |-styleguide
          -styleguide.scss
     |-images
       |-icons
          -my.png

pom.xml

<plugin>
    <groupId>org.jasig.maven</groupId>
    <artifactId>sass-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>sassProcessResources</id>
            <phase>generate-resources</phase>
            <goals>
                <goal>update-stylesheets</goal>
            </goals>
            <configuration>
                <useCompass>true</useCompass>
                <sassSourceDirectory>${basedir}/src/main/scss</sassSourceDirectory>
                <destination>${project.build.outputDirectory}/styleguide-components/resources/css</destination>
            </configuration>
        </execution>
    </executions>
</plugin>

scss 文件

@import "icons/*.png";

错误

Compilation of template C:/code/DiscoveryStyleGuide/styleguide/src/main/scss/styleguide/sprite/Sprite.scss failed: No files were found in the load path matching "icons/*.png". Your current load paths are: ./images

config.rb

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "compiled"
sass_dir = "/"
images_dir = "images"
# javascripts_dir = "javascripts"

【问题讨论】:

  • 你的 config.rb 的内容是什么?
  • 我创建了一个 config.rb 并且能够让构建读取它,但是它仍然存在问题。我将尝试使用路径来找出它是相对的。
  • @zmanc 你能解释一下你是如何让构建阅读它的吗?
  • 我使用以下提交中的代码提取了构建。
  • config.rb 相对于 pom.xml 应该放在哪里?

标签: css maven sass sprite compass-sass


【解决方案1】:

这实际上是指南针中的一个错误。通过@scottdavis This Comitt

的以下提交修复了它

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-01-23
    • 2013-11-22
    • 2014-09-28
    • 2014-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-07
    • 2013-04-13
    相关资源
    最近更新 更多