Fix up build ssr and ci for docs

This commit is contained in:
Sam Nolan 2022-03-25 14:12:14 +11:00
parent 142d846223
commit ce252bb2f9
5 changed files with 24 additions and 5 deletions

View File

@ -79,7 +79,9 @@ jobs:
working-directory: packages/website working-directory: packages/website
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install dependencies - name: Install dependencies from monorepo level
run: yarn run: cd ../../ && yarn
- name: Build rescript in squiggle-lang
run: cd ../squiggle-lang && yarn build
- name: Build website assets - name: Build website assets
run: yarn build run: yarn build

View File

@ -1,3 +1,7 @@
module.exports = { module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], presets: [
require.resolve('@docusaurus/core/lib/babel/preset'),
["@babel/preset-react", {"runtime": "automatic"}]
],
}; };

View File

@ -2,7 +2,7 @@
sidebar_position: 7 sidebar_position: 7
--- ---
import { SquiggleEditor } from '@quri/squiggle-components' import { SquiggleEditor } from '../src/components/SquiggleEditor'
# Squiggle Functions Reference # Squiggle Functions Reference

View File

@ -2,7 +2,7 @@
sidebar_position: 2 sidebar_position: 2
--- ---
import { SquiggleEditor } from '@quri/squiggle-components' import { SquiggleEditor } from '../src/components/SquiggleEditor'
# Squiggle Language # Squiggle Language

View File

@ -0,0 +1,13 @@
import BrowserOnly from '@docusaurus/BrowserOnly';
export function SquiggleEditor(props) {
return (
<BrowserOnly fallback={<div>Loading...</div>}>
{() => {
const LibComponent =
require('@quri/squiggle-components').SquiggleEditor;
return <LibComponent {...props} />;
}}
</BrowserOnly>
);
}