How can i lazy load css file or split main.css to load?

#1

main.css is loaded slowly when i run my web app in browser
main.css file size is 1.6MB in my project

How to Do?
Thanks in advance for your help

ionic info:
global packages:

@ionic/cli-utils : 1.5.0
Cordova CLI      : 7.0.1
Ionic CLI        : 3.5.0

local packages:

@ionic/app-scripts              : 2.0.2
@ionic/cli-plugin-cordova       : 1.4.1
@ionic/cli-plugin-ionic-angular : 1.3.2
Cordova Platforms               : none
Ionic Framework                 : ionic-angular 3.5.3

System:

Node       : v6.10.0
OS         : macOS Sierra
Xcode      : Xcode 8.3.2 Build version 8E2002
ios-deploy : 1.9.1
ios-sim    : 5.0.13
npm        : 3.10.10
How-to split CSS in different bundles for lazy loading
#2

Here is a great article by Julien Renaux about optimizing the CSS bundle for PWA.

1 Like