Created
August 7, 2014 18:38
-
-
Save doowb/1badb1098d1ec6986fb1 to your computer and use it in GitHub Desktop.
custom naming in template-loader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var loader = require('./'); | |
var base = path.resolve('test/fixtures'); | |
var relative = path.relative.bind(path, base); | |
loader({ | |
rename: function (filepath) { | |
var name = relative(filepath); | |
return name | |
.replace(path.extname(name), '') | |
.replace(/[\\\/]/g, '-'); | |
} | |
}) | |
.load('test/fixtures/**/*.*'); | |
console.log('templates', loader.cache); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment