Coder Social home page Coder Social logo

ember-cli-compass-compiler's Introduction

ember-cli-compass-compiler

This addon adds Compass compiler for Ember CLI.

Installation

In your Ember CLI app, run the following:

ember install ember-cli-compass-compiler

Note: This addon will compile your .scss files, in addition to making Compass's libraries available to your project. This means you do not need additional broccoli libraries for compiling sass, such as broccoli-sass.

Be sure to remove all such libraries from your project when using ember-cli-compass-compiler.

Requirements

compass should be installed on your machine in order for this addon to work.

To install compass, run:

gem install compass

Usage

After installation everything should work automatically.

app.scss in your app/styles directory is compiled into assets/appname.css with ember build or ember serve commands. Other .scss files in app/styles are compiled as well.

Note: Previous versions of this addon(< 0.1.0) was requiring the main .scss file to be named as appname.scss.

To override default options of compass compiler, do the following in your Brocfile:

var app = new EmberApp({
  compassOptions: {
    outputStyle: 'expanded',
    require: ['sass-css-importer', 'susy']
  }
});

To use compass, import it in your app.scss:

@import "compass";

.round-rect-button {
  @include border-radius(4px, 4px);
}

To include other files, import them using the relative path:

@import "compass";
@import "../../bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap";

.badge-success {
  @extend .badge;
  background-color: $brand-success !important;
}

or use importPath option:

var app = new EmberApp({
  compassOptions: {
    importPath: ['bower_components/bootstrap-sass-official/assets/stylesheets']
  }
});
@import "compass";
@import "bootstrap";

.badge-success {
  @extend .badge;
  background-color: $brand-success !important;
}

Import paths

You can add additional scss import paths in your compassOptions. These paths will also be watched by broccoli and reload live.

var app = new EmberApp({
  compassOptions: {
    importPath: ['/relative/path/to/vendor/scss/dir', '/other/full/path/to/css/dir']
  }
});

Ember CLI Addon Usage

If you are developing an Ember CLI Addon, you must follow these additional steps:

  1. Include your styles in addon/styles/addon.scss (.sass works as well)

  2. You can either install ember-cli-compass-compiler via NPM:

$ npm install --save ember-cli-compass-compiler

or make sure to move it to dependencies from devDependencies in your package.json if already installed via ember install ember-cli-compass-compiler command:

"dependencies": {
  ...
  "ember-cli-compass-compiler": "^0.4.0",
  ...
}

Important: If you omit this step, Ember CLI will compile tests/dummy/app/styles/app.scss for your dummy test application but not your primary stylesheet at addon/styles/addon.css.

  1. In ./index.js of your project, make sure an included function is defined:
'use strict'

module.exports = {
  name: 'my-addon',
  included: function(app) {
    this._super.included(app);

    // OPTIONAL: import your addon dependencies from bower_components
    // app.import(`${app.bowerDirectory}/bootstrap/dist/js/bootstrap.js`);
  }
};

Without this, Ember CLI will throw an error when trying to serve the dummy test application or building distributables:

Cannot read property 'compassOptions' of undefined
TypeError: Cannot read property 'compassOptions' of undefined
  1. Ensure your dummy test application contains app.scss.

  2. Run ember build. Your stylesheet at addon/styles/addon.scss will be compiled to dist/assets/vendor.css and your test app's stylesheet at tests/dummy/app/styles/app.scss will be compiled to dist/assets/dummy.css.

For more information, refer to Developing Addons and Blueprints section on the Ember CLI website.

References

This work is built based on the gist by @wagenet.

Other

Still a work in progress, use at your own risk.

LICENSE

The MIT License (MIT)

Copyright (c) 2015 Emre Unal

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

ember-cli-compass-compiler's People

Contributors

akmiller78 avatar andrewjo avatar gigr avatar glavin001 avatar jgelens avatar lukemelia avatar quaertym avatar repl-andrew-ovens avatar samselikoff avatar stefanpenner avatar zigotica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ember-cli-compass-compiler's Issues

