From b3b93fb968c5d15bd9340e0ed2b224a725b052f4 Mon Sep 17 00:00:00 2001 From: Chris Meagher Date: Sun, 17 Nov 2019 11:17:12 +0000 Subject: [PATCH] docs: Update instructions for configuring Gridsome to use the Vue runtime compiler This can be done by setting a config option exposed by Gridsome. --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f6bf792..c03a78d 100644 --- a/README.md +++ b/README.md @@ -55,14 +55,16 @@ plugins: [ ### Configure Gridsome to resolve Rich Text fields using Vue single file components -Configure Gridsome to use the "[Runtime + Compiler](https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only)" build of Vue because we will need the compiler to enable us to treat the Rich Text field content as a Vue component template. +First, [configure Gridsome](https://gridsome.org/docs/config/#runtimecompiler) to use the "[Runtime + Compiler](https://vuejs.org/v2/guide/installation.html#Runtime-Compiler-vs-Runtime-only)" build of Vue because we will need the compiler to enable us to treat the Rich Text field content as a Vue component template. -In your `gridsome.server.js` file: +In your `gridsome.config.js` file: ```javascript -api.configureWebpack(config => { - config.resolve.alias['vue'] = 'vue/dist/vue.common'; -}) +module.exports = { + ... + runtimeCompiler: true + ... +} ``` Add a Vue single file component that will be used to render Rich Text fields. This component is a wrapper around [`v-runtime-template`](https://github.com/alexjoverm/v-runtime-template) and will be extended to resolve other components embedded inside your Rich Text fields e.g. content components/items, content links and assets.