Skip to content

Instantly share code, notes, and snippets.

@wcheek
Last active October 21, 2022 01:30
Show Gist options
  • Save wcheek/b8e26ca79127ff3c44481bc17179fc5c to your computer and use it in GitHub Desktop.
Save wcheek/b8e26ca79127ff3c44481bc17179fc5c to your computer and use it in GitHub Desktop.
Trying to bundle web app locally.
s3_deploy.BucketDeployment(
scope=self,
id="websiteDeploy",
sources=[
s3_deploy.Source.asset(
path="website",
bundling=BundlingOptions(
command=[
"bash",
"-c",
[
" && ".join(
[
"npm install vite",
"npm run build",
"cp -r /asset-input/dist/* /asset-output/",
]
)
],
],
image=DockerImage.from_registry("node:lts"),
## INCORRECT IMPLEMENTATION
local=ILocalBundling.try_bundle(
command=[
"bash",
"-c",
[
" && ".join(
[
"npm install vite",
"npm run build",
"cp -r /asset-input/dist/* /asset-output/",
]
)
],
],
),
),
)
],
destination_bucket=bucket,
distribution=distribution,
distribution_paths=["/*"],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment