🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

record-webapck-raw-loader

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

record-webapck-raw-loader

### Installation

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
10
11.11%
Maintainers
0
Weekly downloads
 
Created
Source

record-webapck-raw-loader

Installation

npm i record-webapck-raw-loader -D

Usage

在 webpack 编译阶段 通过自定义 loader 记录特定被编译的文件信息,并且写入到指定文件

options.writerPath 文件写入的路径, 此包处理二进制数据 (图片资源)
options.clean 每次启动 webpack 时,是否清空文件, 默认为 true, 每次新启动 webpack 不追加写入 (但是一次编译是追加写入的)
module.exports = {
    ....
    module: {
        rules: [
             {
                test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
                enforce: "pre",
                exclude: /node_modules/,
                use: [
                    {
                        loader: "record-webapck-raw-loader",
                        options: {
                            writerPath: path.join(__dirname, "./recordRaw.log"),
                            clean: true,
                        },
                    }
                ],
            },
        ]
    }
    ...
}

Keywords

cus

FAQs

Package last updated on 24 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts