# crossorigin-plugins

> Add crossorigin attribute to script tag or link tag

Latest version **1.0.5** (published 2021-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install crossorigin-plugins
pnpm add crossorigin-plugins
yarn add crossorigin-plugins
bun add crossorigin-plugins
```

## 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.5 |
| Published | 2021-01-14 |
| First published | 2020-12-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | chenjianfang |
| Maintainers | chenjianfang |
| Keywords | webpack, plugin, html-webpack-plugin |

## Links

- npm: https://www.npmjs.com/package/crossorigin-plugins
- Repository: https://github.com/chenjianfang/crossorigin
- Homepage: https://github.com/chenjianfang/crossorigin#readme
- Issues: https://github.com/chenjianfang/crossorigin/issues
- npm.io page: https://npm.io/package/crossorigin-plugins

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

- 1.0.5 (latest) — 2021-01-14
- 1.0.4 — 2020-12-24
- 1.0.3 — 2020-12-24
- 1.0.1 — 2020-12-24
- 1.0.0 — 2020-12-24

## README

## Introduction
Add crossorigin attribute to script tag or link tag

添加crossorigin属性到script和link标签

## Installation
```
npm install --save-dev crossorigin-plugins
```

## API
```
options: {scripts: Boolean, link: Boolean}
- scripts: true // Add crossorigin attribute to script tag, default: true
- link: true // Add crossorigin attribute to link tag, default: true

new CrossoriginPlugins(options)

```


## Usage
```
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CrossoriginPlugins = require('crossorigin-plugins');

const config = {
    mode: "development",
    entry: {
        test: './test/test.js' // Custom entry
    },
    output: {
        filename: '[name].js',
        path: path.join(__dirname, 'dist'), // Custom output
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                use: [
                    MiniCssExtractPlugin.loader,
                    {
                        loader: 'css-loader'
                    }
                ]
            },
        ]
    },
    plugins: [
        new MiniCssExtractPlugin(),
        new HtmlWebpackPlugin({
            template: './test/test.ejs' // Custom template
        }),
        new CrossoriginPlugins({
            scripts: true,
            link: true
        }),
    ]
};

module.exports = config;

```

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