Error when trying to build

After installing ember-cli-compass-compiler I can't start the server:

ENOENT, no such file or directory '/Users/my_user/Projects/my_project/tmp/funnel-input_base_path-q1IJ0ODV.tmp/0/app/styles/'
Error: ENOENT, no such file or directory '/Users/my_user/Projects/my_project/tmp/funnel-input_base_path-q1IJ0ODV.tmp/0/app/styles/'
    at Error (native)
    at Object.fs.readdirSync (fs.js:761:18)
    at walkSync (/Users/my_user/Projects/my_project/node_modules/walk-sync-matcher/index.js:22:20)
    at Funnel.processFilters (/Users/my_user/Projects/my_project/node_modules/broccoli-funnel/index.js:181:15)
    at Funnel.build (/Users/my_user/Projects/my_project/node_modules/broccoli-funnel/index.js:161:10)
    at /Users/my_user/Projects/my_project/node_modules/broccoli-plugin/read_compat.js:61:34
    at lib$rsvp$$internal$$tryCatch (/Users/my_user/Projects/my_project/node_modules/rsvp/dist/rsvp.js:493:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/my_user/Projects/my_project/node_modules/rsvp/dist/rsvp.js:505:17)
    at lib$rsvp$$internal$$publish (/Users/my_user/Projects/my_project/node_modules/rsvp/dist/rsvp.js:476:11)
    at lib$rsvp$asap$$flush (/Users/my_user/Projects/my_project/node_modules/rsvp/dist/rsvp.js:1198:9)

Didn't convert default app.css to appname.css [email protected]

The addon works great, but with ember-cli v0.0.40 apparently the default css file is just app/styles/app.css, not appname.css which isn't converted correctly to appname.scss and throws an error in compass compilation. Changing the filename manually works though.

I'm new to ember-cli so I may have missed a step, but here's what I did:

ember new test-app
cd test-app
npm install --save-dev ember-cli-compass-compiler
ember serve

[broccoli-compass] Error: Command failed: Errno::ENOENT on line ["155"] of /Library/Ruby/Gems/2.0.0/gems/compass-0.12.7/lib/compass/compiler.rb: No such file or directory - /Users/user/workspace/test/ember/test-app/tmp/tree_merger-tmp_dest_dir-nF2FPBWr.tmp/app/styles/test-app.scss
Run with --trace to see the full backtrace

arguments: compass compile app/styles/test-app.scss --relative-assets --sass-dir app/styles --output-style compressed --require sass-css-importer --images-dir images --fonts-dir fonts --css-dir "../compass_compiler-tmp_cache_dir-xAkDz4FM.tmp/assets"

Compiler suddenly has started failing

This error randomly started without any changes to the compiler or options. Now when using ember build this is the error that pops up:

PS C:\dev\app> ember build
version: 1.13.8
Building...

Build failed.
Command failed: C:\Windows\system32\cmd.exe /s /c "compass compile --sass-dir=app/styles
                --css-dir='C:\dev\app\tmp\compass_compiler-tmp_cache_dir-dYFBH4rS.tmp\assets' --output-style=expanded

at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Socket.<anonymous> (child_process.js:1183:11)
at Socket.emit (events.js:107:17)
at Pipe.close (net.js:485:12)

That's the entire error.

I've tried npm uninstall --save-dev ember-cli-compass-compiler and then reinstalling it, but this still produces the compilation error.

Anything else I can do to reset the compiler?

Ignore unrelated imported files

Hi, I want to know if is possible to be more selective in the compiling of the assets. I mean:

/*app/styles/home.scss*/
@import "home/a.css";
@import "home/b.css";
/*...*/
/*app/styles/blog.scss*/
@import "blog/a.css";
@import "blog/b.css";
/*...*/

Changing home/_a.css triggers the compilation of all directory, instead of only recompiling home.css. compass watch works this way:

>>> Compass is watching for changes. Press Ctrl-C to Stop.
 modified blog/_a.scss
 write stylesheets/a.css

Importing from vendor

