diff --git a/README.md b/README.md index 3a5d3e4..2e5c5e0 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ inputs: bucketName: my-bucket # (optional) aws bucket name. default is an auto generated name. indexDocument: index.html # (optional) index document for your website. default is index.html. errorDocument: index.html # (optional) error document for your website. default is index.html. + compress: false # (optional) enables cloudfront automatic compression. default is false. ``` You could also provide a build hook to run before the source gets uploaded by turning the `src` input into an object: diff --git a/src/utils.js b/src/utils.js index 612f084..0098b60 100644 --- a/src/utils.js +++ b/src/utils.js @@ -82,6 +82,7 @@ const getConfig = (inputs, state) => { config.region = inputs.region || state.region || 'us-east-1' config.bucketUrl = `http://${config.bucketName}.s3-website-${config.region}.amazonaws.com` config.src = inputs.src + config.compress = inputs.compress || false config.distributionId = state.distributionId config.distributionUrl = state.distributionUrl @@ -560,7 +561,7 @@ const createCloudFrontDistribution = async (clients, config) => { SmoothStreaming: false, DefaultTTL: 0, MaxTTL: 31536000, - Compress: false, + Compress: config.compress, LambdaFunctionAssociations: { Quantity: 0, Items: []