Coder Social home page Coder Social logo

sass-brunch's Introduction

sass-brunch Build Status

Adds Sass support to Brunch.

Usage

Install the plugin via npm with npm install -S sass-brunch.

Options

Set additional include paths:

includePaths: ['node_modules/foundation/scss']

Use custom functions (only synchronous functions are supported):

var types = require('sass').types
module.exports = {
  plugins: {
    sass: {
      functions: {
        'example($foo, $bar)': function(foo, bar) {
          return new types.String("I'm an example")
        }
      }
    }
  }
}

CSS Modules

Starting Brunch 2.6.0, you can use CSS Modules with css-brunch. To enable it, change your config to:

module.exports = {
  // ...
  plugins: {
    sass: {
      modules: true
    }
  }
};

You can also pass options directly to postcss-modules:

generateScopedName: '[name]__[local]___[hash:base64:5]'

Then, author your styles like you normally would:

.title {
  font-size: 32px;
}

And reference CSS class names by requiring the specific style into your javascript:

var style = require('./title.scss');

<h1 className={style.title}>Yo</h1>

Note: enabling cssModules does so for every stylesheet in your project, even the files you don't require will be transformed into CSS modules (aka will have obfuscated class names, like turn .title into ._title_fdphn_1).

You must use the ignore option to specifically opt out of files or directories where you don't want to use cssModules.

The ignore option takes an array of matches. Anymatch is used to handle the matching. See the anymatch documentation for more information.

module.exports = {
  // ...
  plugins: {
    sass: {
      modules: {
        ignore: [/file\.css/, /some\/path\/to\/ignore/]
      }
    }
  }
};

License

The MIT License (MIT)

sass-brunch's People

Contributors

aheuermann avatar altmind avatar bdtomlin avatar beaulac avatar blakewilliams avatar blimmer avatar clkao avatar denysdovhan avatar dependabot[bot] avatar dlepaux avatar es128 avatar fujimura avatar goshacmd avatar grahamlyus avatar izb avatar jacwright avatar jkruse avatar joar avatar josevalim avatar juggy avatar kenpratt avatar kyleamathews avatar lydell avatar meleyal avatar paulmillr avatar pixievoltno1 avatar razor-x avatar realistschuckle avatar shvaikalesh avatar yavorsky 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sass-brunch's Issues

About sass-brunch 1.8.6

Hey

Today I tried to used sass-brunch 1.8.6 with brunch 1.7.18 so when I run npm install my terminal and my computer freezed after showing the following message :

> [email protected] install c:\wamp\www\projects\brunch-with-hyyan\node_modules\sa
ss-brunch\node_modules\node-sass
> node build.js

`win32-x64-v8-3.14` exists; testing

I've tried again and again and I still get the same results .

Here is my package.json file :

{
    "author": "Your Name",
    "name": "package-name",
    "description": "Package description",
    "version": "0.0.1",
    "homepage": "",
    "repository": {
        "type": "git",
        "url": ""
    },
    "engines": {
        "node": "~0.6.25 || 0.8 || 0.9"
    },
    "scripts": {
        "start": "brunch watch --server",
        "test": "brunch test"
    },
    "dependencies": {
         "sass-brunch": "1.8.6",
        "javascript-brunch": ">= 1.0 < 1.8",
        "css-brunch": ">= 1.0 < 1.8",
        "uglify-js-brunch": ">= 1.0 < 1.8",
        "clean-css-brunch": ">= 1.0 < 1.8",
    "auto-reload-brunch":">= 1.0 < 1.8"
    },
    "devDependencies": {}
}

Any Idea why ? Thanks

How do I include a compass mixin

Hi there. Sorry if this is a dumb question but I can't work out how to include a compass mixin in my styles. I've tried a variety of paths but I just keep getting this error

@import "compass/css3";

- error: SassCompiler failed in 'app/styles/style.scss' -- Compile error: Syntax error: File to import not found or unreadable: compass/css3.

Could someone please point me in the right direction?
Thanks in advance.

getDependencies does not respect sass load paths

For example, given this folder structure:

.
├── app
│   ├── bundles
│   │   └── bundle.sass
│   └── components
│       └── _component.sass
└── brunch-config.coffee

, have this in the bundle.sass:

@import "app/components/component"

and this in the brunch-config.coffee:

files:
  stylesheets:
    joinTo:
      "static/app.css": /^app\/bundles\/bundle\.sass$/

the app.css doesn't get recompiled on _component.sass change. It also doesn't get recompiled if I add some load path to sass and make import path in bundle.sass relative to it. But everything is ok if import path is "../components/component".

I add some debugging to getDependencies function in sass-brunch and it's third argument (callback) is being called with:

