Skip to content

Add AOT gzip content-encoding support for main build files. #565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 29, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use Promise.all to gzip assets in parallel.
  • Loading branch information
arunoda committed Dec 29, 2016
commit fe00eb2c9160e7bc459a696b9e3a9e5b69a1b24d
6 changes: 4 additions & 2 deletions server/build/gzip.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import zlib from 'zlib'
export default async function gzipAssets (dir) {
const nextDir = path.resolve(dir, '.next')

await gzip(path.resolve(nextDir, 'commons.js'))
await gzip(path.resolve(nextDir, 'main.js'))
await Promise.all([
gzip(path.resolve(nextDir, 'commons.js')),
gzip(path.resolve(nextDir, 'main.js'))
])
}

export function gzip (filePath) {
Expand Down