diff options
Diffstat (limited to 'nuxt.config.js')
-rw-r--r-- | nuxt.config.js | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/nuxt.config.js b/nuxt.config.js index a0ae413..e00db35 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', /* @@ -20,6 +24,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 +40,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 +82,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) + } + } } } |