{ '0': null,
  '1': 
   [ 'app/bundles/app/components/component.sass',
     'app/bundles/app/components/_component.sass',
     'app/bundles/app/components/component.scss',
     'app/bundles/app/components/_component.scss' ] }

Not sure is it sass-brunch usage of progeny issue or progeny issue itself, but it would be nice to have this working properly.

v1.7.2 breaks on windows

was working fine uptil v1.7.0 but got the same error #33 when started using v1.7.2 . I tried pulling the code from github and it works great. so i guess a 1.7.3 update will help solve the problem. Thanks!

error: CreateProcessW: The system cannot find the file specified under windows

Hi, I'm getting an issue running a project that was created on OSX under windows. I get the following error when I run 'brunch build' or 'brunch watch':

error: SassCompiler failed in 'app\test.scss' -- Compile error: CreateProcessW: The system cannot find the file specified.

This is a test scss file that doesn't have any imports, only sets a background colour on the body so there's nothing complicated going on in there.

It works lovely on OSX :)

Compile error on a file which does not return CSS

Hello,

I have the same error as issue #68 :

/usr/local/lib/node_modules/brunch/lib/fs_utils/pipeline.js:78
          throw new Error("Brunch SourceFile: file " + path + " data is invali
                ^
Error: Brunch SourceFile: file my_file.scss data is invalid
  at /usr/local/lib/node_modules/brunch/lib/fs_utils/pipeline.js:78:17
  at libsass.render.success (/home/samuel/www/braincracking/supv/www/node_modules/sass-brunch/index.js:99:7)
  at options.success (/home/samuel/www/braincracking/supv/www/node_modules/sass-brunch/node_modules/node-sass/lib/index.js:163:7)

But this issue is closed, so I open a new.

It seems that brunch expects a string as a compile result, but Sass send an object.
The file which cause that does not output CSS, it define a variable and a function or mixin, and in sass-brunch/index.js:97, we use if (data.css) data = data.css but data.css is an empty string.

I could fix it by changing with if ('css' in data) data = data.css but it will disappear when I'll do an update with NPM.

To conclude : if you want, I can make a pull request with this little fix, or maybe this performs is wanted. In this case, do you have a solution for me ?
Thank's in adance !

Compass not found error

Tried with v1.7.2 , i am getting compass not found error.
Later downloaded code from your github which seems to work fine.
Also version v1.7.0 is also working fine.
We tried to find the cause of the problem, it seems like this.compass is always false even if compass available.
Update the npm registry with 1.8 version of the module

Install fails on Windows 8

When trying to install the newest sass-brunch it appears that I get an error. The error seems to be with the node-sass package. So I tried to install that manually, and it seems that the newest version of node-sass installs fine (version 2.0.1).

How about upgrading this package for better support on the windows platform? Sorry I don't have a PR, as I do not feed competent enough in node (yet) to actually push changes.

npm install --save sass-brunch
npm WARN package.json [email protected] No README data
\
> [email protected] install C:\Users\ME\Documents\Code\project_name\node_modules\sass-brunch\node_modules\node-sass
> node scripts/install.js

Binary downloaded and installed at C:\Users\ME\Documents\Code\project_name\node_modules\sass-brunch\node_modules\node-sass\vendor\win32-x64\binding.node

> [email protected] postinstall C:\Users\ME\Documents\Code\project_name\node_modules\sass-brunch\node_modules\node-sass
> node scripts/build.js

`win32-x64` exists; testing
module.js:355
  Module._extensions[extension](this, filename);
                               ^
Error: The specified procedure could not be found.
C:\Users\ME\Documents\Code\project_name\node_modules\sass-brunch\node_modules\node-sass\vendor\win32-x64\binding.node
    at Error (native)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\Users\ME\Documents\Code\project_name\node_modules\sass-brunch\node_modules\node-sass\lib\index.js:181:15)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "sass-brunch"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\ME\Documents\Code\project_name\npm-debug.log

Brunch hangs with sass-brunch 1.8.3

Brunch started sporadically hanging for me after upgrading from sass-brunch 1.7.0 to 1.8.3.

Were there any changes that might cause this behavior?

This is my brunch config:
https://github.com/codecombat/codecombat/blob/master/config.coffee

This is the last thing I see when running brunch --debug:

brunch:pipeline getDependencies 'app/styles/play/world-map-view.sass' with 'SassCompiler' +56ms
brunch:file-list Compiled file 'app/styles/play/world-map-view.sass'... +57ms

Compiling fails with [object Object]

Newer versions of node-sass return an object on error as opposed to just a message, resulting in stacktraces like this:

error: Compiling of 'app/styles/production.scss' failed. [object Object]

