Skip to content

Commit 3475184

Browse files
committed
feat: import node fs library instead of relying on webpack passed one
1 parent 12f8f21 commit 3475184

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var loaderUtils = require('loader-utils'),
22
_ = require('lodash'),
33
path = require('path'),
4+
fs = require('fs'),
45
helper = require('./src/helper');
56

67
var defaultOptions = {
@@ -19,7 +20,7 @@ module.exports = function (content, map) {
1920
var inputFile = map.file || path.basename(this.resourcePath),
2021
options = _.assign({}, _.cloneDeep(defaultOptions), loaderOptions),
2122
dirPath = this.context,
22-
fileNames = this.fs.readdirSync(dirPath).filter(function (file) {
23+
fileNames = fs.readdirSync(dirPath).filter(function (file) {
2324
return !file.match(/^\./);
2425
});
2526

0 commit comments

Comments
 (0)