Problem
WARNING: next commented code is REQUIRED for static generation for Vuetify components rendered inside markdown files
Related issues:
As I understand:
Vuetify loader doesn't check content of markdown files, that's why while runnin nuxt generate Vuetify components
(that may be used in any component without import) are not rendered while used inside markdown files.
I.e. v-alert which was used in blog to mark some text as warning and etc. At nuxt dev mode Vuetify component are rendered correctly because treeshake is disabled for development mode
This problem solved by two ways:
- disabling treeshake
- importing components inside template which render markdown content
Finaly second way works for nuxt generate and static content is renedered correctly, but if this code is used while
using nuxt dev, development server will return error about "Unexpected token 'export'" when I visit page that displays markdown with Vuetify components.
P.S.: currently I used only "v-alert" component from Vuetify. If any more components will be used, don't forget
to add them here!
import Vue from 'vue'
import { VAlert } from 'vuetify/lib'
Vue.component('VAlert', VAlert)
Status
Searching the way to avoid always comment/uncomment code for static generation
Problem
WARNING: next commented code is REQUIRED for static generation for Vuetify components rendered inside markdown files
Related issues:
As I understand:
Vuetify loader doesn't check content of markdown files, that's why while runnin
nuxt generateVuetify components(that may be used in any component without import) are not rendered while used inside markdown files.
I.e. v-alert which was used in blog to mark some text as warning and etc. At
nuxt devmode Vuetify component are rendered correctly because treeshake is disabled for development modeThis problem solved by two ways:
Finaly second way works for
nuxt generateand static content is renedered correctly, but if this code is used whileusing
nuxt dev, development server will return error about "Unexpected token 'export'" when I visit page that displays markdown with Vuetify components.P.S.: currently I used only "v-alert" component from Vuetify. If any more components will be used, don't forget
to add them here!
Status
Searching the way to avoid always comment/uncomment code for static generation