From a8eef9deb0e90478162c9038e2845caf36face09 Mon Sep 17 00:00:00 2001 From: tubone24 Date: Mon, 8 Nov 2021 00:53:04 +0900 Subject: [PATCH 1/2] add /* webpackPrefetch: true */ --- src/templates/blog-post.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates/blog-post.js b/src/templates/blog-post.js index 98c1e97538..74a753996a 100644 --- a/src/templates/blog-post.js +++ b/src/templates/blog-post.js @@ -17,7 +17,7 @@ import Header from '../components/Header'; // import TableOfContent from '../components/TableOfContent'; import ShareBox from '../components/ShareBox'; import TimeToRead from '../components/TimeToRead'; -const Gitalk = loadable(() => import('../components/Gitalk')); +const Gitalk = loadable(() => import(/* webpackPrefetch: true */ '../components/Gitalk')); // Styles import './blog-post.scss'; From 73187accd31e7e56f0ad8ca0d4cafc51b14d7edb Mon Sep 17 00:00:00 2001 From: tubone24 Date: Mon, 8 Nov 2021 00:57:43 +0900 Subject: [PATCH 2/2] fix css --- src/components/Gitalk/index.js | 1 + src/templates/blog-post.js | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/Gitalk/index.js b/src/components/Gitalk/index.js index 3cf6792328..3e299abe74 100644 --- a/src/components/Gitalk/index.js +++ b/src/components/Gitalk/index.js @@ -1,4 +1,5 @@ import React, {Component} from 'react' +import 'gitalk/dist/gitalk.css'; const isBrowser = typeof window !== 'undefined'; const Gitalk = isBrowser ? require('gitalk') : undefined; diff --git a/src/templates/blog-post.js b/src/templates/blog-post.js index 74a753996a..2f59eb71dd 100644 --- a/src/templates/blog-post.js +++ b/src/templates/blog-post.js @@ -5,8 +5,6 @@ import React, { Component } from 'react'; import loadable from '@loadable/component' import { graphql } from 'gatsby'; -import 'gitalk/dist/gitalk.css'; - import { parseDate } from '../api'; import Sidebar from '../components/Sidebar';