mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 10:58:23 -05:00
1fea24fd5c
From https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching > "no-cache" indicates that the returned response can't be used to satisfy a subsequent request to the same URL without first checking with the server if the response has changed. As a result, if a proper validation token (ETag) is present, no-cache incurs a roundtrip to validate the cached response, but can eliminate the download if the resource has not changed. This is what we want to happen.
82 lines
1.6 KiB
Makefile
82 lines
1.6 KiB
Makefile
ESLINT=./node_modules/.bin/eslint
|
|
NODE=node
|
|
SASSLINT=./node_modules/.bin/sass-lint -v
|
|
S3CMD=s3cmd sync -P --delete-removed --add-header=Cache-Control:no-cache,public,max-age=3600
|
|
TAP=./node_modules/.bin/tap
|
|
WATCH=./node_modules/.bin/watch
|
|
WEBPACK=./node_modules/.bin/webpack
|
|
|
|
# ------------------------------------
|
|
|
|
build:
|
|
@make clean
|
|
@make translations
|
|
@make webpack
|
|
|
|
clean:
|
|
rm -rf ./build
|
|
rm -rf ./intl
|
|
mkdir -p build
|
|
mkdir -p intl
|
|
|
|
|
|
deploy:
|
|
@make build
|
|
@make sync
|
|
|
|
translations:
|
|
./bin/build-locales intl
|
|
|
|
webpack:
|
|
$(WEBPACK) --bail
|
|
|
|
sync-s3:
|
|
$(S3CMD) --exclude '.DS_Store' --exclude '*.svg' --exclude '*.js' ./build/ s3://$(S3_BUCKET_NAME)/
|
|
$(S3CMD) --exclude '*' --include '*.svg' --mime-type 'image/svg+xml' ./build/ s3://$(S3_BUCKET_NAME)/
|
|
$(S3CMD) --exclude '*' --include '*.js' --mime-type 'application/javascript' ./build/ s3://$(S3_BUCKET_NAME)/
|
|
|
|
sync-fastly:
|
|
$(NODE) ./bin/configure-fastly.js
|
|
|
|
sync:
|
|
@make sync-s3
|
|
@make sync-fastly
|
|
|
|
# ------------------------------------
|
|
|
|
start:
|
|
$(NODE) ./dev-server/index.js
|
|
|
|
# ------------------------------------
|
|
|
|
test:
|
|
@make lint
|
|
@make build
|
|
@echo ""
|
|
@make unit
|
|
@echo ""
|
|
@make functional
|
|
@echo ""
|
|
@make localization
|
|
@echo ""
|
|
|
|
lint:
|
|
$(ESLINT) . --ext .js,.jsx,.json
|
|
$(SASSLINT) ./src/*.scss
|
|
$(SASSLINT) ./src/**/*.scss
|
|
|
|
unit:
|
|
$(TAP) ./test/unit/*.js
|
|
|
|
functional:
|
|
$(TAP) ./test/functional/*.js
|
|
|
|
integration:
|
|
$(TAP) ./test/integration/*.js
|
|
|
|
localization:
|
|
$(TAP) ./test/localization/*.js
|
|
|
|
# ------------------------------------
|
|
|
|
.PHONY: build clean deploy translations webpack stop start test lint unit functional integration localization
|