dojo / core

:rocket: Dojo 2 - language helpers and utilities.
http://dojo.io
Other
213 stars 62 forks source link

Add webpack-specific `load`. #249

Closed mwistrand closed 7 years ago

mwistrand commented 7 years ago

Addresses a portion of #201. Given that webpack 1) does not understand contextual require passed as a value, and 2) needs to know about any modules that could be required, and therefore must include them in one of its known chunks, the current dojo-core/load implementation is incompatible with webpack.

To get around this, a replacement module can be used that maps resolved module paths to webpack's numerical module IDs. This new load-webpack module will not be used directly within applications, but instead will be used by a webpack plugin that generates its module information and uses it as a drop-in replacement for dojo-core/load. It is included in dojo-core both to keep it side-by-side with and ensure it is transpiled consistently with the main load implementation.

codecov-io commented 7 years ago

Current coverage is 95.21% (diff: 100%)

Merging #249 into master will increase coverage by 0.19%

@@             master       #249   diff @@
==========================================
  Files            33         34     +1   
  Lines          1788       1820    +32   
  Methods          17         19     +2   
  Messages          0          0          
  Branches        348        354     +6   
==========================================
+ Hits           1699       1733    +34   
+ Misses           28         27     -1   
+ Partials         61         60     -1   

Powered by Codecov. Last update df944e2...a667701

matt-gadd commented 7 years ago

do you think we should move load-webpack to a folder? ie load/webpack.ts, that way we can avoid the dash?

mwistrand commented 7 years ago

Yes, that would be better, especially when considering that it is already what we do for the request modules.