Skip to content

Commit

Permalink
Actually package the edge-to-origin lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
huntharo committed May 23, 2022
1 parent e150246 commit 95e770b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"format": "prettier --write \"packages/**/*.{js,ts}\"",
"start:publish": "node packages/microapps-publish/dist/src/index.js",
"start:publish:debug": "ts-node --inspect=5858 --debug-brk --ignore false packages/microapps-publish/src/index.ts",
"build": "yarn build:tsc && yarn esbuild:edge-to-origin",
"build:tsc": "tsc --build tsconfig.json",
"build": "tsc --build tsconfig.json",
"build:publish": "tsc --build tsconfig.publish.json",
"esbuild:deployer": "esbuild packages/microapps-deployer/src/index.ts --bundle --minify --sourcemap --platform=node --target=node14 --external:aws-sdk --outfile=packages/cdk/dist/microapps-deployer/index.js",
"esbuild:router": "esbuild packages/microapps-router/src/index.ts --bundle --minify --sourcemap --platform=node --target=node14 --external:aws-sdk --outfile=packages/cdk/dist/microapps-router/index.js",
Expand Down
3 changes: 3 additions & 0 deletions packages/microapps-cdk/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/microapps-cdk/.projenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ project.preCompileTask.exec(
// 'if [ -d ../../node_modules_hide ] ; then mv ../../node_modules_hide ../../node_modules; fi',
// );

project.compileTask.exec(
'esbuild ../microapps-edge-to-origin/src/index.ts --bundle --minify --sourcemap --platform=node --target=node14 --external:aws-sdk --outfile=lib/microapps-edge-to-origin/index.js',
);
project.compileTask.exec(
'esbuild ../microapps-deployer/src/index.ts --bundle --minify --sourcemap --platform=node --target=node14 --external:aws-sdk --outfile=lib/microapps-deployer/index.js',
);
Expand Down
2 changes: 1 addition & 1 deletion packages/microapps-cdk/src/MicroAppsEdgeToOrigin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ replaceHostHeader: ${props.replaceHostHeader}`;
...(removalPolicy ? { removalPolicy } : {}),
};
if (
process.env.NODE_ENV === 'test' ||
process.env.NODE_ENV === 'test' &&
existsSync(path.join(__dirname, '..', '..', 'microapps-edge-to-origin', 'dist', 'index.js'))
) {
// Emit the config file from the construct options
Expand Down
4 changes: 4 additions & 0 deletions packages/microapps-edge-to-origin/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
originRegion: ${Token[AWS.Region.11]}
signingMode: sign
addXForwardedHostHeader: true
replaceHostHeader: true

0 comments on commit 95e770b

Please sign in to comment.