# webpack-resource-localize-plugin

> webpack 资源本地化插件

Latest version **1.0.0** (published 2022-07-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install webpack-resource-localize-plugin
pnpm add webpack-resource-localize-plugin
yarn add webpack-resource-localize-plugin
bun add webpack-resource-localize-plugin
```

## 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.0 |
| Published | 2022-07-05 |
| First published | 2022-07-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 10.13.0 |
| Dependencies | 4 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | xuezu |
| Maintainers | wangcherry |
| Keywords | webpack, plugin, resource, localize |

## Links

- npm: https://www.npmjs.com/package/webpack-resource-localize-plugin
- npm.io page: https://npm.io/package/webpack-resource-localize-plugin

## Dependencies (4)

- [mkdirp](https://npm.io/package/mkdirp.md) ^1.0.4
- [strip-css-comments](https://npm.io/package/strip-css-comments.md) ^4.1.0
- [string.prototype.matchall](https://npm.io/package/string.prototype.matchall.md) ^4.0.5
- [@nodefactory/strip-comments](https://npm.io/package/@nodefactory/strip-comments.md) ^1.0.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-07-05

## README

# webpack-resource-localize-plugin

webpack 资源本地化插件，会将所有静态资源（js、css、字体文件、图片）下载到本地，并修改资源引用路径。

## 使用
### Install
```base
npm install webpack-resource-localize-plugin --save-dev
```

### Usage (as a plugin)
```js
const WebpackResourceLocalizePlugin = require('webpack-resource-localize-plugin');
module.exports = {
  plugins: [
    new WebpackResourceLocalizePlugin()
  ]
}
```

### API
```js
// 默认配置
const options = {
  destDir: 'build', //资源保存位置，默认build
  contextPath: '/', //替换资源路径，默认根路径
  resourceExtensions: [ //需要本地化的资源后缀
    '.js',
    '.css',
    '.svg',
    '.jpg',
    '.jpeg',
    '.gif',
    '.png',
    '.ttf',
    '.eot',
    '.woff2',
    '.woff',
  ],
}

new WebpackResourceLocalizePlugin(options)
```

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