Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow inputs.src.hook to expand variables #92

Open
divillysausages opened this issue Feb 4, 2022 · 0 comments
Open

Allow inputs.src.hook to expand variables #92

divillysausages opened this issue Feb 4, 2022 · 0 comments

Comments

@divillysausages
Copy link

I have multiple scripts in my package.json, such as:

"build-prod": "webpack --env stage='prod'",
"build-staging": "webpack --env stage='staging'"

In serverless.yml, I can use variables such as ${stage} for pretty much everything (e.g. domain, bucketName, etc), EXCEPT for the hook

So this works:

inputs:
  src:
    src: ./src
    hook: npm run build-prod # hook to run before building
    dist: ./.build # output folder
  domain: ${stage}.mydomain.com # domain name
  region: ${env:REGION}
  bucketName: ${stage}.mydomain.com

but this doesn't

inputs:
  src:
    src: ./src
    hook: npm run build-${stage} # hook to run before building
    dist: ./.build # output folder
  domain: ${stage}.mydomain.com # domain name
  region: ${env:REGION}
  bucketName: ${stage}.mydomain.com

It would be great if that was possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant