Skip to content

Commit

Permalink
feat(loader): make loader work with webpack 4
Browse files Browse the repository at this point in the history
  • Loading branch information
NetCZ committed Jul 25, 2018
1 parent af76123 commit 8c056de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var loaderUtils = require('loader-utils'),
_ = require('lodash'),
path = require('path'),
helper = require('./src/helper');

var defaultOptions = {
Expand All @@ -12,8 +13,10 @@ var defaultOptions = {
};

module.exports = function (content, map) {
map = map || {};

var loaderOptions = loaderUtils.getOptions(this);
var inputFile = map.file,
var inputFile = map.file || path.basename(this.resourcePath),
options = _.assign({}, _.cloneDeep(defaultOptions), loaderOptions),
dirPath = this.context,
fileNames = this.fs.readdirSync(dirPath).filter(function (file) {
Expand Down

0 comments on commit 8c056de

Please sign in to comment.