在Ember-CLI项目中编译Compass [英] Compiling Compass in an Ember-CLI project

查看:52
本文介绍了在Ember-CLI项目中编译Compass的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ember-cli v0.0.23,并尝试获取 broccoli-compass 包与我的项目一起使用,我遇到了一些问题。

I'm using ember-cli v0.0.23, and am trying to get the broccoli-compass package working with my project, and I've run into some problems.

首先,在我的 Brocfile ,我替换了以下标准的Ember-CLI蓝图版本:

First, in my Brocfile, I have replaced the standard Ember-CLI "blueprint" version of:

var styles = preprocessCss(appAndDependencies, prefix + '/styles', '/assets');

具有以下内容:

var compileCompass = require('broccoli-compass');
var styles = compileCompass(appAndDependencies, 'app/styles/app.scss', {
    outputStyle: 'expanded',
    sassDir: 'app/styles',
    imagesDir: 'public/images/'
});    

但是,当我运行 ember版本 ,我收到以下输出:

However, when I run an ember build, I receive the following output:

$ ember build
[broccoli-compass] Error:  Command failed: Errno::ENOENT on line ["155"] of /Library/Ruby/Gems/2.0.0/gems/compass-0.12.6/lib/compass/compiler.rb: No such file or directory - /Users/gaker/Sites/project/tmp/tree_merger-tmp_dest_dir-GrWa8Zva.tmp/app/styles/app.scss
Run with --trace to see the full backtrace. The command-line arguments was: `compass compile app/styles/app.scss --relative-assets --sass-dir app/styles --output-style expanded --images-dir public/images/ --css-dir "../compass_compiler-tmp_dest_dir-eFsq51BG.tmp"`

如果我尝试运行<$在我的终端错误中输出的c $ c> compass 命令,它确实创建了文件,只是它位于我的项目根目录下的一个目录中(注意-css -dir 输出)。

If I try to run the compass command that is output in the error in my terminal, it does create the file, only it is up one directory from my project root (notice --css-dir in the output).

我尝试了许多选项 sassDir 的组合, imagesDir 等在调用 compileCompass 时,这是我所获得的最接近的。

I have tried many combinations of options sassDir, imagesDir, etc when calling compileCompass and this is the closest I've gotten.

那么关于如何才能成功使指南针,西兰花罗盘和ember-cli玩起来的任何想法?

So any ideas on what I can do to successfully get compass, broccoli-compass and ember-cli playing nicely?

在此先感谢

推荐答案

尝试以下操作(添加前缀和cssDir):

Try this (added prefix and cssDir):

var compileCompass = require('broccoli-compass');
var styles = compileCompass(appAndDependencies, prefix + '/styles/app.scss', {
    outputStyle: 'expanded',
    sassDir: prefix + '/styles',
    imagesDir: 'public/images/',
    cssDir: '/assets'
});

Steffen

这篇关于在Ember-CLI项目中编译Compass的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