1
1
mirror of https://github.com/primer/css.git synced 2024-12-29 09:06:07 +03:00

fix: load static primer.css in production

This commit is contained in:
Shawn Allen 2019-01-15 13:07:27 -08:00
parent 209bef3d7e
commit 3074c9eaa5

View File

@ -2,12 +2,13 @@ import Router from 'next/router'
import getConfig from 'next/config'
import TreeModel from 'tree-model'
export const CommonStyles = () => (
<>
<link rel="stylesheet" href={assetPrefix + '/_next/static/css/styles.chunk.css'} />
<link rel="stylesheet" href={getAssetPath('github/styleguide.css')} />
</>
)
export const CommonStyles = () => {
const sheets = [
config.production ? getAssetPath('primer.css') : assetPrefix + '/_next/static/css/styles.chunk.css',
getAssetPath('github/styleguide.css')
]
return sheets.map(href => <link href={href} rel="stylesheet" />)
}
export const CommonScripts = () => (
<script src={getAssetPath('github/styleguide.js')} />