# cdn-loader

> cdn-loader for webpack

Latest version **0.1.8-0** (published 2017-03-01) · GPL license · 0 weekly downloads

## Install

```sh
npm install cdn-loader
pnpm add cdn-loader
yarn add cdn-loader
bun add cdn-loader
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8-0 |
| Published | 2017-03-01 |
| First published | 2016-09-10 |
| Weekly downloads | 0 |
| License | GPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | jso0 |
| Maintainers | jso0 |
| Keywords | webpack, cdn-loader, webpack-loader, html-webpack-plugin, html-webpack-cdn-plugin |

## Links

- npm: https://www.npmjs.com/package/cdn-loader
- Repository: https://github.com/jso0/cdn-loader
- Issues: https://github.com/jso0/cdn-loader/issues
- npm.io page: https://npm.io/package/cdn-loader

## Dependencies (1)

- [loader-utils](https://npm.io/package/loader-utils.md) ^0.2.15

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

- 0.1.8-0 (latest) — 2017-03-01
- 0.1.7 — 2016-09-11
- 0.1.6 — 2016-09-11
- 0.1.5 — 2016-09-11
- 0.1.4 — 2016-09-11
- 0.1.2 — 2016-09-11
- 0.1.1 — 2016-09-10
- 0.1.0 — 2016-09-10

## README

#介绍

## 基本用法 (Usage)

在入口文件中require("cdn-loader + ? + ModuleName + @ + version + !")

注意三个符号 `?` 、`@` 、`!`

示例： `require('cdn?jQuery@3.1.0!')`

> Note:模块区分大小写

> 功能类似与 `webpack` 的 `externals`

webpack打包后

js

``` javascript
// entry.js
/***/ 15:
/***/ function(module, exports) {

    module.exports = window.jQuery;

/***/ }

```

手动添加到html文件

``` html
// index.html
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>


```

## 高级用法 (自动生成)

更多支持可通过**[html-webpack-cdn-plugin](https://github.com/jso0/html-webpack-cdn-plugin)**插件自行配置...

## 安装 (Install)

> `npm install -D cdn-loader`

## TODO

- [x] 编写一个更新html-webpack-plugin输出assets插件
- [ ] 后续优化
- [ ] 支持别名设置


Have fun

by jso0

[CDNjs.com](https://cdnjs.com/libraries)

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