Skip to content

Commit c9fa129

Browse files
committed
apply review feedback
1 parent 634834f commit c9fa129

3 files changed

Lines changed: 10 additions & 17 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"browser": { "foo": false }
3+
}

test/configCases/records/issue-2991/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
try {
2-
require("foo");
2+
require("pkgs/somepackage/foo");
33
} catch(e){}
44

55
it("should write relative paths to records", function() {
@@ -11,7 +11,7 @@ it("should write relative paths to records", function() {
1111
"byIdentifier": {
1212
"../../../../external \\"fs\\"": 0,
1313
"../../../../external \\"path\\"": 1,
14-
"../../../../ignored ../test/configCases/records/issue-2991 foo": 2,
14+
"../../../../ignored ../test/configCases/records/issue-2991 pkgs/somepackage/foo": 2,
1515
"test.js": 3
1616
},
1717
"usedIds": {

test/configCases/records/issue-2991/webpack.config.js

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,10 @@ module.exports = {
77
node: {
88
__dirname: false
99
},
10-
plugins: [
11-
{
12-
apply(compiler) {
13-
compiler.plugin("normal-module-factory", (nmf) => {
14-
var oldResolve = nmf.resolvers.normal.resolve;
15-
nmf.resolvers.normal.resolve = function(_, __, resource, callback) {
16-
if(resource === "foo") {
17-
callback(null, false, false);
18-
return;
19-
}
20-
return oldResolve.apply(this, arguments);
21-
};
22-
});
23-
}
10+
resolve: {
11+
aliasFields: [ "browser" ],
12+
alias: {
13+
pkgs: path.resolve(__dirname, "pkgs")
2414
}
25-
]
15+
}
2616
};

0 commit comments

Comments
 (0)