raw-content-replace-loader

1.0.1 • Public • Published

Raw Content Replace Loader

Replaces the specified path file contents.

Install

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

Usage

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

webpack.config.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: '___',               // 文件名存储,文件夹+下划线间隔+文件名
            }
          }
        ]
      }
    ]
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i raw-content-replace-loader

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • wcjiang