kraken-devtools
Advanced tools
Comparing version 1.0.0-alpha.3 to 1.0.0-beta
@@ -52,3 +52,4 @@ /*───────────────────────────────────────────────────────────────────────────*\ | ||
filePath: req.path.replace('/', path.sep), | ||
name: regex.exec(req.path)[1] | ||
name: regex.exec(req.path)[1], | ||
ext: options.ext | ||
}; | ||
@@ -107,6 +108,6 @@ | ||
if (compiler.name) { | ||
if (context.ext) { | ||
// XXX: compiler.name is source file extension, so if there's no name we don't concern ourselves | ||
// with looking for a source file that's different from the dest file. | ||
srcFile = srcFile.replace(path.extname(srcFile), '') + '.' + compiler.name; | ||
srcFile = srcFile.replace(path.extname(srcFile), '') + '.' + context.ext; | ||
} | ||
@@ -113,0 +114,0 @@ |
{ | ||
"name": "kraken-devtools", | ||
"version": "1.0.0-alpha.3", | ||
"version": "1.0.0-beta", | ||
"description": "A development mode toolkit for kraken", | ||
@@ -49,4 +49,5 @@ "main": "index.js", | ||
"dustjs-linkedin": "^2.3.4", | ||
"localizr": "^0.1.0" | ||
"localizr": "^0.1.0", | ||
"stylus": "^0.43.0" | ||
} | ||
} |
@@ -26,7 +26,9 @@ /*───────────────────────────────────────────────────────────────────────────*\ | ||
return function less(data, args, callback) { | ||
options.ext = options.ext || 'less'; | ||
return function (data, args, callback) { | ||
var parser = new(lib.Parser)({ | ||
paths: args.paths, // Specify search paths for @import directives | ||
filename: args.context.name, // Specify a filename, for better error messages | ||
dumpLineNumbers: "comments" // Enables comment style debugging | ||
paths: args.paths, | ||
filename: args.context.name, | ||
dumpLineNumbers: 'comments' | ||
}); | ||
@@ -33,0 +35,0 @@ |
@@ -26,3 +26,5 @@ /*───────────────────────────────────────────────────────────────────────────*\ | ||
return function scss(data, args, callback) { | ||
options.ext = options.ext || 'scss'; | ||
return function (data, args, callback) { | ||
lib.render({ | ||
@@ -29,0 +31,0 @@ data: data, |
@@ -27,3 +27,3 @@ # kraken-devtools | ||
`src` - The directory of your source files, e.g. LESS, SASS, Dust | ||
`src` - The directory of your source files | ||
`dest` - The destination directory for the compiled files | ||
@@ -34,5 +34,5 @@ `config` - Optional. An object of compilers to enable | ||
### Compilers | ||
### Configuration | ||
LESS, SASS, and Dust compilers are provided by default in addition to a static file copier. To add additonal compilers pass then to the `config` value, e.g.: | ||
`less`, `sass`, `stylus`, `dustjs`, and a static `copier` plugin are available to use. To enable, set the `module` and `files` properties in your `config`, e.g.: | ||
@@ -43,5 +43,16 @@ ```json | ||
"module": "kraken-devtools/plugins/less", | ||
"files": "/css/**/*.css" | ||
"files": "/css/**/*.css", | ||
"ext": "less" | ||
} | ||
} | ||
``` | ||
To add additional compilers, create a module with the following format and add it to your configuration: | ||
```js | ||
module.exports = function (options) { | ||
return function (data, args, callback) { | ||
// Compile the data | ||
}; | ||
}; | ||
``` |
38929
21
544
56
11