These are chat archives for assetgraph/assetgraph

25th
Jun 2017
Munawwar
@Munawwar
Jun 25 09:00
Question, with React, what do you use for managing translations? Assetgraphs i18n tools ..or ?
And question 2, how do you manage assets with jsx, like an img tag src attribute?
Andreas Lind
@papandreou
Jun 25 09:03
Yes, but react-intl for new stuff. I've just built an integration with crowdin.com -- it's not open source (yet), though.
Munawwar
@Munawwar
Jun 25 09:04
Hmm, q2, you might just be using the new getstaticurl replacement, toString() something
Andreas Lind
@papandreou
Jun 25 09:04
Yeah, 'the/url.png'.toString('url')
assetgraph's webpack integration will pick those up and rewrite them to that .toString('url') syntax so the rest of our build pipeline is aware of those assets and can move them around subsequently. That's actually the huge chunk of ast gymnastics code you linked to the other day :)
Andreas Lind
@papandreou
Jun 25 09:10
That one also supports wildcards:
import imageUrlGetter from 'my/images/*.png!asset';

const fooPngUrl = imageUrlGetter('foo');
Munawwar
@Munawwar
Jun 25 09:15
Thanks for the tip.
Andreas Lind
@papandreou
Jun 25 09:15
np man :)