# ksc-webpack-plugins

> svg2font,vfs

Latest version **1.0.11** (published 2019-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install ksc-webpack-plugins
pnpm add ksc-webpack-plugins
yarn add ksc-webpack-plugins
bun add ksc-webpack-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.11 |
| Published | 2019-12-06 |
| First published | 2018-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 14.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wangjianliang |
| Maintainers | lynn.wang |
| Keywords | svg2font, webpack, plugin |

## Links

- npm: https://www.npmjs.com/package/ksc-webpack-plugins
- Repository: http://newgit.op.ksyun.com/ksyun-fe/ksc-webpack-plugins
- npm.io page: https://npm.io/package/ksc-webpack-plugins

## Dependencies (5)

- [glob](https://npm.io/package/glob.md) ^7.1.2
- [lodash](https://npm.io/package/lodash.md) ^4.17.10
- [webfont](https://npm.io/package/webfont.md) ^8.1.2
- [webpack](https://npm.io/package/webpack.md) ^4.4.1
- [chokidar](https://npm.io/package/chokidar.md) ^2.0.3

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.11 (latest) — 2019-12-06
- 1.0.9 — 2018-08-02
- 1.0.8 — 2018-07-04
- 1.0.7 — 2018-07-03
- 1.0.6 — 2018-05-25
- 1.0.5 — 2018-05-21
- 1.0.4 — 2018-05-21
- 1.0.3 — 2018-05-18
- 1.0.2 — 2018-05-18
- 1.0.1 — 2018-05-18

## README

# KSC Webpack Plugins 集合

使用方法

```bash
npm install ksc-webpack-plugins
```

```js
const IcofontWebpackPlugin = require("ksc-webpack-plugins").IcofontWebpackPlugin;

const VFSModulesPlugin = require("ksc-webpack-plugins").VFSModulesPlugin;

module.exports = function () {
    return {
        plugins: [
            new IcofontWebpackPlugin(IcofontWebpackPluginOptions),
            new VFSModulesPlugin(VFSModulesPluginOptions)
        ]
    }
}
```

## IcofontWebpackPlugin额外说明

```html
<!-- 字体图标使用 **IcofontWebpackPluginOptions.cssNamePrefix** 做主css , 单个图标使用`IcofontWebpackPluginOptions.cssNamePrefix-${svg文件名}`-->
<div>
    <i class="ksyunicon ksyunicon-notification"></i>
    <i class="ksyunicon ksyunicon-abc"></i>
    <i class="ksyunicon ksyunicon-bcs"></i>
</div>
```

```js
// 入口js处加载生成的css **地址为IcofontWebpackPluginOptions.cssModulePath**
import "ksyunicon/webfont.css"
```


## IcofontWebpackPluginOptions 参数说明
> __test__目录下有webpack2 ,webpack3 例子  webpack4可以参考ksr 源码
> #### .files   
> svg 文件夹目录 例如 `path.resolve(__dirname, '**/*.svg')` , 支持glob模式
> #### .cssNamePrefix
> css classname 前缀
> #### .cssModulePath
> 生成的支持引入的css虚拟文件 , 按需要自行引入到指定位置
> #### .watchOptions
> 监听svg改动选项 , 一般不用配置 , 如需配置请参见[chokidar](https://github.com/paulmillr/chokidar)
> #### 示例

```js
IcofontWebpackPluginOptions = {
    files: path.resolve(__dirname, '**/*.svg'),
    cssNamePrefix:"ksyunicon",
    cssModulePath: "ksyunicon/webfont.css"
}
```


## VFSModulesPluginOptions 参数说明
> #### VFSModulesPluginOptions => modules
#### 示例

```js
VFSModulesPluginOptions = {
    'src/vfs.js':"console.log('=====')"
}
```

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