components
components copied to clipboard
How to run a different hook command for each stage?
Description
I want to run different build commands for my static website, depending on the stage.
The following does not work, because the ${stage}
is empty, even when explicitly setting the stage via the --stage
cli parameter:
org: lobosque
app: foo-frontend
name: vue-starter
component: website
inputs:
domain: ${param:domain}
src:
src: ./src
hook: npm run build-${stage}
dist: ./dist
Result:
Deploying...
Error: Failed running "src.hook": "npm run build-${stage}" due to the following error: Command failed: npm run build-${stage}
npm ERR! missing script: build-