diff --git a/lib/configs/amplify/build-setting.ts b/lib/configs/amplify/build-setting.ts index 679f139ff..5d471da4c 100644 --- a/lib/configs/amplify/build-setting.ts +++ b/lib/configs/amplify/build-setting.ts @@ -5,10 +5,7 @@ export const BIT_TOKEN = process.env.BIT_TOKEN!; export const FEEDS_DEPLOY_KEY = process.env.DEPLOY_KEY!; const preBuild = { - commands: [ - 'npm install -g pnpm', - 'pnpm install --filter .', - ], + commands: ['npm install -g pnpm@6', 'pnpm install --filter .'], }; const preBuildForFeeds = { @@ -18,7 +15,7 @@ const preBuildForFeeds = { 'git submodule init', 'git submodule update --remote', 'yum -y install make nasm autoconf automake libtool dpkg pkgconfig libpng libpng-dev g++', - 'npm install -g pnpm', + 'npm install -g pnpm@6', 'pnpm install --filter .', ], }; @@ -28,10 +25,7 @@ const prodBuild = { }; const devBuild = { - commands: [ - 'export PREFIX="${AWS_BRANCH//[\\/_]/-}"', - 'pnpm run build-dev', - ], + commands: ['export PREFIX="${AWS_BRANCH//[\\/_]/-}"', 'pnpm run build-dev'], }; const artifacts = { @@ -42,48 +36,50 @@ const artifacts = { const cache = { paths: ['node_modules/**/*', '~/.pnpm-store'] }; -export const microAppBuildSpec = (name: string) => codebuild.BuildSpec.fromObject({ - version: 1, - applications: [ - { - frontend: { - phases: { - preBuild: name == 'feeds' ? preBuildForFeeds : preBuild, - build: prodBuild, - }, - artifacts: artifacts, - cache: cache, - customHeaders: [ - { - pattern: '**/*', - headers: securityHeaders.concat(microAppCorsHeader), +export const microAppBuildSpec = (name: string) => + codebuild.BuildSpec.fromObject({ + version: 1, + applications: [ + { + frontend: { + phases: { + preBuild: name == 'feeds' ? preBuildForFeeds : preBuild, + build: prodBuild, }, - ], + artifacts: artifacts, + cache: cache, + customHeaders: [ + { + pattern: '**/*', + headers: securityHeaders.concat(microAppCorsHeader), + }, + ], + }, + appRoot: name, }, - appRoot: name, - }, - ], -}); + ], + }); -export const microAppDevBuildSpec = (name: string) => codebuild.BuildSpec.fromObject({ - version: 1, - applications: [ - { - frontend: { - phases: { - preBuild: name == 'feeds' ? preBuildForFeeds : preBuild, - build: devBuild, - }, - artifacts: artifacts, - cache: cache, - customHeaders: [ - { - pattern: '**/*', - headers: microAppCorsHeader, +export const microAppDevBuildSpec = (name: string) => + codebuild.BuildSpec.fromObject({ + version: 1, + applications: [ + { + frontend: { + phases: { + preBuild: name == 'feeds' ? preBuildForFeeds : preBuild, + build: devBuild, }, - ], + artifacts: artifacts, + cache: cache, + customHeaders: [ + { + pattern: '**/*', + headers: microAppCorsHeader, + }, + ], + }, + appRoot: name, }, - appRoot: name, - }, - ], -}); + ], + });