File tree Expand file tree Collapse file tree 6 files changed +26
-7
lines changed Expand file tree Collapse file tree 6 files changed +26
-7
lines changed Original file line number Diff line number Diff line change 12
12
"plugins" : [
13
13
[" @babel/transform-runtime" ],
14
14
[" @babel/proposal-class-properties" ],
15
- [" @babel/proposal-object-rest-spread" ]
15
+ [" @babel/proposal-object-rest-spread" ],
16
+ [" @babel/plugin-syntax-dynamic-import" ]
16
17
]
17
18
}
Original file line number Diff line number Diff line change 278
278
"@babel/core" : " ^7.10.3" ,
279
279
"@babel/plugin-proposal-class-properties" : " ^7.10.4" ,
280
280
"@babel/plugin-proposal-object-rest-spread" : " ^7.10.4" ,
281
+ "@babel/plugin-syntax-dynamic-import" : " ^7.8.3" ,
281
282
"@babel/plugin-transform-runtime" : " ^7.10.3" ,
282
283
"@babel/preset-env" : " ^7.10.3" ,
283
284
"@babel/preset-react" : " ^7.10.1" ,
284
285
"@babel/preset-typescript" : " ^7.10.4" ,
285
286
"@jest-runner/electron" : " ^3.0.0" ,
287
+ "@loadable/component" : " ^5.13.1" ,
286
288
"@testing-library/jest-dom" : " ^5.11.0" ,
287
289
"@testing-library/react" : " ^10.4.3" ,
288
290
"@types/cookie" : " ^0.4.0" ,
341
343
"typescript" : " ^3.9.6" ,
342
344
"url-loader" : " ^4.1.0" ,
343
345
"webpack" : " ^4.43.0" ,
346
+ "webpack-bundle-analyzer" : " ^3.8.0" ,
344
347
"webpack-cli" : " ^3.3.12" ,
345
348
"webpack-dev-server" : " ^3.11.0" ,
346
349
"webpack-node-externals" : " ^1.7.2"
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
import uuid from "uuid/v4" ; // (Universally Unique Identifier)--generates a unique ID
3
3
import gql from "graphql-tag" ;
4
+ import loadable from "@loadable/component" ;
5
+
4
6
import HeaderEntryForm from "./HeaderEntryForm.jsx" ;
5
7
import BodyEntryForm from "./BodyEntryForm.jsx" ;
6
- import GraphQLBodyEntryForm from "./GraphQLBodyEntryForm.jsx" ;
7
8
import GRPCProtoEntryForm from "./GRPCProtoEntryForm.jsx" ;
8
9
import FieldEntryForm from "./FieldEntryForm.jsx" ;
9
10
import CookieEntryForm from "./CookieEntryForm.jsx" ;
10
11
import historyController from "../../../controllers/historyController" ;
11
12
import GraphQLIntrospectionLog from "./GraphQLIntrospectionLog" ;
12
- import GraphQLVariableEntryForm from "./GraphQLVariableEntryForm" ;
13
+
14
+ // lazy loading to reduce bundle size (codemirror)
15
+ const GraphQLBodyEntryForm = loadable ( ( ) => import ( './GraphQLBodyEntryForm' ) ) ;
16
+ const GraphQLVariableEntryForm = loadable ( ( ) => import ( './GraphQLVariableEntryForm' ) ) ;
17
+
13
18
14
19
const ComposerNewRequest = ( {
15
20
setNewRequestFields,
Original file line number Diff line number Diff line change 1
1
import * as React from "react" ;
2
+ import loadable from "@loadable/component" ;
3
+
4
+ // lazy loading to reduce bundle size (chart.js)
5
+ const BarGraph = loadable ( ( ) => import ( '../display/BarGraph' ) )
2
6
3
- import BarGraph from "../display/BarGraph" ;
4
7
import ReqResContainer from "./ReqResContainer.jsx" ;
5
8
import NavBarContainer from "./NavBarContainer.jsx" ;
6
9
Original file line number Diff line number Diff line change 1
- import Dexie from " dexie" ;
2
-
1
+ import Dexie from ' dexie'
2
+
3
3
const db = new Dexie ( "Swell" ) ;
4
4
5
5
db . on ( "versionchange" , function ( event ) {
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ const path = require("path");
2
2
const HtmlWebpackPlugin = require ( "html-webpack-plugin" ) ;
3
3
const CspHtmlWebpackPlugin = require ( "csp-html-webpack-plugin" ) ;
4
4
const MiniCssExtractPlugin = require ( "mini-css-extract-plugin" ) ;
5
- const nodeExternals = require ( "webpack-node-externals" ) ;
5
+ const BundleAnalyzerPlugin = require ( 'webpack-bundle-analyzer' ) . BundleAnalyzerPlugin ;
6
+
6
7
7
8
module . exports = {
8
9
target : "web" ,
@@ -79,5 +80,11 @@ module.exports = {
79
80
} ,
80
81
} ) ,
81
82
new CspHtmlWebpackPlugin ( ) ,
83
+ // options here: https://github.com/webpack-contrib/webpack-bundle-analyzer
84
+ // set to true to display bundle breakdown
85
+ new BundleAnalyzerPlugin ( {
86
+ openAnalyzer : true ,
87
+ analyzerMode : 'static'
88
+ } ) ,
82
89
] ,
83
90
} ;
You can’t perform that action at this time.
0 commit comments