We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af76123 commit 8c056deCopy full SHA for 8c056de
index.js
@@ -1,5 +1,6 @@
1
var loaderUtils = require('loader-utils'),
2
_ = require('lodash'),
3
+ path = require('path'),
4
helper = require('./src/helper');
5
6
var defaultOptions = {
@@ -12,8 +13,10 @@ var defaultOptions = {
12
13
};
14
15
module.exports = function (content, map) {
16
+ map = map || {};
17
+
18
var loaderOptions = loaderUtils.getOptions(this);
- var inputFile = map.file,
19
+ var inputFile = map.file || path.basename(this.resourcePath),
20
options = _.assign({}, _.cloneDeep(defaultOptions), loaderOptions),
21
dirPath = this.context,
22
fileNames = this.fs.readdirSync(dirPath).filter(function (file) {
0 commit comments