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
-`files: Record<string, string>`: files available to the runtime. `index.js` is the entry file.
39
+
-`resolveModule?: (specifier: string) => string`: maps bare imports such as `react` or `lucide-react` to browser-loadable module URLs.
40
+
-`onError?: (...data: any[]) => void`: receives runtime or transform errors.
41
+
-`tailwindSrc?: string | false`: Tailwind browser script URL injected into the iframe. Defaults to `https://unpkg.com/@tailwindcss/browser@4`; pass `false` to disable it.
-`resolveModule?: (specifier: string) => string`: maps bare imports to browser-loadable module URLs.
79
+
-`tailwindSrc?: string | false`: Tailwind browser script URL injected into the iframe. Defaults to `https://unpkg.com/@tailwindcss/browser@4`; pass `false` to disable it.
Copy file name to clipboardExpand all lines: README.md
+9-78Lines changed: 9 additions & 78 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
8
8
devjar is a library that enables you to live test and share your code snippets and examples with others. devjar will generate a live code editor where you can run your code snippets and view the results in real-time based on the provided code content of your React app.
9
9
10
-
**Notice:** devjar only works for browser runtime at the moment. It will always render the default export component in `index.js` as the app entry.
10
+
**Notice:** devjar requires React 19 and only works for browser runtime at the moment. It will always render the default export component in `index.js` as the app entry.
11
11
12
12
## Install
13
13
@@ -24,8 +24,9 @@ pnpm add devjar
24
24
**Props**
25
25
26
26
*`files`: An object that specifies the files you want to include in your development environment.
27
-
*`getModuleUrl`: A function that maps module names to CDN URLs.
27
+
*`resolveModule`: A function that maps module specifiers to browser-loadable module URLs.
28
28
*`onError`: Callback function of error event from the iframe sandbox. By default `console.log`.
@@ -57,7 +58,8 @@ A hook that provides lower-level control over the live code execution environmen
57
58
**Parameters**
58
59
59
60
*`options`
60
-
*`getModulePath(module)`: A function that receives the module name and returns the CDN url of each imported module path. For example, import React from 'react' will load React from skypack.dev/react.
61
+
*`resolveModule(specifier)`: A function that receives a module specifier and returns the browser-loadable URL. For example, import React from 'react' will load React from skypack.dev/react.
0 commit comments