# babel-plugin-transform-html-import-to-string

> Turn HTML imports into strings

Latest version **2.0.0** (published 2021-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-transform-html-import-to-string
pnpm add babel-plugin-transform-html-import-to-string
yarn add babel-plugin-transform-html-import-to-string
bun add babel-plugin-transform-html-import-to-string
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-09-16 |
| First published | 2016-05-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Yeiniel Suarez Sosa |
| Maintainers | yeiniel |
| Keywords | babel-plugin, html, import, string |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-transform-html-import-to-string
- Repository: https://github.com/yeiniel/babel-plugin-transform-html-import-to-string
- Homepage: https://github.com/yeiniel/babel-plugin-transform-html-import-to-string#readme
- Issues: https://github.com/yeiniel/babel-plugin-transform-html-import-to-string/issues
- npm.io page: https://npm.io/package/babel-plugin-transform-html-import-to-string

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-09-16
- 1.0.0 — 2021-04-27
- 0.0.1 — 2016-05-21

## README

# babel-plugin-transform-html-import-to-string
[![Build Status](https://travis-ci.com/yeiniel/babel-plugin-transform-html-import-to-string.svg?branch=master)](https://travis-ci.com/yeiniel/babel-plugin-transform-html-import-to-string)

Turn HTML imports (and export from) into strings.

## Example

Given the following _example.html_.

```html
<h1>Hello</h1>
```

#### in

```js
import html from './example.html';
```

#### out

```js
const html = '<h1>Hello</h1>';
```

and if using export

#### in

```js
export * as html from './example.html';
```

#### out

```js
const html = "<h1>Hello</h1>";
export { html };
```


## Installation

```sh
$ npm install babel-plugin-transform-html-import-to-string
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
  "plugins": ["transform-html-import-to-string"]
}
```

### Via CLI

```sh
$ babel --plugins transform-html-import-to-string script.js
```

### Via Node API

```javascript
require("babel-core").transform("code", {
  plugins: ["transform-html-import-to-string"]
});
```

---
_Source: https://npm.io/package/babel-plugin-transform-html-import-to-string · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
