diff --git a/examples/tictactoe/package.json b/examples/tictactoe/package.json index cbd7f71b..33a57c83 100644 --- a/examples/tictactoe/package.json +++ b/examples/tictactoe/package.json @@ -4,8 +4,8 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "vite", - "build": "tsc -b && vite build", + "dev": "test -n \"$npm_config_address\" && TICTACTOE_ADDRESS=$npm_config_address vite || (echo 'Error: --address parameter is required' && exit 1)", + "build": "test -n \"$npm_config_address\" && TICTACTOE_ADDRESS=$npm_config_address tsc -b && vite build || (echo 'Error: --address parameter is required' && exit 1)", "lint": "eslint .", "preview": "vite preview" }, diff --git a/examples/tictactoe/src/constants/tictactoe.ts b/examples/tictactoe/src/constants/tictactoe.ts index 8a901941..adf572b3 100644 --- a/examples/tictactoe/src/constants/tictactoe.ts +++ b/examples/tictactoe/src/constants/tictactoe.ts @@ -1,4 +1,4 @@ -export const address = '0x81D8CB015e36922F7ecC5CEAdd018dc7327e6FC7' +export const address = import.meta.env.TICTACTOE_ADDRESS export const abi = [ {