dojo / cli-build-webpack

🚀 **DEPRECATED** Dojo 2 - cli command for building applications
http://dojo.io
Other
4 stars 19 forks source link

Add build option `target` to change webpack target between "web" and … #104

Closed edhager closed 7 years ago

edhager commented 7 years ago

The builder is not setting Webpack's target option and the default is "web" which builds chunks for the browser environment. Using @dojo/core/load causes Webpack to inject code into the chunks that assumes the global window exists. This fails when the chunks are loaded in a node.js environment.

This PR adds a target option to the builder which maintains the "web" target by default.

Fix dojo/cli-test-intern#17

edhager commented 7 years ago

This is fix 1 of 2 for dojo/cli-test-intern#17. The second fix is in dojo\cli-test-intern.

codecov[bot] commented 7 years ago

Codecov Report

Merging #104 into master will increase coverage by <.01%. The diff coverage is 100%.

@@            Coverage Diff            @@
##           master    #104      +/-   ##
=========================================
+ Coverage   95.59%   95.6%   +<.01%     
=========================================
  Files          11      11              
  Lines         613     614       +1     
  Branches      127     127              
=========================================
+ Hits          586     587       +1     
  Misses         14      14              
  Partials       13      13
Impacted Files Coverage Δ
src/main.ts 95.6% <100%> (+0.04%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a5db155...9f58e33. Read the comment docs.

matt-gadd commented 7 years ago

Seeing actually how this works, I realise we are now passing node from the test command? Does this mean we are testing a bundle in one environment and then shipping it to another? Is this a good idea?

agubler commented 7 years ago

We have gone with not code splitting for the test bundle (which is used for running unit tests) which has been addressed https://github.com/dojo/cli-test-intern/pull/26