# html-node-loader

> Webpack plugin for loading HTML files as DOM

Latest version **1.0.0** (published 2021-07-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install html-node-loader
pnpm add html-node-loader
yarn add html-node-loader
bun add html-node-loader
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-07-08 |
| First published | 2021-07-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Toothless |
| Maintainers | toothless_ |
| Keywords | loader, webpack, html, node, dom |

## Links

- npm: https://www.npmjs.com/package/html-node-loader
- npm.io page: https://npm.io/package/html-node-loader

## Recent versions

- 1.0.0 (latest) — 2021-07-08

## README

HTML Node Loader is a loader for webpack that will load a given HTML file as DOM.

# Installation

Using npm:

```
$ npm install html-node-loader --save-dev
```

# Usage

In `webpack.config.js`:
```
module: {
    rules: [
        {
            test: /\.html$/i,
            use: [ {
                loader: 'html-node-loader',
                options: {
                    wrap: false
                }
            } ],
        },
    ]
}
```

In yor JS files you can now simply import the HTML file:
```js
// index.js
import example from "example.html"

consol.log(example.innerText);
```
```html
<!-- example.html -->
<p>Hello!</p>
```


# Options

`wrap`: Will wrap the parsed html in a `<span>` (default: `true`)

**NOTE**: Setting wrap to `false` will return the `firstChild` of the span

---
_Source: https://npm.io/package/html-node-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
