diff options
Diffstat (limited to 'nuxt.config.js')
-rw-r--r-- | nuxt.config.js | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/nuxt.config.js b/nuxt.config.js index a0ae413..104781c 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -1,3 +1,7 @@ +import k from './api' + +const BASE_URL = process.env.DEPLOY_PRIME_URL || 'http://localhost:3000' + export default { mode: 'universal', /* @@ -5,7 +9,8 @@ export default { */ head: { htmlAttrs: { - lang: 'pl' + lang: 'pl', + prefix: 'og: http://ogp.me/ns#' }, title: '19 PDH Puszcza', meta: [ @@ -20,6 +25,11 @@ export default { { name: 'google-site-verification', content: 'V9-RG4-ertDzO9hqxuG29PkDUM8PGqaSOYUMiMaGUOY' + }, + { + hid: 'og:image', + name: 'og:image', + content: `${BASE_URL}/assets/og/default.jpg` } ], link: [ @@ -31,6 +41,12 @@ export default { } ] }, + env: { + baseUrl: process.env.DEPLOY_URL || 'http://localhost:3000' + }, + generate: { + routes: k.getPosts().map(post => post.route) + }, /* ** Customize the progress-bar color */ @@ -67,6 +83,28 @@ export default { /* ** You can extend webpack config here */ - extend(config, ctx) {} + extend(config, { isDev, isClient }) { + if (isClient) { + config.node = { + fs: 'empty', + child_process: 'empty', + tls: 'empty', + net: 'empty' + } + } + config.module.rules.push({ + test: /\.md$/, + use: ['raw-loader'] + }) + } + }, + hooks: { + generate: { + routeCreated({ route, path, errors }) { + console.log(route) + console.log(path) + console.log(errors) + } + } } } |