Skip to content

Commit

Permalink
Merge branch 'main' into chore/add-storybook-ci-option-to-test-start-…
Browse files Browse the repository at this point in the history
…storybook-ok
  • Loading branch information
virtuoushub committed Nov 3, 2021
2 parents 35f1282 + dffc37e commit be4ea3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/internal/src/build/babel/web.ts
Expand Up @@ -28,11 +28,12 @@ export const registerWebSideBabelHook = ({
// Even though we specify the config file, babel will still search for .babelrc
// and merge them because we have specified the filename property, unless babelrc = false
registerBabel({
root: getPaths().base,
configFile: getWebSideBabelConfigPath(), // incase user has a custom babel.config.js in api
babelrc: false,
extensions: ['.js', '.ts', '.tsx', '.jsx'],
plugins: [...plugins],
ignore: ['node_modules'],
ignore: [/node_modules/],
cache: false,
overrides,
})
Expand Down
9 changes: 7 additions & 2 deletions packages/prerender/src/runPrerender.tsx
@@ -1,4 +1,5 @@
import fs from 'fs'
import path from 'path'

import React from 'react'

Expand Down Expand Up @@ -96,11 +97,15 @@ export const writePrerenderedHtmlFile = (
outputHtmlPath: string,
content: string
) => {
const outputHtmlAbsPath = path.join(getPaths().base, outputHtmlPath)
// Copy default index.html to 200.html first
// This is to prevent recursively rendering the home page
if (outputHtmlPath === 'web/dist/index.html') {
fs.copyFileSync(outputHtmlPath, 'web/dist/200.html')
fs.copyFileSync(
outputHtmlAbsPath,
path.join(getPaths().base, 'web/dist/200.html')
)
}

writeToDist(outputHtmlPath, content)
writeToDist(outputHtmlAbsPath, content)
}

0 comments on commit be4ea3d

Please sign in to comment.