# snowpack-plugin-banner

> Add comments to the production asset files (JS/CSS) of your Snowpack build.

Latest version **1.0.1** (published 2022-02-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install snowpack-plugin-banner
pnpm add snowpack-plugin-banner
yarn add snowpack-plugin-banner
bun add snowpack-plugin-banner
```

## 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.1 |
| Published | 2022-02-15 |
| First published | 2022-02-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | markshall |
| Keywords | banner, javascript, css, snowpack |

## Links

- npm: https://www.npmjs.com/package/snowpack-plugin-banner
- npm.io page: https://npm.io/package/snowpack-plugin-banner

## Dependencies (1)

- [dedent](https://npm.io/package/dedent.md) ^0.7.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2022-02-15
- 1.0.0 — 2022-02-15

## README

# snowpack-plugin-banner

Add comments to the production asset files (JS/CSS) of your Snowpack build.

This plugin uses the `dedent` package under the hood, so you don't need to worry about overly-indented files in your final build files. Adding multi-line, indented template string literals is no issue thanks to this.

## Install

### npm

`npm i -D snowpack-plugin-banner`

## Options

| Name     | Type   | Value(s) / Default      | Description                                                               |
| -------- | ------ | ----------------------- | ------------------------------------------------------------------------- |
| banner   | string |                         | The comment you want adding to your file.                                 |
| position | string | `top \| bottom` / `top` | Decide whether to add the comment to the top or bottom of the file.       |
| include  | array  | `[string]` / `[]`       | A list of files to add the comment to, relative to your public directory. |
| exclude  | array  | `[string]` / `[]`       | A list of files to ignore, relative to your public directory.             |

## Usage

### Add comment to bottom of file, omitting the `position` property will default the comment to the top.

```js
// snowpack.config.js
module.exports = {
  // ...
  plugins: [
    ['snowpack-plugin-banner', {
      banner: `
        /**
          * Copyright (c) my company 2022
          * LICENSE: MIT
          */
      `,
      position: 'bottom'
    }
  ]
  // ...
}
```

### Only add comment to a subset of files

```js
// snowpack.config.js
module.exports = {
  // ...
  plugins: [
    ['snowpack-plugin-banner', {
      banner: `
        /**
          * Copyright (c) my company 2022
          * LICENSE: MIT
          */
      `,
      include: ['app.js', 'styles.css', 'utils.js']
    }
  ]
  // ...
}
```

### Add to all files, but exclude a subset

```js
// snowpack.config.js
module.exports = {
  // ...
  plugins: [
    ['snowpack-plugin-banner', {
      banner: `
        /**
          * Copyright (c) my company 2022
          * LICENSE: MIT
          */
      `,
      exclude: ['utils.js']
    }
  ]
  // ...
}
```

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