Skip to content

Commit

Permalink
fix(demo): disable csb
Browse files Browse the repository at this point in the history
  • Loading branch information
izkizk8 committed Jun 15, 2024
1 parent b1ee37a commit fe87df5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions doc-site/.dumi/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,20 @@ export function modifyCodeSandboxData(memo: { files: IFiles }, props: IPreviewer

function createTemplate(memo: { files: IFiles } | Project, props: IPreviewerProps, isStackBlitz: boolean) {
Object.entries(memo.files).forEach(([name, content]) => {
if (name === 'sandbox.config.json') {
memo.files[name] = {
content: JSON.stringify({
template: 'node',
startScript: 'dev',
}, null, 2),
isBinary: false,
};
return;
}
if (name !== 'index.html' && name !== 'package.json') {
memo.files[`src/${name}`] = content;
}
if (name !== 'sandbox.config.json') {
delete memo.files[name];
}
delete memo.files[name];
});
Object.entries(template).forEach(([name, content]) => {
if (name === 'package.json') {
Expand Down Expand Up @@ -114,7 +122,7 @@ export default defineConfig({
`,
'package.json': `
{
"name": "An auto-generated demo by dumi",
"name": "demo",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion doc-site/.dumi/theme/builtins/Previewer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-nocheck
import Previewer from 'dumi/theme-default/builtins/Previewer';
export default (props) => {
return <Previewer {...props} />;
return <Previewer {...props} disabledActions={['CSB']} />;
};

0 comments on commit fe87df5

Please sign in to comment.