Skip to content

Commit 5ca01e9

Browse files
committed
test case for resolving node buildin libs
webpack#747
1 parent 85af275 commit 5ca01e9

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

lib/node/NodeSourcePlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ NodeSourcePlugin.prototype.apply = function(compiler) {
6767
var alias = {};
6868
Object.keys(nodeLibsBrowser).forEach(function(lib) {
6969
if(options[lib] !== false)
70-
alias[lib] = getPathToModule(lib, options[lib]);
70+
alias[lib + "$"] = getPathToModule(lib, options[lib]);
7171
});
7272
if(Object.keys(alias).length > 0) {
7373
compiler.resolvers.normal.apply(

test/configCases/target/web/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,8 @@ it("should provide a vm shim", function () {
9292

9393
it("should provide a zlib shim", function () {
9494
require("zlib").should.be.an.Object;
95-
});
95+
});
96+
97+
it("should provide a shim for a path in a build-in module", function () {
98+
require("process/in.js").should.be.eql("in process");
99+
});

test/configCases/target/web/node_modules/process/in.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/configCases/target/web/node_modules/process/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)