Package Exports
- babel-plugin-transform-html-import-to-string
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-plugin-transform-html-import-to-string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
babel-plugin-transform-html-import-to-string
Turn HTML imports (and export from) into strings.
Example
Given the following example.html.
<h1>Hello</h1>in
import html from './example.html';out
const html = '<h1>Hello</h1>';and if using export
in
export * as html from './example.html';out
const html = "<h1>Hello</h1>";
export { html };Installation
$ npm install babel-plugin-transform-html-import-to-stringUsage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["transform-html-import-to-string"]
}Via CLI
$ babel --plugins transform-html-import-to-string script.jsVia Node API
require("babel-core").transform("code", {
plugins: ["transform-html-import-to-string"]
});