Skip to content

Commit 164ed23

Browse files
committed
feat(stackblitz): cleanup
1 parent 9f064b9 commit 164ed23

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import sdk from '@stackblitz/sdk';
2+
// THIS IS OPTION FIVE - OPEN PROJECT (Creates a new project and opens it in a new tab (or in the current window).)
3+
// (project, openOptions)
4+
export const createProject = async () => {
5+
console.log('CREATE_PROJECT');
6+
sdk.openProject(
7+
{
8+
title: 'Banana Project',
9+
description: 'Blank starter project for building ES6 apps.',
10+
template: 'javascript',
11+
files: {
12+
'index.html': `<div id='app'></div>`,
13+
'index.js': `import './style.css';
14+
const appDiv = document.getElementById('app');
15+
appDiv.innerHTML = '<h1>JS Starter</h1>';`,
16+
'style.css': `body { font-family: system-ui, sans-serif; }`,
17+
},
18+
settings: {
19+
compile: {
20+
trigger: 'auto',
21+
clearConsole: false,
22+
},
23+
},
24+
},
25+
{
26+
newWindow: false,
27+
openFile: ['index.js', 'index.html,style.css'],
28+
}
29+
);
30+
};

0 commit comments

Comments
 (0)