Skip to content

Commit

Permalink
chore: fix playground page being opened during test
Browse files Browse the repository at this point in the history
  • Loading branch information
guansss committed Dec 7, 2023
1 parent 8ca79b3 commit 1e2fd36
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if (!existsSync(cubism2Core) || !existsSync(cubism4Core)) {

export default defineConfig(({ command, mode }) => {
const isDev = command === "serve";
const isTest = mode === "test";

return {
define: {
Expand All @@ -33,7 +34,7 @@ export default defineConfig(({ command, mode }) => {
},
},
server: {
open: "/playground/index.html",
open: !isTest && "/playground/index.html",
},
build: {
target: "es6",
Expand Down Expand Up @@ -68,10 +69,10 @@ export default defineConfig(({ command, mode }) => {
plugins: [
// pixi.js imports a polyfill package named "url", which breaks Vitest
// see https://github.com/vitest-dev/vitest/issues/4535
isDev && nodePolyfills(),
isTest && nodePolyfills(),

isDev && testRpcPlugin(),
isDev && {
isTest && testRpcPlugin(),
isTest && {
name: "load-cubism-core",
enforce: "post" as const,
transform(code, id) {
Expand Down

0 comments on commit 1e2fd36

Please sign in to comment.