Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Solve problem with Vuetify components inside markdown files #4

Description

@dmnsea

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:

  1. disabling treeshake
  2. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededinvalidThis doesn't seem right

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions