Skip to content

Commit f144623

Browse files
committed
Merge branch 'moo3-webpack/2892'
2 parents c948c81 + be39508 commit f144623

8 files changed

Lines changed: 19 additions & 4 deletions

File tree

examples/dll-user/example.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ console.log(require("../dll/a"));
33

44
console.log(require("beta/beta"));
55
console.log(require("beta/b"));
6+
console.log(require("beta/c"));
67

78
console.log(require("module"));

examples/dll/c.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = "jsx";

examples/dll/webpack.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
var path = require("path");
22
var webpack = require("../../");
33
module.exports = {
4+
resolve: {
5+
extensions: ['.js', '.jsx']
6+
},
47
entry: {
58
alpha: ["./alpha", "./a", "module"],
6-
beta: ["./beta", "./b"]
9+
beta: ["./beta", "./b", "./c"]
710
},
811
output: {
912
path: path.join(__dirname, "js"),

lib/DllReferencePlugin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ DllReferencePlugin.prototype.apply = function(compiler) {
4545
type: this.options.type,
4646
scope: this.options.scope,
4747
context: this.options.context || compiler.options.context,
48-
content: this.options.content || manifest.content
48+
content: this.options.content || manifest.content,
49+
extensions: this.options.extensions
4950
}));
5051
}.bind(this));
5152
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = 'f';

test/configCases/dll-plugin/0-create-dll/webpack.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ var path = require("path");
22
var webpack = require("../../../../");
33

44
module.exports = {
5-
entry: ["./a", "./b", "./_d", "./_e"],
5+
entry: ["./a", "./b", "./_d", "./_e", "./f"],
6+
resolve: {
7+
extensions: ['', '.js', '.jsx']
8+
},
69
output: {
710
filename: "dll.js",
811
chunkFilename: "[id].dll.js",

test/configCases/dll-plugin/1-use-dll/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ it("should load a module from dll", function() {
77
require("dll/a").should.be.eql("a");
88
});
99

10+
it("should load a module of non-default type without extension from dll", function() {
11+
require("dll/f").should.be.eql("f");
12+
});
13+
1014
it("should load an async module from dll", function() {
1115
require("dll/b")().then(function(c) {
1216
c.should.be.eql({ default: "c" });

test/configCases/dll-plugin/1-use-dll/webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module.exports = {
77
manifest: require("../../../js/config/dll-plugin/manifest0.json"),
88
name: "../0-create-dll/dll.js",
99
scope: "dll",
10-
sourceType: "commonjs2"
10+
sourceType: "commonjs2",
11+
extensions: ['.js', '.jsx']
1112
})
1213
]
1314
}

0 commit comments

Comments
 (0)