Skip to content
Browse files

fix bug when preprocessor options are passed

  • Loading branch information...
1 parent 66300c8 commit 22d5fc2b1aa5c9bd82f26911af5dda746017d7bb @mateuszwozniak committed Apr 26, 2013
Showing with 8 additions and 5 deletions.
  1. +1 −1 package.json
  2. +2 −2 src/FileProcessor.js
  3. +5 −2 test/fixtures/config.js
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "glint",
- "version": "0.0.23",
+ "version": "0.0.24",
"author": "Mateusz Wozniak <mateusz@wozniak.io>",
"description": "Glint is an asset (css, js, whatever-you-need) management that helps you organize and manage your client side files",
"keywords": ["packer", "build", "compress", "glint", "assets"],
View
4 src/FileProcessor.js
@@ -60,7 +60,7 @@ function FileProcessor(files, config) {
if (typeof processor === 'function') {
processorFn = processor;
- } else if (processor.fn === 'function') {
+ } else if (typeof processor === 'object' && typeof processor.fn === 'function') {
processorFn = processor.fn;
processorOptions = processor.options || {};
} else {
@@ -73,7 +73,7 @@ function FileProcessor(files, config) {
process.exit(-1);
}
- storeProcessedFile(output, filePath, processor.outputExtension);
+ storeProcessedFile(output, filePath, processorFn.outputExtension);
typeof cb === 'function' && cb();
});
}
View
7 test/fixtures/config.js
@@ -14,7 +14,10 @@ module.exports = {
preprocessors: {
styl: stylus,
jade: jade,
- scss: scss
+ scss: {
+ fn: scss,
+ options: {}
+ }
},
postprocessors: {
css: [cleanCss],
@@ -48,4 +51,4 @@ module.exports = {
]
}
]
-};
+};

0 comments on commit 22d5fc2

Please sign in to comment.
Something went wrong with that request. Please try again.