This repository was archived by the owner on Mar 31, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +114
-75
lines changed
Expand file tree Collapse file tree 4 files changed +114
-75
lines changed Original file line number Diff line number Diff line change @@ -41,4 +41,4 @@ Then open http://localhost:8000 to see your app.
4141
4242# Acknowledgements
4343
44- This projects was adapted from https://github.com/jihchi/rescript-react-realworld-example-app by [ @jihchi ] ( https://github.com/jihchi ) .
44+ This project was adapted from https://github.com/jihchi/rescript-react-realworld-example-app by [ @jihchi ] ( https://github.com/jihchi ) .
Original file line number Diff line number Diff line change 1212 "scripts" : {
1313 "webpack" : " webpack -w" ,
1414 "webpack:production" : " webpack --mode=production" ,
15+ "webpack:analyze" : " ANALYZE=true webpack --mode=production" ,
1516 "server" : " webpack-dev-server" ,
1617 "analyze" : " webpack --mode=production --profile --json > stats.json && webpack-bundle-analyzer stats.json" ,
1718 "test" : " echo \" Error: no test specified\" && exit 1"
1819 },
1920 "devDependencies" : {
2021 "html-webpack-plugin" : " ^3.2.0" ,
2122 "webpack" : " ^4.44.2" ,
22- "webpack-bundle-analyzer" : " ^3.9 .0" ,
23+ "webpack-bundle-analyzer" : " ^4.5 .0" ,
2324 "webpack-cli" : " ^3.3.12" ,
2425 "webpack-dev-server" : " ^3.11.0"
2526 },
Original file line number Diff line number Diff line change 11const path = require ( 'path' ) ;
22const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
3+ const BundleAnalyzerPlugin = require ( 'webpack-bundle-analyzer' ) . BundleAnalyzerPlugin ;
34const outputDir = path . join ( __dirname , 'build/' ) ;
45
56const isProd = process . env . NODE_ENV === 'production' ;
7+ const withAnalyzer = process . env . ANALYZE == "true" ;
68
79module . exports = {
810 entry : './_build/default/src/main.bc.js' ,
@@ -23,7 +25,10 @@ module.exports = {
2325 template : 'src/index.html' ,
2426 inject : false ,
2527 favicon : "./src/favicon.ico"
26- } )
28+ } ) ,
29+ ...( withAnalyzer ? [ new BundleAnalyzerPlugin ( {
30+ analyzerMode : "static" ,
31+ } ) ] : [ ] )
2732 ] ,
2833 devServer : {
2934 compress : true ,
You can’t perform that action at this time.
0 commit comments