Skip to content

Commit

Permalink
fix: hotfix to pnpm version 6 (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonNotJson authored Aug 3, 2023
1 parent ae0870f commit 3858dea
Showing 1 changed file with 45 additions and 49 deletions.
94 changes: 45 additions & 49 deletions lib/configs/amplify/build-setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 .',
],
};
Expand All @@ -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 = {
Expand All @@ -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,
},
],
});
],
});

0 comments on commit 3858dea

Please sign in to comment.