🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@brixtol/rollup-html

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brixtol/rollup-html

Hard fork of @rollup/html with some adjustments to better fit bundle processing

latest
Source
npmnpm
Version
0.6.0
Version published
Maintainers
1
Created
Source

@brixtol/rollup-html

Hard fork of the @rollup/plugin-html plugin with some minor adjustment to better fit the monorepo development environment.

Why?

We need some additional control over the generated HTML, minor adjustments to source.

Install

pnpm add @brixtol/rollup-html --save-dev

Usage

import html from '@brixtol/rollup-html';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [
    html({
      title: 'App Title',
      attributes: {
        html: { lang: 'en' }
      },
      styles: [
        {
          fileName: 'https://use.typekit.net/xxx.css',
          place: 'before'
        }
      ],
      sprite: {
        input: './src/svg/files',
        options: {
          cleanDefs: true,
          inline: true,
          svgAttrs: {
            class: 'd-none',
            style: 'position: absolute; height: 0 !important; width: !important;'
          }
        }
      },
      publicPath: '/',
      minify: {
        collapseWhitespace: true,
        html5: true,
        collapseInlineTagWhitespace: true
      },
      nodes: {
        div: {
          id: 'app'
        }
      },
      innerHTML: `
          <form name="contact-form" netlify netlify-honeypot="bot-field" hidden>
          <input type="text"  name="name">
          <input type="email" name="email">
          <input type="tel" name="phone">
          <textarea name="message"></textarea>
          </form>
        `,
      links: [
        {
          rel: 'apple-touch-icon',
          sizes: '180x180',
          href: '/apple-touch-icon.png'
        },
        {
          rel: 'icon',
          type: 'image/png',
          sizes: 'image/png',
          href: '/favicon-32x32.png'
        },
        {
          rel: 'icon',
          type: 'image/png',
          sizes: '16x16',
          href: '/favicon-16x16.png'
        },
        {
          rel: 'mask-icon',
          color: '#4c4c4c',
          href: '/safari-pinned-tab.svg'
        },
        {
          rel: 'manifest',
          href: '/site.webmanifest'
        }
      ],
      meta: [
        {
          charset: 'utf-8'
        },
        {
          name: 'viewport',
          content: 'minimum-scale=1, initial-scale=1, width=device-width'
        },
        {
          name: 'description',
          content: 'Some Description'
        },
        {
          name: 'google-site-verification',
          content: 'xxxxx'
        },
        {
          name: 'msapplication-TileColor',
          content: '#ffffff'
        },
        {
          name: 'theme-color',
          content: '#ffffff'
        }
      ]
    })
  ]
};

We ♡ open source!

FAQs

Package last updated on 02 May 2022

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