Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
stricter expectation of assets
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys committed Mar 6, 2017
1 parent 5b39fd2 commit 5c1862e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions _deploy/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,18 @@ function getFileList (dir) {
)
}

function expectedAssets () {
return Promise.resolve([
'./dist/assets/es5.js',
'./dist/assets/es5.min.js',
'./dist/assets/head-n-ui-core.css',
'./dist/assets/n-ui-core.css'
])
}

function brotlify () {
return getFileList('assets').then(files => Promise.all(
return expectedAssets.then(files => Promise.all(
files
.filter(f => /\.(js|css)$/.test(f))
.map(fileName =>
readFile(path.join(process.cwd(), fileName))
.then(brotli.compress)
Expand Down

0 comments on commit 5c1862e

Please sign in to comment.