In Ember-Cli docs it says:
The vendor trees that are provided upon instantiation are available to your dynamic style files. Take the following example (in app/styles/app.scss):
@import "bower_components/foundation/scss/normalize.scss";

This works when using broccoli-sass, but I couldn't get it to work with ember-cli-compass-compiler.

Is it possible? What do I need to do?

Thanks!

ember-cli 1.13.1: /assets/<app>.css not found

There is something wrong -- the app's main css file is missing w/ ember serve after I install ember-cli-compass-compiler.

app.scss would seem to be compiling correctly: at least, it is silent w/ trivial app.scss. When I put in a syntax error, I get an error:

Command failed: /bin/sh -c compass compile --sass-dir=app/styles --css-dir='/Volumes/Macintosh_HD/Users/shauncutts/src/crane-bfi/tmp/compass_compiler-tmp_cache_dir-3e7tPR8y.tmp/assets' --output-style=compressed

What else can I do to test? Perhaps the problem is the new use of non-standard broccoli file?

Use ember-cli-compass-compiler to compile Sass in addons?

Hi!

Currently, broccoli-sass is the standard de-facto for compiling addon styles.

I wish addon creators could make the broccoli-sass dependency optional, letting users choose which preprocessor to use.

Can ember-cli-compass-compiler compile addon styles? How?

Seems to cause ember-cli 0.2.7 to hang

I'm experiencing a hanging build with:

version: 0.2.7
node: 0.12.4
npm: 2.11.0

I'm not sure how to further debug this. After uninstalling ember-cli-compass-compiler I'm able to build fine.

Default precision for compass is 5 -- need to increase it

I am using bootstrap sass with ember-cli-compass-compiler - button line-heights aren't working right because the default precision for compilation appears to be 5 digits, but I actually need 9. Specifically, the bootstrap sass defines base-line-height as 1.428571429 but it truncates it to 1.42857. This makes buttons mal-aligned.

How can I change the precision? I've scoured the Internet but nothing seems to solve this problem.

Thanks

Error: Command failed: Individual stylesheets must be in the sass directory.

When building from a directory path with a space in, using Ember 0.0.46 I get the following error:

C:\my\path\with\a\s p a c e\in\it>ember serve
version: 0.0.46
Livereload server on port 35729
Serving on http://0.0.0.0:4200
Individual stylesheets must be in the sass directory.


Command failed: Individual stylesheets must be in the sass directory.

Error: Command failed: Individual stylesheets must be in the sass directory.

    at ChildProcess.exithandler (child_process.js:648:15)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

The command being executed is:

compass compile --sass-dir=app/styles --css-dir=C:\my\path\with\a\s p a c e\in\it\tmp\compass_compiler-tmp_cache_dir-nMCB2moN.tmp\assets --output-style
=compressed

If I wrap the --css-dir value in quotes (by hard-coding it) it will fix the problem, but I can't see an easy way to easily do that dynamically.

Asset subdirectories should compile to local path

Maybe I'm misunderstanding how this works but i'll see if I can explain first.

The default location for assets is <app-name>/public/assets, which then copy to <app-name>/dist/assets upon building. The problem lies in setting the default directories for any assets within ember-cli-compass-compiler.

Compass sets the font directory to /fonts by default. This causes warnings upon every build: WARNING: 'font.ttf' was not found in <app-name>/fonts but the fonts are found and work as expected in the browser.

To remove these warnings, I set the --fonts-dir option to public/assets/fonts. But compiling doesn't remove the public/assets portion, so naturally the browser can't find the font in <app-name>/dist/assets/public/assets/fonts.

Proposal: To me the default for ember-cli-compass-compiler should be public/assets/fonts which then compiles to fonts, since <app-name>.css already sits in the assets directory. This would remove the warnings and work as expected. Either that or like I said, I'm misunderstanding how to set the defaults properly.

Ember server won't restart Compass for edits in files located outside of `app/styles`

Hi!

I'm converting my Ember CLI project structure to pods. Thus, i'm moving my Sass partials outside of the app/styles folder.