You can see a test where they expect this here and note that gulp-sass also saw and resolved this issue.

Compass not being detected

Trying to get bootstrap-sass into a project. At one point it was compiling fine. Now I can't get passed the error error: Compiling of 'app/styles/app.sass' failed. Syntax error: File to import not found or unreadable: bootstrap.

Simply running sass --compass app/styles/app.sass works as intended.

Adding console.log('Compass exists: ' + !error); in the compassPromise outputs Compass exists: true, but the --compass flag isn't being added to the command.

Explicitly adding the flag to brunch-config.coffee works.

  plugins:
    sass:
      options: ['--compass']

Files with imports not being regenerated upon changes in dependencies

I'm not sure if this is the same as issue #1, but brunch watch does not seem to recompile any of my sass files that contain @imports when the imported files change.

For example, if I have the directory structure:

└── inner
│     └── inner.scss
└── outer.scss

and outer.scss contains the following:

@import 'inner/inner.scss'

if I were to change 'inner/inner.scss', outer.scss does not get regenerated (continues to contain the old imported code). Not sure if I'm doing something wrong, but I can't seem to find any similar issues online. Any insights/help would be greatly appreciated!

sass multiple target

Hello,

I can't figure how tweak my config.coffeein order to achieve something as describe here http://jakearchibald.github.io/sass-ie/

I would like to have 2 separates sass files (styles.css and styles-ie.css)

    stylesheets:
      defaultExtension: 'scss'
      joinTo:
        'css/styles.css': /^scss\/styles.scss/
        'css/styles-ie.css': /^scss\/styles-ie.scss/
      order:
        before: ['bower_components/normalize-css/normalize.css']

But I only have a styles.css
thanks.

plugins.sass Mandatory?

Don't know if this is a Brunch issue or a sass-brunch issue bu after upgrading from brunch 1.7.1 to 1.7.10 running brunch results in:

this.config.plugins.sass.useBundler

TypeError: Cannot read property 'useBundler' of undefined

unless I have a 'sass' key in my config.coffee under plugins.

Is this a bug or my own fault somehow?

Support for Compass plugins?

Hey guys-

Should sass-brunch support Compass plugins? For instance, I'm trying to use the 'fancy-buttons' plugin, which is a gem in it's own right. Based on comments I found in an old PR, I created a compass.config file in the root of my brunch project, and tried requiring the 'fancy-buttons' gem in the config file, so that Compass would be able to build with it. However, that didn't work.

Is there support for this at the moment? If so, what am I doing wrong? If not, I might try implementing it and create a PR...

Thanks, loving your work.

Tom

Cannot pass CLI arguments to compass compiler

I am trying to nestle in development vs. production options in my compass config file and I need to pass compass command line arguments telling it which environment to use when compiling.

I've made a bit of progress figuring how to trigger different environments from the CLI with brunch using --env and specifying overrides sections in my config.coffee. I'm passing arguments per the compass documentation here: http://compass-style.org/help/tutorials/configuration-reference/ in the "Inspecting Configuration Settings passed via the Command Line" section.

overrides:
    development:
      plugins:
        sass:
          options: ['-e', 'development', '--force']
    production:
      plugins:
        sass:
          options: ['-e', 'production', '--force']

  plugins:
    sass:
      options: ['--compass']
      mode: 'ruby'

Now when I try to build, though, it doesn't appear to like the parameters I'm trying to pass to compass. I'm getting this error:

C:\Git\myProject>brunch build --env development
29 May 16:04:51 - error: Compiling of 'app\sass\header.scss' failed. C:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/exec.rb:41:in `parse': invalid option: -e (OptionParser::InvalidOption)
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/exec.rb:22:in `parse!'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/sass-3.3.7/bin/sass:13:in `<top (required)>'
        from C:/Ruby200/bin/sass:23:in `load'
        from C:/Ruby200/bin/sass:23:in `<main>'

Any idea why passing this argument isn't getting through to Compass?

UPDATE:
If I remove mode: 'ruby', it compiles with no error, but is not using the compass configuration at all.

change to allow custom gem_home breaks default case

The process.env clone in a0b3dec isn't working right for me.

You need to have Sass on your system
Execute `gem install sass`

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
  at errnoException (child_process.js:945:11)
  at Process.ChildProcess._handle.onexit (child_process.js:736:34)

User-defined --no-cache option

Why do the --no-cache option is always passed to sass in ruby mode?

Without cache compiling even medium-sized styles takes way too long. For example compiling Foundation takes almost 4.5 seconds on my i7 3820!

