Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Turn HTML imports into strings

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.8K
increased by10.93%
Maintainers
1
Weekly downloads
 
Created
Source

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

Build Status

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-string

Usage

.babelrc

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

Via CLI

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

Via Node API

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

Keywords

FAQs

Package last updated on 16 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc