Closed nichoth closed 8 years ago
This transform knows to replace var bel = require('bel')
with var bel = 0
, omitting those dependencies from the final build.
yo-yo
has yo.update
so we can't remove that dependency. We can optimize it further by diving into yo-yo
and removing bel
as a dependency though. But perf and browser compat were my first priority.
Yes sorry probably shouldn't submit issues late at night — realized yo has morphdom as a dep also. Interesting why hyperx is included in the yo bundle but not the bel bundle.
I think as soon as you set it to var bel = 0
, Browserify skips those deps and all child deps. So with yo-yo
, it still has the require('bel')
which will include those deps.
@nichoth Give this a try: browserify index-yo.js -g yo-yoify | wc -c
as that will apply the transform globally including inside of yo-yo
which will remove bel
and hyperx
as a deps.
Thanks @shama! Nice trick with browserify. No more hyperx in the bundle.
Fixed with b24965e116079f13267cbe8328ff9c260ba437b3. This is becoming a plugin that always applies globally and only includes the appendChild function once per build.