Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 days 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 (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-22T22:40:31.000Z (almost 3 years ago)
- Last Synced: 2024-11-07T19:41:37.290Z (8 days 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`,
},
},
],
};
```