Turn HTML imports into strings
npm install babel-plugin-transform-html-import-to-stringTurn HTML imports (and export from) into strings.
Given the following _example.html_.
``html`Hello
#### in
`js`
import html from './example.html';
#### out
`js`
const html = 'Hello
';
and if using export
#### in
`js`
export * as html from './example.html';
#### out
`js`
const html = "Hello
";
export { html };
`sh`
$ npm install babel-plugin-transform-html-import-to-string
.babelrc
`json`
{
"plugins": ["transform-html-import-to-string"]
}
`sh`
$ babel --plugins transform-html-import-to-string script.js
`javascript``
require("babel-core").transform("code", {
plugins: ["transform-html-import-to-string"]
});