@@ -19,6 +19,7 @@ const {newNormalModule} = require("./compat");
19
19
const DojoAMDRequireItemDependency = require ( "./DojoAMDRequireItemDependency" ) ;
20
20
const { reg, tap, callSync, callSyncBail} = require ( "./pluginCompat" ) . for ( "dojo-webpack-plugin" ) ;
21
21
const SingleEntryDependency = require ( "webpack/lib/dependencies/SingleEntryDependency" ) ;
22
+ const Module = require ( "webpack/lib/Module" ) ;
22
23
23
24
module . exports = class DojoAMDModuleFactoryPlugin {
24
25
constructor ( options ) {
@@ -210,13 +211,20 @@ module.exports = class DojoAMDModuleFactoryPlugin {
210
211
}
211
212
212
213
module ( module ) {
214
+ if ( module . originalRequest instanceof Module ) {
215
+ // Copy absMids from original request to the new request
216
+ callSync ( this . factory , "filter absMids" , module . originalRequest , absMid => {
217
+ callSync ( this . factory , "add absMid" , module , absMid ) ;
218
+ return true ;
219
+ } ) ;
220
+ }
213
221
// If the module already exists in the compilation, then copy the absMid data from
214
222
// this module to the existing module since this module will be discarded
215
223
const existing = this . compilation . findModule ( module . request ) ;
216
- if ( existing && module . absMid ) {
217
- callSync ( this . factory , "add absMid" , existing , module . absMid ) ;
218
- ( module . absMidAliases || [ ] ) . forEach ( absMid => {
224
+ if ( existing ) {
225
+ callSync ( this . factory , "filter absMids" , module , absMid => {
219
226
callSync ( this . factory , "add absMid" , existing , absMid ) ;
227
+ return true ;
220
228
} ) ;
221
229
}
222
230
// Add functions to the module object for adding/filtering absMids (for use by loaders)
0 commit comments