forked from webpack/webpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integrate the delegated module better into the exports flagging process
- Loading branch information
Showing
8 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
MIT License http://www.opensource.org/licenses/mit-license.php | ||
Author Tobias Koppers @sokra | ||
*/ | ||
"use strict"; | ||
const NullDependency = require("./NullDependency"); | ||
|
||
class DelegatedExportsDependency extends NullDependency { | ||
constructor(originModule, exports) { | ||
super(); | ||
this.originModule = originModule; | ||
this.exports = exports; | ||
} | ||
|
||
get type() { | ||
return "delegated exports"; | ||
} | ||
|
||
getReference() { | ||
return { | ||
module: this.originModule, | ||
importedNames: true | ||
}; | ||
} | ||
|
||
getExports() { | ||
return { | ||
exports: this.exports | ||
}; | ||
} | ||
} | ||
|
||
module.exports = DelegatedExportsDependency; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import value from "dll/module"; | ||
|
||
it("should have the correct default export", function() { | ||
value.should.be.eql("ok"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import value from "dll/module"; | ||
|
||
it("should have still the correct default export", function() { | ||
value.should.be.eql("ok"); | ||
}); |
19 changes: 19 additions & 0 deletions
19
test/watchCases/plugins/dll-reference-plugin/webpack.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var webpack = require("../../../../"); | ||
module.exports = { | ||
plugins: [ | ||
new webpack.DllReferencePlugin({ | ||
name: "function(id) { return {default: 'ok'}; }", | ||
scope: "dll", | ||
content: { | ||
"./module": { | ||
id: 1, | ||
meta: { | ||
harmonyModule: true | ||
}, | ||
exports: ["default"] | ||
} | ||
} | ||
}), | ||
new webpack.optimize.ModuleConcatenationPlugin() | ||
] | ||
}; |