Skip to content

Commit

Permalink
CLI CDN fixes (#159)
Browse files Browse the repository at this point in the history
* [client] Use merged config when checking for CDN flag

* [core] Explicitly set useCdn to false when creating import client
  • Loading branch information
rexxars authored and bjoerge committed Sep 14, 2017
1 parent 5099c33 commit 1262dd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/@sanity/client/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ exports.initConfig = (config, prevConfig) => {
throw new Error('Configuration must contain `projectId`')
}

if (typeof newConfig.useCdn === 'undefined') {
printCdnWarning()
}

if (projectBased) {
validate.projectId(newConfig.projectId)
}
Expand Down Expand Up @@ -79,9 +83,5 @@ exports.initConfig = (config, prevConfig) => {
}
}

if (typeof config.useCdn === 'undefined') {
printCdnWarning()
}

return newConfig
}
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ function getSanityClient(options) {
apiHost: options.gradient,
dataset: options.dataset || config.dataset,
token: options.token || config.token,
useCdn: false
})
}

Expand Down

0 comments on commit 1262dd3

Please sign in to comment.