Skip to content

Commit d2c5624

Browse files
committed
Fix critical CSS and paths to assets
1 parent 62f2d04 commit d2c5624

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

critical.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const critical = require('critical');
2+
3+
critical.generate({
4+
src: 'index.html',
5+
css: ['assets/dist/app.css'],
6+
target: 'assets/dist/critical.css',
7+
width: 1440,
8+
height: 900
9+
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"start": "webpack --watch --NODE_ENV=development",
88
"optisize": "optisize --src=\"./assets/images\"",
99
"html": "php index.php > index.html",
10-
"critical": "critical index.html > assets/dist/critical.css",
10+
"critical": "node critical.js",
1111
"rm-html": "rm index.html",
1212
"pwa": "create-pwa --icon=\"./assets/images/favicon/icon.png\" --launch=\"./assets/images/favicon/launch.png\"",
1313
"prod": "yarn build && yarn html && yarn critical && yarn rm-html",

0 commit comments

Comments
 (0)