Open devo-devo opened 2 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have a more or less related topic, I try to setup bundle-stats
in a Craco project.
And I see my output is merging into the webpack config found in CRA, but alas I don't get any additional output.
@devo-devo same issue for me, since February, have you found a solution?
@stephane-klein do you have an example config?
i feel like using this secion works a little better
webpack: {
configure: (webpackConfig, { env, paths }) => {}
}
}
@devo-devo my current config:
// craco.config.js
const path = require('path');
const CracoEsbuildPlugin = require('craco-esbuild');
module.exports = {
plugins: [
{
plugin: CracoEsbuildPlugin,
options: {
includePaths: [path.resolve(__dirname, '../shared/')]
}
}
],
webpack: {
configure: {
// this conf come from https://github.com/relative-ci/bundle-stats/tree/master/packages/cli#webpack-configuration
stats: {
assets: true,
chunks: true,
modules: true,
builtAt: true,
hash: true
}
}
}
};
At this time, I look for how can I enable --json
option with craco
.
I look for enable --json
with the webpack config options.
How do you enable --json
in your craco
project?
I think I have found, I added this lines:
profile: true,
recordsPath: path.join(__dirname, 'records.json'),
in:
const path = require('path');
const CracoEsbuildPlugin = require('craco-esbuild');
module.exports = {
plugins: [
{
plugin: CracoEsbuildPlugin,
options: {
includePaths: [path.resolve(__dirname, '../shared/')]
}
}
],
webpack: {
configure: {
// this conf come from https://github.com/relative-ci/bundle-stats/tree/master/packages/cli#webpack-configuration
profile: true,
recordsPath: path.join(__dirname, 'records.json'),
stats: {
assets: true,
chunks: true,
modules: true,
builtAt: true,
hash: true
}
}
}
};
I think I have found, I added this lines:
profile: true, recordsPath: path.join(__dirname, 'records.json'),
in:
const path = require('path'); const CracoEsbuildPlugin = require('craco-esbuild'); module.exports = { plugins: [ { plugin: CracoEsbuildPlugin, options: { includePaths: [path.resolve(__dirname, '../shared/')] } } ], webpack: { configure: { // this conf come from https://github.com/relative-ci/bundle-stats/tree/master/packages/cli#webpack-configuration profile: true, recordsPath: path.join(__dirname, 'records.json'), stats: { assets: true, chunks: true, modules: true, builtAt: true, hash: true } } } };
Error, records.json
isn't a stats file 😥
Loving this plugin!
Came in super handy when I want to add the whyDidYourRender plugin to my app.
However, although I'm sure I'm missing something super simple, I'm trying to set my stats to verbose to no avail.
Would think it was as simple as
And I see my output is merging into the webpack config found in CRA, but alas I don't get any additional output.