Reduce amount of chunks

This commit is contained in:
ErickSkrauch 2020-07-21 15:53:34 +03:00
parent 19a9f952ea
commit 54c6578c15
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E
3 changed files with 12 additions and 15 deletions

View File

@ -15,19 +15,11 @@ import { ComponentLoader } from 'app/components/ui/loader';
import styles from './profile.scss';
const Profile = React.lazy(() => import(/* webpackChunkName: "page-profile-index" */ 'app/pages/profile/ProfilePage'));
const ChangePasswordPage = React.lazy(() =>
import(/* webpackChunkName: "page-profile-change-password" */ 'app/pages/profile/ChangePasswordPage'),
);
const ChangeUsernamePage = React.lazy(() =>
import(/* webpackChunkName: "page-profile-change-username" */ 'app/pages/profile/ChangeUsernamePage'),
);
const ChangeEmailPage = React.lazy(() =>
import(/* webpackChunkName: "page-profile-change-email" */ 'app/pages/profile/ChangeEmailPage'),
);
const MultiFactorAuthPage = React.lazy(() =>
import(/* webpackChunkName: "page-profile-mfa" */ 'app/pages/profile/MultiFactorAuthPage'),
);
import Profile from 'app/pages/profile/ProfilePage';
import ChangePasswordPage from 'app/pages/profile/ChangePasswordPage';
import ChangeUsernamePage from 'app/pages/profile/ChangeUsernamePage';
import ChangeEmailPage from 'app/pages/profile/ChangeEmailPage';
import MultiFactorAuthPage from 'app/pages/profile/MultiFactorAuthPage';
interface Props {
userId: number;

View File

@ -21,10 +21,11 @@ import { ComponentLoader } from 'app/components/ui/loader';
import styles from './root.scss';
import siteName from './siteName.intl';
import PageNotFound from 'app/pages/404/PageNotFound';
const ProfileController = React.lazy(() =>
import(/* webpackChunkName: "page-profile-all" */ 'app/pages/profile/ProfileController'),
);
const PageNotFound = React.lazy(() => import(/* webpackChunkName: "page-not-found" */ 'app/pages/404/PageNotFound'));
const RulesPage = React.lazy(() => import(/* webpackChunkName: "page-rules" */ 'app/pages/rules/RulesPage'));
const DevPage = React.lazy(() => import(/* webpackChunkName: "page-dev-applications" */ 'app/pages/dev/DevPage'));
const AuthPage = React.lazy(() => import(/* webpackChunkName: "page-auth" */ 'app/pages/auth/AuthPage'));

View File

@ -211,7 +211,11 @@ const webpackConfig = {
};
if (isAnalyze) {
webpackConfig.plugins.push(new BundleAnalyzerPlugin());
webpackConfig.plugins.push(
new BundleAnalyzerPlugin({
excludeAssets: /^(vendors~intl|locale-|intl)/,
}),
);
}
if (isProduction) {