mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-19 12:16:43 +00:00
[ty] fix ty playground initialization and vite optimization issues
This commit is contained in:
parent
698231a47a
commit
981ce98c83
2 changed files with 3 additions and 3 deletions
|
|
@ -501,7 +501,7 @@ export interface InitializedPlayground {
|
||||||
|
|
||||||
// Run once during startup. Initializes monaco, loads the wasm file, and restores the previous editor state.
|
// Run once during startup. Initializes monaco, loads the wasm file, and restores the previous editor state.
|
||||||
async function startPlayground(): Promise<InitializedPlayground> {
|
async function startPlayground(): Promise<InitializedPlayground> {
|
||||||
const ty = await import("../ty_wasm");
|
const ty = await import("ty_wasm");
|
||||||
await ty.default();
|
await ty.default();
|
||||||
const version = ty.version();
|
const version = ty.version();
|
||||||
const monaco = await loader.init();
|
const monaco = await loader.init();
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ const PYODIDE_EXCLUDE = [
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), tailwindcss(), viteStaticCopyPyodide()],
|
plugins: [react(), tailwindcss(), viteStaticCopyPyodide()],
|
||||||
optimizeDeps: { exclude: ["pyodide"] },
|
optimizeDeps: { exclude: ["pyodide", "ty_wasm"] },
|
||||||
});
|
});
|
||||||
|
|
||||||
export function viteStaticCopyPyodide() {
|
export function viteStaticCopyPyodide() {
|
||||||
|
|
@ -23,7 +23,7 @@ export function viteStaticCopyPyodide() {
|
||||||
return viteStaticCopy({
|
return viteStaticCopy({
|
||||||
targets: [
|
targets: [
|
||||||
{
|
{
|
||||||
src: [join(pyodideDir, "*"), ...PYODIDE_EXCLUDE],
|
src: [join(pyodideDir, "*").replace(/\\/g, "/"), ...PYODIDE_EXCLUDE],
|
||||||
dest: "assets",
|
dest: "assets",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue