An open API service indexing awesome lists of open source software.

https://github.com/react-doc/raw-content-replace-loader

Replaces the specified path file contents.
https://github.com/react-doc/raw-content-replace-loader

rdoc react-doc webpack webpack-loader

Last synced: about 2 months ago
JSON representation

Replaces the specified path file contents.

Awesome Lists containing this project

README

        






Raw Content Replace Loader


Replaces the specified path file contents.


Install

```bash
npm install --save-dev raw-content-replace-loader
```

Usage

Use the loader either via your webpack config, CLI or inline.

**webpack.config.js**

```js
module.exports = {
module: {
rules: [
{
test: /\.md$/,
use: [
{
loader: require.resolve('raw-content-replace-loader'),
options: {
// include: /rdoc\.tree\.data\.json$/, // 检查包含的文件名字
// extensions: /\.md/,
path: PATH.join(cachePath, './md'), // 需要替换的目录
replace: cmd.projectRoot, // 替换成目标目录
sep: /___/g, // 文件名存储,文件夹+下划线间隔+文件名
}
}
]
}
]
}
}
```