diff --git a/sandpack-client/package.json b/sandpack-client/package.json index ebb5f143a..193b8e52c 100644 --- a/sandpack-client/package.json +++ b/sandpack-client/package.json @@ -20,8 +20,7 @@ "build:types": "tsc -p tsconfig.json", "lint": "tslint -t codeFrame 'src/**/*.ts' 'test/**/*.ts'", "build:publish": "yarn build && gulp", - "build:bundler": "gulp", - "start": "tsc -p tsconfig.esm.json --watch" + "build:bundler": "gulp" }, "files": [ "dist", diff --git a/sandpack-client/src/client.ts b/sandpack-client/src/client.ts index b8675772d..56bfc87db 100644 --- a/sandpack-client/src/client.ts +++ b/sandpack-client/src/client.ts @@ -237,7 +237,10 @@ export class SandpackClient { sandboxInfo = this.sandboxInfo, isInitializationCompile?: boolean ): void { - this.sandboxInfo = sandboxInfo; + this.sandboxInfo = { + ...this.sandboxInfo, + ...sandboxInfo, + }; const files = this.getFiles(); @@ -279,6 +282,11 @@ export class SandpackClient { {} ); + const template = + this.sandboxInfo.template || getTemplate(packageJSON, normalizedModules); + + console.log({ template, sandboxInfo: this.sandboxInfo }); + this.dispatch({ type: "compile", codesandbox: true, @@ -290,9 +298,7 @@ export class SandpackClient { hasFileResolver: Boolean(this.options.fileResolver), disableDependencyPreprocessing: this.sandboxInfo.disableDependencyPreprocessing, - template: - this.sandboxInfo.template || - getTemplate(packageJSON, normalizedModules), + template, showOpenInCodeSandbox: this.options.showOpenInCodeSandbox ?? true, showErrorScreen: this.options.showErrorScreen ?? true, showLoadingScreen: this.options.showLoadingScreen ?? true,