Skip to content

Commit

Permalink
Merge pull request #108 from ivan-aksamentov/fix/remove-explicit-inli…
Browse files Browse the repository at this point in the history
…ne-css

fix(static-site): remove gatsby-inlined-css
  • Loading branch information
jameshadfield authored Jan 30, 2020
2 parents a94e975 + c0c1615 commit 53e5e9d
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions static-site/src/html.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,9 @@
import React from "react";
import favicon from "../../favicon.png";

let inlinedStyles = "";
if (process.env.NODE_ENV === "production") {
try {
// eslint-disable-next-line import/no-webpack-loader-syntax
inlinedStyles = require("!raw-loader!../public/styles.css");
} catch (e) {
console.log(e);
}
}

// eslint-disable-next-line react/prefer-stateless-function
export default class HTML extends React.Component {
render() {
let css;
if (process.env.NODE_ENV === "production") {
css = (
<style
id="gatsby-inlined-css"
dangerouslySetInnerHTML={{ __html: inlinedStyles }}
/>
);
}
return (
<html lang="en">
<head>
Expand All @@ -36,7 +17,6 @@ export default class HTML extends React.Component {
/>
{this.props.headComponents}
<link rel="shortcut icon" href={favicon} />
{css}
</head>
<body>
<div
Expand Down

0 comments on commit 53e5e9d

Please sign in to comment.