You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/sandpack/README.md
+57-1Lines changed: 57 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Online code playgrounds are getting more popular: they provide an easy way to pl
8
8
9
9
CodeSandbox came along, and still had a pretty basic bundler. However, as CodeSandbox got more popular its bundler got more advanced. Nowadays the bundler is used for all kinds of bigger web projects, and it would be a shame if others couldn't use the functionality.
10
10
11
-
This library acts as an interface with the bundler of CodeSandbox. It allows you to run any code on a web page, from Vue projects to React projects to Parcel projects. With everything that CodeSandbox supports as well.
11
+
This library acts as an interface with the bundler of CodeSandbox. It allows you to run any code on a web page, from Vue projects to React projects to Parcel projects. With everything that CodeSandbox supports client side as well.
12
12
13
13
## So what can this bundler do?
14
14
@@ -132,3 +132,59 @@ const App = () => (
132
132
```
133
133
134
134
The above code will render a File Explorer, a working code editor and a preview with browser navigation. For more info about `react-sandpack` you can go here: https://github.com/CompuIves/codesandbox-client/tree/master/packages/react-sandpack.
135
+
136
+
### SandboxInfo Argument
137
+
138
+
The second argument in the constructor of `Manager` is all sandbox info. It has this structure:
139
+
140
+
```ts
141
+
{
142
+
/**
143
+
* Files, keys are paths.
144
+
**/
145
+
files: {
146
+
[path: string]: {
147
+
code: string
148
+
}
149
+
},
150
+
/**
151
+
* Dependencies, supports npm and GitHub dependencies
152
+
**/
153
+
dependencies?: {
154
+
[dependencyName: string]: string
155
+
},
156
+
/**
157
+
* Default file to evaluate
158
+
**/
159
+
entry?:string,
160
+
/**
161
+
* The sandbox template to use, this is inferred from the files and package.json if not specified
0 commit comments