File tree 1 file changed +30
-0
lines changed
integrations/stackblitz/src
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
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
+ } ;
You can’t perform that action at this time.
0 commit comments