Skip to content

Commit

Permalink
Port 3.0.2's __filename fix to 2.1.2.
Browse files Browse the repository at this point in the history
* See PR here: webpack-contrib#618
  • Loading branch information
gfl-chris committed Dec 5, 2018
1 parent e81b883 commit 445b9ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
Author Tobias Koppers @sokra
*/
var fs = require('fs');
var path = require('path');
var ConcatSource = require("webpack-sources").ConcatSource;
var async = require("async");
var ExtractedModule = require("./ExtractedModule");
var Chunk = require("webpack/lib/Chunk");
var OrderUndefinedError = require("./OrderUndefinedError");
var loaderUtils = require("loader-utils");
var validateOptions = require('schema-utils');
var path = require('path');

var NS = fs.realpathSync(__dirname);
const NS = path.dirname(fs.realpathSync(__filename));

var nextId = 0;

Expand Down Expand Up @@ -337,7 +337,7 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
});

var file = (isFunction(filename)) ? filename(getPath) : getPath(filename);

compilation.assets[file] = source;
chunk.files.push(file);
}
Expand Down
3 changes: 2 additions & 1 deletion loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
Author Tobias Koppers @sokra
*/
var fs = require("fs");
var path = require("path");
var loaderUtils = require("loader-utils");
var NodeTemplatePlugin = require("webpack/lib/node/NodeTemplatePlugin");
var NodeTargetPlugin = require("webpack/lib/node/NodeTargetPlugin");
var LibraryTemplatePlugin = require("webpack/lib/LibraryTemplatePlugin");
var SingleEntryPlugin = require("webpack/lib/SingleEntryPlugin");
var LimitChunkCountPlugin = require("webpack/lib/optimize/LimitChunkCountPlugin");

var NS = fs.realpathSync(__dirname);
const NS = path.dirname(fs.realpathSync(__filename));

module.exports = function(source) {
return source;
Expand Down

0 comments on commit 445b9ba

Please sign in to comment.