diff --git a/_headers.ejs b/_headers.ejs index 82273b01..ccc5a559 100644 --- a/_headers.ejs +++ b/_headers.ejs @@ -1,6 +1,7 @@ # Long-term cache by default. /* Cache-Control: max-age=31536000 + Access-Control-Allow-Origin: * # And here are the exceptions: / @@ -9,9 +10,8 @@ /serviceworker.js Cache-Control: no-cache -# Module imports need CORS, so we enable it for the SDK file. -/squoosh.mjs - Access-Control-Allow-Origin: * +/sdk.mjs + Cache-Control: no-cache /manifest.json Cache-Control: must-revalidate, max-age=3600 diff --git a/package.json b/package.json index ab5005fc..41ab4457 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "1.6.0", "license": "apache-2.0", "scripts": { - "build:sdk": "microbundle --compress -f es -o build -i src/sdk.ts", + "build:sdk": "microbundle --compress -f es -o build/sdk.mjs -i src/sdk.ts", "start": "webpack-dev-server --host 0.0.0.0 --hot", "build": "webpack -p && npm run build:sdk", "lint": "tslint -c tslint.json -p tsconfig.json -t verbose 'src/**/*.{ts,tsx,js,jsx}'", diff --git a/src/components/compress/index.tsx b/src/components/compress/index.tsx index 0ee1daf9..a8b87db1 100644 --- a/src/components/compress/index.tsx +++ b/src/components/compress/index.tsx @@ -48,7 +48,7 @@ export class SquooshStartEvent extends Event { } } -export enum SquooshSideEventType { +export const enum SquooshSideEventType { DONE = 'squoosh:done', ABORT = 'squoosh:abort', ERROR = 'squoosh:error',