Skip to content

Commit

Permalink
Support passing caseSensitive as a loader option
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Oct 24, 2017
1 parent 0dc2e49 commit d827d3b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 9 additions & 3 deletions index.js
@@ -1,10 +1,16 @@
var fbp = require('fbp');
var utils = require('loader-utils');

module.exports = function(source) {
var options = utils.getOptions(this);
if (!options) {
options = {};
}
if (!options.caseSensitive) {
options.caseSensitive = false;
}
this.cacheable && this.cacheable();
var value = fbp.parse(source, {
caseSensitive: false
});
var value = fbp.parse(source, options);
this.value = [value];
return "module.exports = " + JSON.stringify(value, undefined, "\t") + ";";
}
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -21,7 +21,8 @@
},
"homepage": "https://github.com/flowbased/fbp-loader#readme",
"dependencies": {
"fbp": "^1.3.0"
"fbp": "^1.3.0",
"loader-utils": "^1.1.0"
},
"devDependencies": {
"webpack": "^3.0.0"
Expand Down

0 comments on commit d827d3b

Please sign in to comment.