Socket
Socket
Sign inDemoInstall

craco-plugin-inspect-config

Package Overview
Dependencies
3
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    craco-plugin-inspect-config

Inspect your configuration objects


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

craco-plugin-inspect-config

Inspect your Craco, webpack, dev server, and Jest configs then write the output to a text file in the outputDir.

Install

npm install craco-plugin-inspect-config -D

Usage

Add the following to your craco.config.js file.

:warning: The plugin is not enabled by default. You must turn it on when you want to use it.

const { inspectConfigPlugin } = require('craco-plugin-inspect-config');

module.exports = {
  // ...
  plugins: [
    // ... put it last
    {
      plugin: inspectConfigPlugin,
      options: {
        enabled: true,
      },
    },
  ],
  // ...
};

Options

This plugin accepts the options from util.inspect() and the following:

{
  enabled: boolean;
  outputDir: string | ((pluginOptions) => string);
  stringify: (config, inspectOptions) => string;
  getFilename: (name) => string;
}

If you provide your own stringify, also provide getFilename so you can customize the extension.

Example:

const { inspectConfigPlugin } = require('craco-plugin-inspect-config');

module.exports = {
  plugins: [
    {
      plugin: inspectConfigPlugin,
      options: {
        enabled: true,
        stringify: config => JSON.stringify(config, null, 2),
        getFilename: name => `${name}.json`,
      },
    },
  ],
};

Keywords

FAQs

Last updated on 22 Jan 2022

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc