-
Notifications
You must be signed in to change notification settings - Fork 0
Front end optimizations
Vojtech Mašek edited this page Aug 19, 2019
·
2 revisions
- AOT
- lazy loading
var brotli = require('brotli');
var fs = require('fs');
var brotliSettings = {
extension: 'br',
skipLarger: true,
mode: 1,
quality: 10,
lgwin: 12, // default
};
fs.readdirSync('dist/').forEach(function(file) {
if (file.endsWith('.js') || file.endsWith('.css') || file.endsWith('.html')) {
var result = brotli.compress(fs.readFileSync('dist/' + file), brotliSettings);
fs.writeFileSync('dist/' + file + '.br', result);
}
});
{
/* ... */
"scripts": {
"build-prod": "ng build --prod && node compress.js"
}
/* ... */
}
- move font importing to
index.html
- fonts and style sheets should be imported here, otherwise the downloading starts after the CSS style sheet is retrieved
- fonts should be optimized and retrieved only for the font-weight that is actually used
-
FE / Angular
-
Golang
-
DevOps
-
Agile process and SCRUM
-
Internship
-
Bootcamp