When i first start ember server, all CSS is rendered correctly. Styles from partials outside the app/styles make their way into the browser.

Then, when i edit a Sass partial, Ember server detects the edit and restarts the build. The problem is that Compass is not executed during that build! ๐Ÿ˜ฒ

In other words, Compass is only executed during builds initiated for Sass files located inside app/styles. This makes it impossible to put Sass code into pods.

Please advise.

Need broccoli-sass?

This project doesn't need broccoli-sass, correct? It may be worth pointing out in the README, because often people add sass, then later add compass. As of .45 testem will complian if you're using broccoli-sass and don't have a file named app.scss.

If this is correct I'll submit a PR on the readme.

Use app.scss, not [appname]

app.scss is the ember-cli convention, and also the convention other libs use (e.g. ember-cli-bootstrap-sass). The sass import paths get screwed up when we switch to [appname].

We should probably use app.scss.

.scss files don't re-compile with `ember server`

Right now, the only way to re-compile compass files with ember-cli-compass-compiler seems to be to run the command ember build.

However they should automatically re-compile if an ember server is running and a sass file is changed.

Vague error messages

Not sure if this is within the scope of this project or something to do with another component of the ember-cli setup, but when running into a syntax error during compilation we're getting unhelpful messages

Error:  Command failed:
arguments: `compass compile app/styles/app.scss --relative-assets --sass-dir app/styles --output-style compressed --require breakpoint --images-dir images --fonts-dir fonts --css-dir "..\compass_compiler-tmp_cache_dir-Icf8eQCt.tmp\assets"`

In order to see what is actually causing the compilation error I had to manually run the command, which then informed me of the actual issue:

error app/styles/app.scss (Line 17: Invalid CSS after ".": expected class name, was "button.nav-pane")
Compilation failed in 1 files.

It would be nice to have the compass error properly shown.

Can't find app.scss

Since upgrading to ember cli 0.2.0 beta 1 i get this error

<myappname>/tmp/compass_compiler-tmp_dest_dir-OGIul1BP.tmp/app/styles/app.[scss|sass] does not exist

When i look in finder i find this:

screen shot 2015-02-26 at 17 38 45 1

How can i fix this?

include example with some handy excludes

turns out broccoli-compass is pretty aggressive about pulling stuff in, causing large amounts of extra file copies. Until the symlink/hardlink refactoring arrives we have to be careful about these.

I think a whitelist would likely be better, but the bellow was a quickfix and helped with performance.

app.config.compassOptions.exclude = [
  'bower_components/**/*', /* or the components you don't need */
  'vendor/**/*', /* of the vendored stuff you don't need */ 
  '**/*.js',
  '**/*.md',
  '**/*.json',
  '**/*.txt',
  '**/*.html',
  '**/*.xml',
  '**/*.css'
];

related: (whitelisting) https://github.com/g13013/broccoli-compass/blob/master/index.js#L57

Compass errors not shown

Using the latest version Compass compile errors are not shown anymore :-(

Instead I get the following:

Error: Command failed: 
Build failed.
Command failed: 
Error: Command failed: 
    at ChildProcess.exithandler (child_process.js:648:15)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Socket.<anonymous> (child_process.js:969:11)
    at Socket.emit (events.js:95:17)
    at Pipe.close (net.js:465:12)

Any idea how to fix this?

Adding to compass' sass-dir

Hi!

I migrated from ember-cli-sass to ember-cli-compass-compiler because I needed to use a couple of compass mixins. I'm having an issue with paths, now. I have the following dir. structure:

โ”œโ”€โ”€ Gemfile
โ”œโ”€โ”€ Gemfile.lock
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ app
โ”œโ”€โ”€ bower.json
โ”œโ”€โ”€ bower_components
โ”œโ”€โ”€ config
โ”œโ”€โ”€ dist
โ”œโ”€โ”€ ember-cli-build.js
โ”œโ”€โ”€ node_modules
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ public
โ”œโ”€โ”€ testem.json
โ”œโ”€โ”€ tests
โ”œโ”€โ”€ tmp
โ””โ”€โ”€ vendor

I have some sass files under vendor (i.e vendor/select2/select2.sass) that I used to just import directly from styles/app.sass, like this:

@import 'vendor/select2/select2'
@import 'vendor/select2/select2-bootstrap'

It worked great with ember-cli-sass, but breaks with ember-cli-compass-compiler/compass:

directory tmp/compass_compiler-tmp_cache_dir-98wbHwsq.tmp/assets
    error app/styles/app.sass (Line 3: File to import not found or unreadable: ../../vendor/select2/select2.

Now, I'm pretty sure this is related to the compass --sass-dir CLI command/option. Right now it's assumed to be app/styles. One possibility is to just move the sass stylesheets from vendor to a folder under app/styles, but I'd rather add vendor to the path. Is there a way to do it?

Thanks!

Compiler executing twice

Hi, I see that the compiler is executing twice, probably because it is detecting changes in the file twice.

file changed app.scss
file changed styles/app.scss

Build successful - 36872ms.

Slowest Trees                                 | Total               
----------------------------------------------+---------------------
CompassCompiler                               | 18394ms             
CompassCompiler                               | 16596ms             

Slowest Trees (cumulative)                    | Total (avg)         
----------------------------------------------+---------------------
CompassCompiler (2)                           | 34991ms (17495 ms)  

'ember-cli-sass-and-compass-compiler' should be the name for the repo

I think it will be a good idea to rename the repo to ember-cli-sass-and-compass-compiler, since it's the complete solution of Sass + Compass, not just compass. I initially didn't want to use this because I thought it was compass only, and I still needed to find a way for Sass. But then I read the note, and now I am using it.

Take a look at what I did to the readme with a fork here : https://github.com/ankushdharkar/ember-cli-sass-and-compass-compiler

Installed and ember build freezes

Using ember-cli 0.42. Compass 1.0.1 installed on my machine. I installed, and ember build/ ember serve freezes.

Is there a way to see a log/output of where the build process is stopping?

Mess with the pathes?

Hello, it become impossible to import scss files from bower directory after installation of ember-cli-compass-compile:

var app = new EmberApp({
  sassOptions: {
    includePaths: [
      'bower_components/foundation/scss'
    ]
  }
});
  @import "foundation/components/grid";
directory tmp/compass_compiler-tmp_cache_dir-JL7eUUbl.tmp/assets
    error app/styles/klx.scss (Line 3: File to import not found or unreadable: normalize.scss.
Load paths:
  Compass::SpriteImporter
  /Users/lessless/Code/ruby/klx-frontend/app/styles
  /Users/lessless/.gem/ruby/2.1.4/gems/compass-core-1.0.3/stylesheets)
Compilation failed in 1 files.

not targeting known entry points.

currently we compile the whole app/styles but I believe we care about specific entries points only. For example, given the app name of foo. I would expect to specific app/styles/foo.scss as the entry point:

compass compile --sass-dir=app/styles --css-dir=some-tmp-dir --output-style=expanded app/styles/foo.scss

but instead today we do

compass compile --sass-dir=app/styles --css-dir=some-tmp-dir --output-style=expanded

the later appears to treat each file as an entry point. This results in includes provided in foo.scss not being available to files it depends on as they may be processed before hand.

Blows up if project path has spaces

If I'm working in an Ember project whose path is /home/me/My Project/, running ember build results in Build failed. Command failed: Individual stylesheets must be in the sass directory.

I added some debugging info to compass.js, emitting the command at the end of generateCommand. It emits compass compile --sass-dir=app/styles --css-dir=/home/meMy Project/tmp/compass_compiler-tmp_cache_dir-GH0EYW48.tmp/assets --output-style=compressed. All paths should be quoted.

http://stackoverflow.com/questions/1779858/how-do-i-escape-a-string-for-a-shell-command-in-nodejs-v8-javascript-engine suggests using createChildProcess instead of exec, though that API is somewhat cumbersome. https://blog.liftsecurity.io/2014/08/19/Avoid-Command-Injection-Node.js suggests require('child_process').spawn, which accepts an Array of additional arguments, though that API is about as bad.

http://stackoverflow.com/questions/16395612/unable-to-execute-child-process-exec-when-path-has-spaces offers a simpler fix, though it's less robust. Simply run .replace(/ /g, "\\ ") on cssDir or sassDir.

Error in ember-cli-0.2-beta.1: app/styles/app.[scss|sass] does not exist

Hello!
Today I tried to update to ember-cli-0.2-beta.1 and encountered an error

ember serve
version: 0.2.0-beta.1
Livereload server on port 35729
Serving on http://0.0.0.0:4200/
Warning: ignoring input sourcemap for bower_components/route-recognizer/dist/route-recognizer.js because ENOENT, no such file or directory '/Users/lessless/Code/js/xk21/tmp/tree_merger-tmp_dest_dir-QCtdKlrH.tmp/bower_components/route-recognizer/dist/route-recognizer.js.map'
/Users/lessless/Code/js/xk21/tmp/compass_compiler-tmp_dest_dir-eO9F4tyq.tmp/app/styles/app.[scss|sass] does not exist

though i renamed xk21.scss to app.scss

I need a how-to tutorial

Can someone do up a quick how-to guide/tut? I cannot seem to get this ember-cli plugin working but It seem to be the only pluggin for ember-cli that supports ruby gem imports to scss. I am getting this error:

C:\Windows\system32\cmd.exe /s /c "compass compile --sass-dir=app/styles --css-dir='E:\Profile\*myEmberPath*\tmp\compass_compiler-tmp_cache_dir-iNNlyW42.tmp\assets' --output-style=compressed"  

I haven't placed anything in the broccfile for options so this is just what I'm getting by default. I have also made sure to remove broccoli-sass. Any help will be greatly appreciated.

Does not work with ember-component-css

Hi,

This is a great addon, however it doesn't work with https://github.com/ebryn/ember-component-css

Not sure if the issue is on this side or the ember-component-css side, you get the following error:

Compilation failed in 1 files.

Command failed: /bin/sh -c compass compile --sass-dir=app/styles --css-dir='/Volumes/Macintosh_HD/Users/shauncutts/src/xweaver/tmp/compass_compiler-tmp_cache_dir-7eOPZ5fB.tmp/assets' --output-style=compressed

Error: Command failed: /bin/sh -c compass compile --sass-dir=app/styles --css-dir='/Volumes/Macintosh_HD/Users/shauncutts/src/xweaver/tmp/compass_compiler-tmp_cache_dir-7eOPZ5fB.tmp/assets' --output-style=compressed

webark/ember-component-css#90

Any ideas?

Wrong output filename on Windows

0.3.2 doesn't really work on Windows ([email protected]):

            getDestinationPath: function (relativePath) {
                if (relativePath === path.join(this.destDir, fileName)) { return path.join(this.destDir, outputFileName); }
                return relativePath;
            }

relativePath gets "assets/app.css", while path.join(this.destDir, fileName) is "assets\app.css", equals test fails, and the final output filename is wrong (app.css), which breaks styling in the application, as the name should be my-app.css.

Unable to specify a compass.rb config file

Because we need http_images_path which isn't exposed over CLI, we want to use a compass.rb file to specify it.

You need to add a compassConfig option that takes a string of the path to the directory.

eg:

var app = new EmberApp({
  compassOptions: {
    compassCommand: 'rvm 2.0.0 do bundle exec compass',
    compassConfig: 'config/compass.rb'
  }
});

produces:

/bin/sh -c rvm 2.0.0 do bundle exec compass compile config/compass.rb --sass-dir=app/styles ...

Alternatively, if you think this is bogus, how do you suggest I use the http_images_path option?

Unable to load extension: compass-rails

I'm a bit confused why it's mentionning compass-rails but when I do an ember build it builds properly but I get these errors. I even tried installing gem install compass-rails but the error remains. ps(windows machine)

version: 0.1.2
node: 0.10.32
npm: 2.1.3
BuildingUnable to load extension: compass-rails
Unable to load extension: compass-rails
Unable to load extension: compass-rails
Unable to load extension: compass-rails
Unable to load extension: compass-rails
Unable to load extension: compass-rails
Unable to load extension: compass-rails
Unable to load extension: compass-rails
Unable to load extension: compass-rails
Unable to load extension: compass-rails
Unable to load extension: compass-rails
Unable to load extension: compass-rails

Doesn't follow outputsPath

I've got something like this in my Brocfile.js:

var app = new EmberApp({
  outputPaths: {
    app: {
      css: {
        'app': '/stuff/dyo.css'
      },
      js: '/stuff/dyo.js'
    },
    vendor: {
      css: '/stuff/vendor.css',
      js: '/stuff/vendor.js'
    }
  }
});

Everything BUT the app.css will build into dist/stuff. The app.css still goes to dist/assets.

Building LoadError on line ["126"] of C: cannot load such file -- susy

Any idea what this means?

version: 0.1.2
node: 0.10.32
npm: 2.1.3
Compass 1.1.0.alpha.3 (Polaris)
Sass 3.4.6 (Selective Steve)
version: 0.1.2
BuildingLoadError on line ["126"] of C: cannot load such file -- susy
Run with --trace to see the full backtrace


Build failed.
Command failed: LoadError on line ["126"] of C: cannot load such file -- susy
Run with --trace to see the full backtrace

Error: Command failed: LoadError on line ["126"] of C: cannot load such file -- susy
Run with --trace to see the full backtrace

    at ChildProcess.exithandler (child_process.js:648:15)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

Compass command setting for Bundler support?

broccoli-compass exposes a compassCommand that can be used to make it use bundler exec rather than a globally installed compass, as described here.

Is this also possible with this handy plugin?

To use the .sass format you need to hardcode the ext

Not sure how you want to handle this and am willing to submit a pull request. But in order to compile .sass files you need to hardcode the ext in the index.js file. There should be an easy way to toggle between .scss and .sass.

screen shot 2014-08-12 at 12 39 56 pm

Compile separated files?

Hi, I want to know if is possible to have something like app/styles/home.scss and having it compiled to dist/assets/home.css, without having to import it explicitly in app.scss

Error when initiating. Error at index.js:8

I have a clean slate project that i requierd the latest version of ember-cli-compass-compiler.

When i run ember server i get the error

Cannot read property 'included' of undefinedTypeError: Cannot read property 'included' of undefined

It crashes when it's trying to run this._super.included.apply(this, arguments); in the index.js file.

I've followed the instructions and can't figure out what the problem is.

Import errors with bootstrap-sass-official/other sass files.

The compiler is not playing nice with other sass files. When trying to import sass files from within app/styles or bower_components.

Here's the app.scss

@import "bower_components/bootstrap-sass-official/assets/stylesheets/_bootstrap";

@import "variables";
@import "mixins";
@import "base";
@import "dialer";

Error 1:

directory tmp/compass_compiler-tmp_cache_dir-ZxE1PHwf.tmp/assets
    error app/styles/app.scss (Line 1: File to import not found or unreadable: bower_components/bootstrap-sass-official/assets/stylesheets/_bootstrap.
Load paths:
  Compass::SpriteImporter
  /Users/shiftonestudios/projects/kandy-web/carrier/client/app/styles
  /Users/shiftonestudios/.rvm/gems/ruby-2.1.1@global/gems/compass-core-1.0.1/stylesheets)
    error app/styles/base.scss (Line 2: Undefined mixin 'font-smoothing'.)
    error app/styles/dialer.scss (Line 13: Undefined mixin 'square'.)
    write tmp/compass_compiler-tmp_cache_dir-ZxE1PHwf.tmp/assets/mixins.css
    write tmp/compass_compiler-tmp_cache_dir-ZxE1PHwf.tmp/assets/variables.css

This is fixable by prepending '../../' to bower_components.

Error 2: (After fixing the file import issue)

directory tmp/compass_compiler-tmp_cache_dir-uysU7rYc.tmp/assets
    write tmp/compass_compiler-tmp_cache_dir-uysU7rYc.tmp/assets/app.css
    error app/styles/base.scss (Line 2: Undefined mixin 'font-smoothing'.)
    error app/styles/dialer.scss (Line 13: Undefined mixin 'square'.)
    write tmp/compass_compiler-tmp_cache_dir-uysU7rYc.tmp/assets/mixins.css
    write tmp/compass_compiler-tmp_cache_dir-uysU7rYc.tmp/assets/variables.css

But I believe it still fails to load the files properly as I can't use any mixins included from _bootstrap.scss or from mixins.scss which resides in the same folder.

CSS gets minified twice

My production builds we're having the CSS minified by both Compass and broccoli-clean-css. This resulted in CSS that was broken for some Android phone. My solution was to use minifyCSS: { enabled: false } in my ember-cli-build.js file.

I think we should either disable ember-cli's default minification, or document the need to disable it manually in the README.

request for an example with imagesDir

I can't quite figure out how to configure this correctly. In my project, i have a few assets for example <appname>/public/assets/images/logo.png (the directory is up for debate, it's just, where i currently put my assets).

I guess, i'm asking where to put images or where to configure the images location. I tried this in my Brocfile.js in an ember-cli 0.1.1 project:

var app = new EmberApp({
    compassOptions: {
        outputStyle: 'expanded',
        require: ['sass-css-importer', 'susy'],
        imagesDir: 'public/assets/images',
        sourcemap: true
    }
});

this does not do the trick, it's running this command:

compass compile --sass-dir=app/styles --css-dir=C:\Users\<redacted>\<appname>\tmp\compass_compiler-tmp_cache_dir-rgYAA8qu.tmp\assets --output-style=expanded --require=sass-css-importer --require=susy --time --images-dir=assets/images --sourcemap --http-path=/assets/directory tmp/compass_compiler-tmp_cache_dir-rgYAA8qu.tmp/assets

And cancels with this error:

error app/styles/app.scss (Line 61 of app/styles/layout/_base.scss: Could not find aside-alerts-sprite.png in C:/Users/<redacted>/<appname>/assets/images)
Compilation failed in 1 files.

compass compile never finishes / incompatible with compass-rails

If you come to this place to find a problem with ember-cli-compass-compiler, i hope to save you some time. The problem appears to be somewhere completely different.

If your compass compile never returns, but instead keeps your CPU occupied until you hit Ctrl+C, then this might be your problem: Compass/compass-rails#185

The only known solution seems to be to uninstall the compass-rails plugin for now. This fixed my problem immediately.

Is it supposed to be that slow?

I'm trying to make compass and bootstrap work together and it seems like it takes >20 seconds to compile just plain bootstrap:

CompassCompiler (1)                           | 22575ms 

What would be normal compilation time?

Besides that, I observe errors that weren't there before (when I used ember-cli-sass):

    error app/styles/components/affix-panel.sass (Line 2: Undefined variable: "$screen-sm-max".)
    error app/styles/components/highlight.sass (Line 2: Undefined variable: "$brand-warning".)
...
    error app/styles/components/simple-sorter.sass (Line 3: Undefined variable: "$brand-primary".)
...
Compilation failed in 3 files.


Command failed: /bin/sh -c compass compile --import-path=bower_components/bootstrap-sass/assets/stylesheets --output-style=compressed --sass-dir=app/styles --css-dir="/Users/youroff/Documents/projects/autocloud/client/tmp/compass_compiler-output_path-2S225DUF.tmp/assets"

I tried to launch this command and it only shows > as if it was expecting some input. Compass version is 1.0.3.

UPD: Seems like it renders separate CSS files, is there some setting to tell it building one file?
UPD2: Probably the key is here: Other .scss files in app/styles are compiled as well. What's the workflow for splitting styles into importable pieces then?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.