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

fix(static-site): remove gatsby-inlined-css #108

Merged
merged 1 commit into from
Jan 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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