西兰花指南针和ember-cli 0.39 [英] Broccoli-compass and ember-cli 0.39
问题描述
我最近将ember-cli升级到了.39,并且发生了一些变化,导致我的西兰花指南针代码破裂。
I recently upgraded ember-cli to .39, and something changed to cause my broccoli-compass code to break.
这里是代码:
app.styles = function() {
return compileCompass(this.appAndDependencies(), this.name + '/styles/app.scss', {
compassCommand: 'bundle exec compass',
outputStyle: 'expanded',
sassDir: this.name + '/styles',
imagesDir: 'public/images',
cssDir: '/assets'
});
};
我收到此错误:
[broccoli-compass] Error: Command failed: Errno::ENOENT on line ["155"] of ~/.rvm/gems/ruby-2.1.1/gems/compass-0.12.6/lib/compass/compiler.rb: No such file or directory @ rb_sysopen - ~/campaign-designer/ember/tmp/tree_merger-tmp_dest_dir-pSk32Zuy.tmp/campaign-designer/styles/app.scss
Run with --trace to see the full backtrace
arguments: `bundle exec compass compile campaign-designer/styles/app.scss --relative-assets --sass-dir campaign-designer/styles --output-style expanded --images-dir public/images --css-dir "../compass_compiler-tmp_cache_dir-8Yu97OaF.tmp/assets"`
app.styles
或 this.appAndDependencies()
是否已更改?我尝试了此配置的许多变体而无济于事。
Has app.styles
or this.appAndDependencies()
changed? I've tried many variants of this config to no avail.
还有一个类似的问题此处,但我仍然无法正常工作。
There's a similar question here, but I still couldn't get things working.
推荐答案
对于它的价值,这样的事情最终对我有所帮助:
For what it's worth, something like this ended up helping me:
// Compass config in Brocfile.js
app.registry.add('css', 'broccoli-compass', 'scss', {
toTree: function(tree, inputPath, outputPath, options) {
// broccoli-compass doesn't like leading slashes
if (inputPath[0] === '/') { inputPath = inputPath.slice(1); }
// tree = mergeTrees([
// tree,
// 'public'
// ], {
// description: 'TreeMerger (stylesAndVendorAndPublic)'
// });
return compileCompass(tree, inputPath + '/app.scss', {
outputStyle: 'expanded',
// require: 'sass-css-importer', // Allows us to import CSS files with @import("CSS:path")
sassDir: inputPath,
imagesDir: 'images',
//fontsDir: 'fonts',
cssDir: outputPath
});
}
});
最终我从项目中删除了指南针(我只需要自己写一些SASS mixins)以避免
Ultimately I removed compass from my project (I just had to write a few SASS mixins myself) to avoid the troubles with the config + attempt to get faster build speeds.
更新:,您可能会遇到配置+尝试加快构建速度的麻烦。现在想查看 ember-cli-compass-compiler ember-cli插件,这样可以更轻松地在ember-cli项目中开始使用Compass。
Update: You may now want to check out the ember-cli-compass-compiler ember-cli addon, which makes it easier to get started with Compass in your ember-cli project.
这篇关于西兰花指南针和ember-cli 0.39的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!