forked from microbit-foundation/cctd-ml-machine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.cjs
51 lines (49 loc) · 1.36 KB
/
deployment.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const {
createDeploymentDetailsFromOptions,
} = require("@microbit-foundation/website-deploy-aws-config");
const { s3Config } = createDeploymentDetailsFromOptions({
production: {
bucket: "createai.microbit.org",
mode: "root",
allowPrerelease: false,
},
staging: {
bucket: "stage-createai.microbit.org",
},
review: {
bucket: "review-createai.microbit.org",
mode: "branch-prefix",
},
});
module.exports = {
deploymentDir: "./dist",
...s3Config,
region: "eu-west-1",
removeNonexistentObjects: true,
enableS3StaticWebsiteHosting: true,
errorDocumentKey: "index.html",
redirects: [],
params: {
"**/**.html": {
CacheControl: "public, max-age=0, must-revalidate",
},
"**/assets/**": { CacheControl: "public, max-age=31536000, immutable" },
// There's lots in public/ that we'd ideally use the bundler for to improve caching
// TODO: this might no longer be true, or at least be an easy fix
"css/**": {
CacheControl: "public, max-age=0, must-revalidate",
},
"firmware/**": {
CacheControl: "public, max-age=0, must-revalidate",
},
"imgs/**": {
CacheControl: "public, max-age=0, must-revalidate",
},
"sounds/**": {
CacheControl: "public, max-age=0, must-revalidate",
},
"webfonts/**": {
CacheControl: "public, max-age=0, must-revalidate",
},
},
};