$ rm -rf .sass-cache
$ for ((i=0;i<3;i++)) time sass --no-cache bower_components/foundation/scss/foundation.scss /dev/null
sass --no-cache bower_components/foundation/scss/foundation.scss /dev/null  4.29s user 0.01s system 99% cpu 4.306 total
sass --no-cache bower_components/foundation/scss/foundation.scss /dev/null  4.29s user 0.02s system 99% cpu 4.315 total
sass --no-cache bower_components/foundation/scss/foundation.scss /dev/null  4.29s user 0.02s system 99% cpu 4.316 total

Note that it is not just first run, every single partial update will be result in entire styles recompilation and huge delay.

With cache less than 1 second:

$ rm -rf .sass-cache
$ for ((i=0;i<3;i++)) time sass bower_components/foundation/scss/foundation.scss /dev/null
sass bower_components/foundation/scss/foundation.scss /dev/null  1.71s user 0.02s system 99% cpu 1.726 total
sass bower_components/foundation/scss/foundation.scss /dev/null  0.80s user 0.01s system 99% cpu 0.809 total
sass bower_components/foundation/scss/foundation.scss /dev/null  0.80s user 0.01s system 99% cpu 0.811 total

Still rather slow but I can deal with it.

Yeap, I know about libsass but I need to compile .sass files and libsass don't support it currently.

How about making this option user-defined via common options array?

"gem_home" is ignored

I tried sass-brunch 1.7.2 but it doesn't work.
gem_home is always ignored.

In my env, gems are already isntalled in ./gems and removed sass and compass by gem uninstall.
I added this to my brunch-config.coffee

  plugins:
    sass:
      gem_home: './gems'

And I embeded console.log before child_process.exec to dump args and run.

$ brunch build
...
./gems/bin/sass --version { env: 
   [...
     GEM_HOME: './gems' ] }

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: write EPIPE
    at errnoException (net.js:901:11)
    at Object.afterWrite (net.js:718:19)

Now I use sass-brunch 1.6.1. It works.

Support sass syntax with libsass

I have .sass files with indented syntax. sass-brunch fails to build them properly because it thinks that they are scss files:

error: Compiling of 'foo.sass' failed. invalid top-level expression

Is there a switch or option to fix this?

eliminate ruby dependency

Opening this issue just to gage interest.

It would be possible to create an alternate version of this plugin using node-sass/libsass, thereby eliminating the need to install ruby and the sass gem in order to compile sass/scss with brunch.

A node-sass version would resolve problems with compilation slowness and things like using brunch on heroku as described in #5 (comment).

