diff --git a/.circleci/config.yml b/.circleci/config.yml index 4a7bf05ca0..6bb2599d4b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -80,17 +80,17 @@ jobs: - run: name: prepare font hash command: | - echo "export ICON_FONT_HASH=$(sha1sum packages/IconFont/fonts/welcome-icon-font.woff | awk '{ print $1 }')" >> $BASH_ENV + echo "export ICON_FONT_HASH=$(sha1sum packages/IconFont/fonts/welcome-icon-font.woff2 | awk '{ print $1 }')" >> $BASH_ENV source $BASH_ENV yarn build:core - aws-s3/sync: from: packages/IconFont/fonts - to: s3://welcome-ui/public/fonts/icon-font/$ICON_FONT_HASH/ + to: s3://welcome-ui/public/fonts/icon-font/$ICON_FONT_HASH --cache-control 'public, max-age=31536000' --exclude '*' --include 'welcome-icon-font.woff2' arguments: | --metadata GitCommit=$CIRCLE_SHA1 --delete - aws-s3/sync: from: packages/IconFont/fonts - to: s3://wttj-production/fonts/icon-font/$ICON_FONT_HASH/ + to: s3://wttj-production/fonts/icon-font/$ICON_FONT_HASH --cache-control 'public, max-age=31536000' --exclude '*' --include 'welcome-icon-font.woff2' arguments: | --metadata GitCommit=$CIRCLE_SHA1 --delete diff --git a/scripts/core.sh b/scripts/core.sh index 5f19acebff..97ebf73021 100755 --- a/scripts/core.sh +++ b/scripts/core.sh @@ -1,7 +1,7 @@ #!/bin/bash FONTS_DIR=packages/IconFont/fonts -FONT_FILE="$FONTS_DIR/welcome-icon-font.woff" +FONT_FILE="$FONTS_DIR/welcome-icon-font.woff2" if [[ -f "$FONT_FILE" ]]; then ICON_FONT_HASH=$(sha1sum $FONT_FILE | awk '{ print $1 }') diff --git a/scripts/webfont-build.js b/scripts/webfont-build.js index ca12f5624b..ba329f8965 100644 --- a/scripts/webfont-build.js +++ b/scripts/webfont-build.js @@ -55,9 +55,7 @@ const writeIconFont = files => { dest: `${ICON_FONT_PATH}/fonts`, fontName: FONT_NAME, codepoints: newUnicodeMap, - types: ['woff', 'woff2', 'ttf', 'svg'], - // Pass timestamp so that hash doesn't change between (non-changing) builds - formatOptions: { ttf: { ts: 0 } }, + types: ['woff2'], templateOptions: { classPrefix: 'wui-icon-', baseSelector: 'i', diff --git a/scripts/webfont-deploy.sh b/scripts/webfont-deploy.sh index 24ecdbef5a..288e49e705 100755 --- a/scripts/webfont-deploy.sh +++ b/scripts/webfont-deploy.sh @@ -1,18 +1,18 @@ #!/bin/bash FONTS_DIR=packages/IconFont/fonts -FONT_FILE="$FONTS_DIR/welcome-icon-font.woff" +FONT_FILE="$FONTS_DIR/welcome-icon-font.woff2" if [[ -f "$FONT_FILE" ]]; then ICON_FONT_HASH=$(sha1sum $FONT_FILE | awk '{ print $1 }') echo "Copying fonts to s3://welcome-ui/public/fonts/icon-font/$ICON_FONT_HASH/" - aws s3 sync $FONTS_DIR s3://welcome-ui/public/fonts/icon-font/$ICON_FONT_HASH/ + aws s3 sync $FONTS_DIR s3://welcome-ui/public/fonts/icon-font/$ICON_FONT_HASH/ --cache-control 'public, max-age=31536000' --exclude '*' --include 'welcome-icon-font.woff2' echo "Copying fonts to s3://wttj-production/fonts/icon-font/$ICON_FONT_HASH/" - aws s3 sync $FONTS_DIR s3://wttj-production/fonts/icon-font/$ICON_FONT_HASH/ + aws s3 sync $FONTS_DIR s3://wttj-production/fonts/icon-font/$ICON_FONT_HASH/ --cache-control 'public, max-age=31536000' --exclude '*' --include 'welcome-icon-font.woff2' else echo "Font doesn't exist. Please run 'yarn webfont:build'" exit 1