Skip to content

Commit

Permalink
Merge pull request #58 from culturecreates/feature/issue-53
Browse files Browse the repository at this point in the history
Feature/issue 53
  • Loading branch information
SyamBabu-M authored Dec 17, 2024
2 parents 947ec2a + b6c13c8 commit ad667e5
Show file tree
Hide file tree
Showing 8 changed files with 282 additions and 49 deletions.
14 changes: 14 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');

module.exports = function override(config, env) {
// Customize JS and CSS output filenames
config.output.filename = `static/js/widget.js`;

const miniCssExtractPlugin = config.plugins.find(
Expand All @@ -8,5 +11,16 @@ module.exports = function override(config, env) {
miniCssExtractPlugin.options.filename = `static/css/widget.css`;
}

// to analize bundle run - ANALYZE=true npm run build:production
if (process.env.ANALYZE === 'true') {
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: 'bundle-report.html',
openAnalyzer: true,
}),
);
}

return config;
};
214 changes: 213 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-react": "^7.33.2",
"prettier": "^3.1.1",
"react-app-rewired": "^2.2.1"
"react-app-rewired": "^2.2.1",
"webpack-bundle-analyzer": "^4.10.2"
}
}
Loading

0 comments on commit ad667e5

Please sign in to comment.