However, the massive drawback is that it would not support compass at this point (see sass/libsass#82). It apparently would support bourbon.

Are there enough people using sass without compass (with brunch) to make this worthwhile?

Is it perhaps worth trying to roll the additional node-sass dependency into this same plugin and using it automatically when compass is not being utilized?

Please comment with any thoughts or +1s.

Error with node-sass 2.0.0

Hi, you will have to update your plugin to node-sass 2.0.0 (still in beta), it's broken.
Here is the error log:

brunch w

C:\[...]\node_modules\brunch\lib\fs_utils\pipeline.js:78
          throw new Error("Brunch SourceFile: file " + path + " data is invali
                ^
Error: Brunch SourceFile: file admin\admin-app.scss data is invalid
  at C:\[...]\node_modules\brunch\lib\fs_utils\pipeline.js:78:17
  at libsass.render.success (C:\[...]\node_modules\sass-brunch\index.js:96:7)
  at options.success (C:\[...]\node_modules\node-sass\lib\index.js:169:7)

Slow compile when using includePaths

When i use includePaths to add some paths for both Bootstrap and Foundation, I get an average of 2 sec compile time, where if I just add the files to my main.scss with relative paths to the Bower_components time drops to 300ms (talking about the Foundation.scss and Bootstrap.scss main files).

ERROR: Cannot load compass

Hi,
when I build my project, i get no errors

  brunch:file-list Compiled file 'app/views/scss/player/player.scss' +1ms
  brunch:file-list Compiled file 'app/views/scss/pages/pages_edit.scss' +0ms
  brunch:file-list Compiled file 'app/views/scss/pages/pages_edit_settings.scss' +4ms
  brunch:file-list Compiled file 'app/views/scss/pages/page_followers.scss' +6ms

but the build process kind off "ignores" my scss files and afterwards I find this in my css code:

ERROR: Cannot load compass.
ERROR: Cannot load compass.
ERROR: Cannot load compass.
ERROR: Cannot load compass.
ERROR: Cannot load compass.
ERROR: Cannot load compass.
ERROR: Cannot load compass.
ERROR: Cannot load compass.

compilation works fine on OSX and Linux, but this problem occurs on a FreeBSD Server

How to make it use config.rb?

Hello,

sass-brunch looks like an awesome plugin, however I am having trouble trying to make it use compass with configuration in config.rb file.
I have created a config.rb file in the root of my project with this inside:

images_dir = "somedir"

And I am trying to use this property inside my sass stylesheet:

background-image: image-url('preloader.gif')

I am getting this brunch error:

error: Compiling of 'app/views/styles/application.sass' failed. WARNING: 'preloader.gif' was not found (or cannot be read) in ./images

Seems like it's not reading my config.rb file. When I make any change and save the config.rb file, nothing happens in my brunch watch terminal window - it's not registering changes in config.rb.

I am sure it's finding compass ok because I can use @import "compass/css3" in my stylesheet and have all mixins available.

How can I include config.rb on brunch's watchlist?

Thanks for the help!

Sass won't keep variables across files

I have this structure

app.scss

@import "_variables";
@import "_test";

_variables.scss

$test-variable: #333;

_test.scss

input { 
  color: $test-variable;
}

They are all in the same folder and are in app/styles/

If i run on the terminal:
$> sass app.scss
it works.

But if i run brunch

$> ./scripts/development.sh

the compile fails with :

12 Jan 19:32:42 - error: Compiling of 'app/styles/_test.scss' failed. source string:2: error: unbound variable $test-variable

TypeError: Cannot call method 'concat' of null

When pushing to heroku I get this error during the brunch build

       /tmp/build_1927ad1c753fbdb6d17b400dc8175ccd/node_modules/sass-brunch/node_modules/progeny/lib/index.js:58
               return flat.concat(val, []);
                           ^
       TypeError: Cannot call method 'concat' of null

but building locally works just fine

Closed socket

Hi,

I'm using sass-brunch in a project. When installed, brunch watch --server fails to start with the following error generated by sass-brunch :

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: This socket is closed.
    at Socket._write (net.js:635:19)
    at doWrite (_stream_writable.js:221:10)
    at writeOrBuffer (_stream_writable.js:211:5)
    at Socket.Writable.write (_stream_writable.js:180:11)
    at Socket.write (net.js:613:40)
    at execute (d:\projects\test-project\node_modules\sass-brunch\lib\index.js:114:22)
    at delay [as _onTimeout] (d:\projects\test-project\node_modules\sass-brunch\lib\index.js:124:16)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

If I uninstall sass-brunch, everything is fine again. Any idea ?

npm install does not work due to sinon install issue

Hi all, I'm new to using SASS and am trying to include it into my existing Node EmberJS project. I have added:

"sass-brunch": "1.8.1" to my package.json

when I run npm install, I get the following error. Could someone shed some light? I'm not sure what is wrong trying to grab this dependency. I am using Windows 7 with Brunch master branch.

...
...
npm http 304 https://registry.npmjs.org/sinon
npm ERR! Error: No compatible version found: sinon@'^1.9.1'
npm ERR! Valid install targets:
npm ERR! ["0.6.2","0.6.3","1.0.0","1.0.1","1.0.2","1.1.0","1.1.1","1.2.0","1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.4.0","1.4.1","1.4.2","1.5.0","1.5.2","1.6.0","1.7.0","1.7.1","1.7.2","1.7.3","1.8.1","1.8.2","1.9.0","1.9.1","1.10.0"]
npm ERR!     at installTargetsError (C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.js:719:10)
npm ERR!     at C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.js:641:10
npm ERR!     at saved (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.js:138:7)
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Git\e2c-client
npm ERR! node -v v0.10.12
npm ERR! npm -v 1.2.32
npm http 200 https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz
npm http 304 https://registry.npmjs.org/chalk
npm http 304 https://registry.npmjs.org/node-watch
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Git\e2c-client\npm-debug.log
npm ERR! not ok code 0

Also, I want to use compass, but not sure where to specify the config file - is there any documentation on this? Thanks!

SASS passed through?

Hi, somehow after installing sass-brunch Brunch isn't recognizing sass or scss. This is what I got with a sass file:

>> 04 Dec 03:10:24 - error: Compiling of 'options.sass' failed. Can't parse CSS: missing '{' near line 33:1

And I thought something was wrong with my sass (which is valid after all) so I thought converted it into scss with a converter. This error ensues:

>> 04 Dec 03:16:44 - error: Compiling of 'options.scss' failed. Can't parse CSS: missing '}' near line 4:3

Apparently, the sass/scss file isn't being passed through sass-brunch. Anyone has any idea why that is? Thank you for your help.

brunch v1.7.12
sass-brunch v1.7.2

different path option for scss file

Hello,

I'm not sure if it sass-brunch or brunch related.
I would like to put my scss file in a /scss folder, in the same dir than /app

For now it's working with the following /app/scss but I would like to know if it possible to fit my own organization

thanks

Changes to dependencies fail to rebuild parents when using multi-line @import

I am using sass-brunch 1.8.1.

As reported in my comment to #47, if I run brunch as follows:

DEBUG=brunch:* brunch watch

I get the following output if I touch app.scss:

brunch:pipeline Reading 'app/styles/app.scss' +14s
  brunch:watch File 'app/styles/app.scss' received event 'change' +14s
  brunch:pipeline Linting 'app/styles/app.scss' +0ms
  brunch:pipeline Compiling 'app/styles/app.scss' with 'SassCompiler' +0ms
  brunch:pipeline getDependencies 'app/styles/app.scss' with 'SassCompiler' +64ms
  brunch:file-list Compiled file 'app/styles/app.scss'... +14s
  brunch:generate Concatenating app/styles/app.scss to public/css/app.css +14s
  brunch:common Writing file 'public/css/app.css' +14s
  brunch:common Writing file 'public/css/app.css.map' +2ms
12 Mar 09:10:04 - info: compiled app.scss into app.css in 139ms

However if I touch ``_variables.scss` which is imported by app.sccs, all I see is this:

  brunch:file-list Compiling dependency 'app/styles/_variables.scss' parent(s) +5.0m
  brunch:watch File 'app/styles/_variables.scss' received event 'change' +5.0m

As can be seen by the debug trace the parents are not being compiled, it looks like sass-brunch hasn't correctly established the inverse dependencies. I have also verified that the problem exists on multiple systems, ie multiple OS X and Linux variants so it does not appear specific to any particular development environment.

I am very surprised that this doesn't work as it currently renders brunch a non solution for me.

Node-sass 0.9.3 break the build

With sass-brunch 1.8.2, when I run brunch w, I got this error

node: ../node_modules/nan/nan.h:1725: bool _NanGetExternalParts(v8::Handle<v8::Value>, const char**, size_t*): Assertion `val->IsString()' failed.

After downgrade to 1.8.1, the error is gone.

According to here, this should be a bug in node-sass.

chain compilation doesn't seem to work for multiple imports

Hi,
so the chain compilation #1 works just fine for one line imports like this:

@import "general";
@import "topbar";
@import "welcome";

but it seems it broke when I switched to multiple line imports:

@import
  "general_settings",
  "topbar",
  "welcome";

Changes in those '_whatever' files do get recompiled when I kill and restart brunch, but don't get caught by brunch watch. I solved my problem by coming back to the first import form, but it took me a while to get where my non-reactive css problems were coming from. Any easy fix for that?

Improve sass compilation time

continued from brunch/brunch#532

It still appears to me that the sass gem is mostly at fault here, but maybe something can be done. Running sass's watch in parallel with brunch's instead of compiling each file on demand is an interesting idea that could be explored.

node-sass version

Good day! node-sass has been updated with new features. What about working with new version?

Strange Behavior

I am trying to use compass with this plugin but I keep getting strange behavior when compass is involved

Some configs is read from config.rb while other is ignored

here is my config.rb file:

add_import_path "bower_components/bootstrap-sass-official/assets/stylesheets"
require 'compass/import-once/activate'
# Require any additional compass plugins here.


# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "public/css"
images_dir = "public/images"
javascripts_dir = "public/js"
fonts_dir = "public/fonts"


# You can select your preferred output style here (can be overridden via the command line):
output_style = :compressed

# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = false

# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = true

# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass

Now the following configs is read:

add_import_path "bower_components/bootstrap-sass-official/assets/stylesheets"
require 'compass/import-once/activate'
# Require any additional compass plugins here.


# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "public/css"
images_dir = "public/images"
javascripts_dir = "public/js"
fonts_dir = "public/fonts"

And the rest of file is ignored ?!

Here is my brunch config file :

exports.config =
  # See http://brunch.io/#documentation for docs. 
  paths:
    public: 'public'

  plugins:
    autoReload:
      enabled: true
    sass:
      options: ['--compass']
  files:
    javascripts:
      joinTo:
        'js/app.js': /^(app[\\/]scripts)/
        'js/vendor.js': /^(vendor|bower_components)/

    stylesheets:
      joinTo: 
        'css/app.css': /^((app[\\/]styles(?!-rtl))|bower_components|vendor)/
        'css/app-rtl.css': /^(app[\\/]styles-rtl)/

  modules:
     wrapper: false
     definition: false

  conventions:
     # we don't want javascripts in asset folders to be copied like the one in 
     # the bootstrap assets folder
     assets: /assets[\\/](?!javascripts)|bower_components[\\/]bootstrap-rtl[\\/]dist/

  # this option will disable sass --debug-info option
  minify: true


Any idea ? Thanks

File to import not found or unreadable: compass.

The issue

I can't get @import "compass"; to work with the current 1.7.2 version of sass-brunch using the system ruby, or rbenv managed ruby.

The 1.4.2 version does not have this same issue. Compass is found and compiles properly.

On a dead-simple install with nothing but this sass-brunch plugin 1.7.2 added, and @import "compass"; added to the app/style.scss file, an error is generated on brunch build

Compiling of 'app/style.scss' failed. Syntax error: File to import not found or unreadable: compass.

Steps to reproduce
brunch new gh:brunch/dead-simple project-ds
cd project-ds
gem install sass
gem install compass
npm install --save sass-brunch
echo "@import \"compass\";" >> app/style.scss
brunch b
My Result
error: Compiling of 'app/sass/style.scss' failed. Syntax error: File to import not found or unreadable: compass.

Load paths:
                /Users/user/Documents/Projects/project-ds
                /Users/user/Documents/Projects/project-ds
                /Users/user/Documents/Projects/project-ds/app/sass
        on line 1 of standard input
Environment
which compass && compass -v
/Users/user/.rbenv/shims/compass
Compass 0.12.2 (Alnilam)  

which ruby && ruby -v
ruby: aliased to bundled_ruby  
ruby 1.9.3p484

Mac OSX 10.9 Installed fresh immediately before adding homebrew, rbenv, node, brunch, and sass-brunch.

Might be related to issue 31 https://github.com/brunch/sass-brunch

Using @import

To share variables/mixins between files with sass you need to use an @import. E.g. in app.scss you might have:

@import 'variables';
@import 'mixins';
@import 'base';
@import 'layout';
...

Is there any way to tell Brunch just to include the app.scss file (the 'manifest') and let sass handle combining the files?

I already tried this in config.coffee:

stylesheets:
  defaultExtension: 'scss'
  joinTo:
    'stylesheets/app.css': /^styles\/app/

Compiling error on node v0.10.11

On node v0.10.11 I get some compiling errors that don't make any sense. The code is correct and the same project compiles just fine on node v.0.9.9

18 Jun 11:59:11 - error: Compiling of 'app/components/app/views/styles/application.scss' failed. Syntax error: Invalid CSS after "...color: #FF6600;": expected "}", was ""
    on line 447 of standard input
Use --trace for backtrace.
; Compiling of 'app/components/lyrics/views/styles/syncatore-webapp-theme.scss' failed.  Syntax error: Invalid CSS after "#sync": expected "{", was ""
    on line 132 of standard input
Use --trace for backtrace.

This socket is closed error

I am trying to use sass-brunch in this skeleton https://github.com/hyyan/brunch-with-ionic , but I keeb getting the following error

$ brunch watch --server
07 Mar 07:54:19 - info: application started on http://localhost:3333/

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: This socket is closed.
  at Socket._write (net.js:635:19)
  at doWrite (_stream_writable.js:223:10)
  at writeOrBuffer (_stream_writable.js:213:5)
  at Socket.Writable.write (_stream_writable.js:180:11)
  at Socket.write (net.js:613:40)
  at execute (c:\wamp\www\mobile\GWA\assets\node_modules\sass-brunch\lib\index.j
s:114:22)
  at [object Object].delay [as _onTimeout] (c:\wamp\www\mobile\GWA\assets\node_m
odules\sass-brunch\lib\index.js:124:16)
  at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

Any idea will be helpful , thanks in advance

'--sourcemap' flag does not seem to work

Trying to use the following option in brunch-config.coffee:

  plugins:
    sass:
      options: ['--sourcemap']

.. but get the error Can't generate a sourcemap for an input without a path. Is this unsupported? Am I missing something in config? My installed version of Sass is 3.3rc1, I'm using sourcemaps with grunt-contrib-sass, so the gem is right.

Is sass-brunch 1.7.2 published correctly?

Specify sass-brunch version,

"sass-brunch": "~1.7.2",
$ rm -rf node_modules/sass-brunch
$ npm install
npm http GET https://registry.npmjs.org/sass-brunch
npm http 304 https://registry.npmjs.org/sass-brunch
npm http GET https://registry.npmjs.org/progeny
npm http 304 https://registry.npmjs.org/progeny
npm http GET https://registry.npmjs.org/async-each
npm http 304 https://registry.npmjs.org/async-each

> [email protected] postinstall /Users/banyan/foo/bar/node_modules/static-jade-brunch
> node setup.js postinstall

npm WARN package.json [email protected] 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
[email protected] node_modules/sass-brunch
└── [email protected] ([email protected])

sass-brunch is installed as 1.7.2 but it's a bit weird. version is 1.7.2, yet coffee compiled script is there.

"sass-brunch": "brunch/sass-brunch",

When I fetch from github, it works fine and there's no js file compiled from coffee. also code is same as current master.

DEV banyan ☁  rm -rf node_modules/sass-brunch
DEV banyan ☁  npm install
npm http GET https://registry.npmjs.org/sass-brunch
npm http 304 https://registry.npmjs.org/sass-brunch
npm http GET https://registry.npmjs.org/progeny
npm http GET https://registry.npmjs.org/node-sass
npm http GET https://registry.npmjs.org/promise
npm http 304 https://registry.npmjs.org/progeny
npm http 200 https://registry.npmjs.org/promise
npm http GET https://registry.npmjs.org/promise/-/promise-3.2.0.tgz
npm http 200 https://registry.npmjs.org/promise/-/promise-3.2.0.tgz
npm http 200 https://registry.npmjs.org/node-sass
npm http GET https://registry.npmjs.org/node-sass/-/node-sass-0.7.0.tgz
npm http 200 https://registry.npmjs.org/node-sass/-/node-sass-0.7.0.tgz
npm http GET https://registry.npmjs.org/async-each
npm http 304 https://registry.npmjs.org/async-each
npm http GET https://registry.npmjs.org/node-watch
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/colors/0.6.0-1
npm http GET https://registry.npmjs.org/mocha
npm http 200 https://registry.npmjs.org/colors/0.6.0-1
npm http GET https://registry.npmjs.org/colors/-/colors-0.6.0-1.tgz
npm http 200 https://registry.npmjs.org/colors/-/colors-0.6.0-1.tgz
npm http 200 https://registry.npmjs.org/mkdirp
npm http 200 https://registry.npmjs.org/node-watch
npm http GET https://registry.npmjs.org/node-watch/-/node-watch-0.3.4.tgz
npm http 200 https://registry.npmjs.org/mocha
npm http 200 https://registry.npmjs.org/node-watch/-/node-watch-0.3.4.tgz
npm http 200 https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/minimist
npm http GET https://registry.npmjs.org/commander/0.6.1
npm http GET https://registry.npmjs.org/growl
npm http GET https://registry.npmjs.org/jade/0.26.3
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/diff/1.0.7
npm http GET https://registry.npmjs.org/glob/3.2.3
npm http 200 https://registry.npmjs.org/jade/0.26.3
npm http GET https://registry.npmjs.org/jade/-/jade-0.26.3.tgz
npm http 200 https://registry.npmjs.org/wordwrap
npm http 200 https://registry.npmjs.org/minimist
npm http 200 https://registry.npmjs.org/commander/0.6.1
npm http GET https://registry.npmjs.org/commander/-/commander-0.6.1.tgz
npm http 200 https://registry.npmjs.org/growl
npm WARN package.json [email protected] No repository field.
npm http 200 https://registry.npmjs.org/jade/-/jade-0.26.3.tgz
npm WARN package.json [email protected] No readme data.
npm http 200 https://registry.npmjs.org/debug
npm http 200 https://registry.npmjs.org/commander/-/commander-0.6.1.tgz
npm http 200 https://registry.npmjs.org/diff/1.0.7
npm http GET https://registry.npmjs.org/diff/-/diff-1.0.7.tgz
npm http 200 https://registry.npmjs.org/diff/-/diff-1.0.7.tgz
npm http 200 https://registry.npmjs.org/glob/3.2.3
npm http GET https://registry.npmjs.org/glob/-/glob-3.2.3.tgz
npm http 200 https://registry.npmjs.org/glob/-/glob-3.2.3.tgz
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/mkdirp/0.3.0
npm http 200 https://registry.npmjs.org/mkdirp/0.3.0
npm http GET https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz
npm http 200 https://registry.npmjs.org/inherits
npm http 200 https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz
npm http 200 https://registry.npmjs.org/graceful-fs
npm http 200 https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz
npm http 200 https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 200 https://registry.npmjs.org/sigmund
npm http 200 https://registry.npmjs.org/lru-cache

> [email protected] install /foo/bar/node_modules/sass-brunch/node_modules/node-sass
> node build.js

`darwin-x64-v8-3.14` exists; testing

  16 passing (16ms)

Binary is fine; exiting

> [email protected] postinstall /foo/bar/node_modules/static-jade-brunch
> node setup.js postinstall

npm WARN package.json [email protected] 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
[email protected] node_modules/sass-brunch
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
npm install  8.67s user 3.24s system 49% cpu 24.212 total

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.