Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the webAPP is slow after installing the package (caused by CSS BLOB files) #53

Closed
davidescurria opened this issue Apr 10, 2019 · 3 comments
Labels

Comments

@davidescurria
Copy link

I noticed that after installing the package the webAPP slows down at startup.
Analyzing the behavior through the tools provided by the browser I noticed that 3 BLOB files are created. They are 3 CSS files (adding up the CSS classes are about 10). The problem is that it takes 5 to 7 seconds to process these files. Is it possible to disable the creation of these 3 BLOB files ?

@davidescurria davidescurria changed the title the webAPP is slow after installing the package the webAPP is slow after installing the package (caused by CSS BLOB files) Apr 10, 2019
@zhenyanghua
Copy link
Owner

From webpack site:

Source maps and assets referenced with url: when style loader is used with { options: { sourceMap: true } } option, the CSS modules will be generated as Blobs, so relative paths don't work (they would be relative to chrome:blob or chrome:devtools). In order for assets to maintain correct paths setting output.publicPath property of webpack configuration must be set, so that absolute paths are generated. Alternatively you can enable the convertToAbsoluteUrls option mentioned above.

If we change the sourcemap option to false, it may not generate the blob. try it out.

@davidescurria
Copy link
Author

I'm developing my project with Angular 4. I tried to add sourceMap: false but it is generated anyway

@zhenyanghua
Copy link
Owner

You need to rebuild this project with the webpack css/sass loader option: sourceMap: false, and then build it. You don't need to set the sourceMap to false if you don't open the dev tool in your browser in production, it effectively won't download the sourceMap and blobs. But if you choose to keep your sourcemap a secret in production, you can just build this project with sourceMap to false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants