From 05d2da4113d5c724549ae032ab4bf532abcd791d Mon Sep 17 00:00:00 2001 From: Baz Utsahajit Date: Tue, 19 Dec 2023 15:09:35 +0000 Subject: [PATCH] Tweaked Sandpack Dependencies Config --- .../Playground/PixiPlayground/useSandpackConfiguration.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/Playground/PixiPlayground/useSandpackConfiguration.ts b/src/components/Playground/PixiPlayground/useSandpackConfiguration.ts index 20c337078..7836cead5 100644 --- a/src/components/Playground/PixiPlayground/useSandpackConfiguration.ts +++ b/src/components/Playground/PixiPlayground/useSandpackConfiguration.ts @@ -71,7 +71,13 @@ const useDependencies = ({ isPixiWebWorkerVersion, isPixiDevVersion, pixiVersion const pixiPackageName = isPixiWebWorkerVersion ? '@pixi/webworker' : 'pixi.js'; const getPackageVersion = (packageName: string) => (isPixiDevVersion ? `${pixiVersion}/${packageName}` : pixiVersion); - const packages = [pixiPackageName, '@pixi/graphics-extras', '@pixi/math-extras']; + const packages = [pixiPackageName]; + + // Add these packages if we're using a version of pixi that doesn't have them built in, ie. < v8 + if (Number(pixiVersion.split('.')[0]) < 8) + { + packages.push('@pixi/graphics-extras', '@pixi/math-extras'); + } const dependencies = packages.reduce( (deps, packageName) => ({