Skip to content

Commit

Permalink
Configure local development for playground
Browse files Browse the repository at this point in the history
  • Loading branch information
nmn committed Dec 5, 2023
1 parent e1217f4 commit 3b28c6e
Show file tree
Hide file tree
Showing 4 changed files with 661 additions and 25 deletions.
10 changes: 7 additions & 3 deletions apps/docs/components/playground-utils/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const jsxSyntaxPlugin = require('@babel/plugin-syntax-jsx');
module.exports = {
plugins: [
tsSyntaxPlugin,
[tsSyntaxPlugin, { isTSX: true }],
jsxSyntaxPlugin,
[
"@stylexjs/babel-plugin",
Expand Down Expand Up @@ -64,8 +64,12 @@ module.exports = {
import * as React from 'react';
import * as stylex from "@stylexjs/stylex";
export default function Card({ onClick, children, em = false }) {
const props = stylex.props(styles.base, em && styles.emphasise);
export default function Card({ children, em = false, ...props }) {
return (
<div {...props} {...stylex.props(styles.base, em && styles.emphasise)}>
{children}
</div>
);
}
const styles = stylex.create({
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"serve": "serve ./build -c ../serve.json",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"ci": "yarn lint && yarn format:diff",
Expand Down Expand Up @@ -44,6 +44,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"mkdirp": "^1.0.4",
"prettier": "^2.7.1",
"serve": "^14.2.1",
"stylelint": "^14.9.1"
},
"browserslist": {
Expand Down
21 changes: 21 additions & 0 deletions apps/docs/serve.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"headers": [
{
"source": "**/**",
"headers": [
{
"key": "Cross-Origin-Embedder-Policy",
"value": "require-corp"
},
{
"key": "Cross-Origin-Opener-Policy",
"value": "same-origin"
},
{
"key": "Cross-Origin-Resource-Policy",
"value": "same-site"
}
]
}
]
}
Loading

0 comments on commit 3b28c6e

Please sign in to comment.