https://github.com/webdeveric/craco-plugin-inspect-config
Inspect your configuration objects
https://github.com/webdeveric/craco-plugin-inspect-config
craco craco-plugin create-react-app
Last synced: 2 months ago
JSON representation
Inspect your configuration objects
- Host: GitHub
- URL: https://github.com/webdeveric/craco-plugin-inspect-config
- Owner: webdeveric
- Created: 2021-05-21T16:18:15.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-22T22:40:31.000Z (over 3 years ago)
- Last Synced: 2025-02-23T08:03:31.345Z (3 months ago)
- Topics: craco, craco-plugin, create-react-app
- Language: TypeScript
- Homepage:
- Size: 1.25 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `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
```shell
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.
```js
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()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) 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:
```js
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`,
},
},
],
};
```