Skip to content

Commit

Permalink
Fix critical CSS and paths to assets
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptex committed Jan 7, 2021
1 parent 62f2d04 commit d2c5624
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions critical.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const critical = require('critical');

critical.generate({
src: 'index.html',
css: ['assets/dist/app.css'],
target: 'assets/dist/critical.css',
width: 1440,
height: 900
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "webpack --watch --NODE_ENV=development",
"optisize": "optisize --src=\"./assets/images\"",
"html": "php index.php > index.html",
"critical": "critical index.html > assets/dist/critical.css",
"critical": "node critical.js",
"rm-html": "rm index.html",
"pwa": "create-pwa --icon=\"./assets/images/favicon/icon.png\" --launch=\"./assets/images/favicon/launch.png\"",
"prod": "yarn build && yarn html && yarn critical && yarn rm-html",
Expand Down

0 comments on commit d2c5624

Please sign in to comment.