dojo / cli-build-widget

Command for building Dojo widgets
Other
6 stars 17 forks source link

Building elements in a single config #56

Closed rorticus closed 5 years ago

rorticus commented 5 years ago

Instead of passing a single webpack configuration for each element being built, this is passing a single webpack configuration for all elements. Previously, it would crash if you turned off onlyCompileBundledFiles in ts-loader and ran it on @dojo/widgets because it would run out of memory. In theory this was because each configuration would be loading all the dependencies together and there would be no sharing between them. Remember webpack, sharing is caring!

When running this locally, it'd produce the following structure for @dojo/widgets,

output/
    accordian-pane/
        accordian-pane-1.0.0.js
        accordian-pane-1.0.0.css
    button/
    rinse, lather, repeat for all widgets
    blahblah.svg
    blahblah2.ttf

I tested that the widgets were being created correctly by quickly creating an example page for the button widget and pulling in the dependencies. Things seemed like they were working fine, but a better test might be to generate everything and then copy the resulting files into the custom element showcase.

agubler commented 5 years ago

@rorticus @dojo/webpack-contrib@6.0.0-alpha.1 is released

rorticus commented 5 years ago

OK, flattened out the output directory so everything is built right in output/

image

rorticus commented 5 years ago

Added the dev/dist directories back in.

image

rorticus commented 5 years ago

OK, refactored to not pass an array of configs anymore.

codecov[bot] commented 5 years ago

Codecov Report

Merging #56 into master will increase coverage by 1.39%. The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #56      +/-   ##
=========================================
+ Coverage   69.91%   71.3%   +1.39%     
=========================================
  Files           8       8              
  Lines         359     352       -7     
  Branches       62      59       -3     
=========================================
  Hits          251     251              
+ Misses        108     101       -7
Impacted Files Coverage Δ
src/base.config.ts 34.92% <ø> (+3.49%) :arrow_up:
src/dist.config.ts 44.44% <0%> (ø) :arrow_up:
src/dev.config.ts 30.76% <0%> (ø) :arrow_up:
src/main.ts 95.23% <100%> (ø) :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 150dc16...e7f787f. Read the comment docs.