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.
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`,
},
},
],
};