mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-07 09:22:27 +00:00
Fix cannot ready property csp of undefined
This commit is contained in:
parent
6e9be715b2
commit
9a3bfdc998
@ -34,9 +34,6 @@ Options.from = function (_options) {
|
||||
if (typeof options.extensions === 'string') {
|
||||
options.extensions = [ options.extensions ]
|
||||
}
|
||||
if (options.render.csp === true) {
|
||||
options.render.csp = { hashAlgorithm: 'sha256' }
|
||||
}
|
||||
|
||||
const hasValue = v => typeof v === 'string' && v
|
||||
options.rootDir = hasValue(options.rootDir) ? options.rootDir : process.cwd()
|
||||
@ -91,6 +88,11 @@ Options.from = function (_options) {
|
||||
options.loadingIndicator = { name: options.loadingIndicator }
|
||||
}
|
||||
|
||||
// Apply default hash to CSP option
|
||||
if (options.render.csp === true) {
|
||||
options.render.csp = { hashAlgorithm: 'sha256' }
|
||||
}
|
||||
|
||||
// Apply defaults to loadingIndicator
|
||||
options.loadingIndicator = Object.assign({
|
||||
name: 'pulse',
|
||||
|
Loading…
Reference in New Issue
Block a user