Experimental html transformer for metro
Part of my journey to use metro
as a web bundler. This transformer is pretty hackish. Maybe there is a better way to load the html, but I was quite happy that it works ๐.
Relevant to my metro-css-transformer
.
I haven't released a npm package yet!
npm install --save-dev metro-html-transformer
yarn add -D metro-html-transformer
In your metro.config.js
add
resolver: {
sourceExts: ['js', 'json', 'ts', 'tsx', 'html'],
// other options ...
},
transformer: {
babelTransformerPath: require.resolve('./lib/metro-html-transformer'),
// other options ...
},