我已经安装了@nuxt/content
,但是在运行时npm run dev
我收到了这个错误消息,尽管一切正常:
WARN in ./content/foo.md friendly-errors 11:36:40
Module parse failed: Assigning to rvalue (1:2) friendly-errors 11:36:40
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> ---
我在安装过程中遗漏了什么吗?
我正在使用节点LTSv14.16.0
和npm 6.14.11
。
package.json
:
{
"name": "documentation",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
"lint": "npm run lint:js"
},
"dependencies": {
"@nuxt/content": "^1.14.0",
"@nuxtjs/axios": "^5.13.1",
"core-js": "^3.9.1",
"nuxt": "^2.15.2"
},
"devDependencies": {
"@nuxt/types": "^2.15.2",
"@nuxt/typescript-build": "^2.1.0",
"@nuxtjs/eslint-config": "^6.0.0",
"@nuxtjs/eslint-config-typescript": "^6.0.0",
"@nuxtjs/vuetify": "^1.11.3",
"babel-eslint": "^10.1.0",
"eslint": "^7.21.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-nuxt": "^2.0.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^7.7.0",
"node-sass": "^5.0.0",
"prettier": "^2.2.1",
"sass-loader": "^10.1.1"
}
}
nuxt.config.js
:
export default {
server: {
host: process.env.HOST,
port: process.env.PORT,
},
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
titleTemplate: '%s - documentation',
title: 'My Doc',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
// Global CSS (https://go.nuxtjs.dev/config-css)
css: ['@/assets/css/main.css'],
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
/*
** Plugins to load before mounting the App
** Doc: https://nuxtjs.org/guide/plugins
*/
plugins: ['~/plugins/global.js'],
// Auto import components (https://go.nuxtjs.dev/config-components)
components: true,
// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
buildModules: [
// https://go.nuxtjs.dev/typescript
'@nuxt/typescript-build',
// https://go.nuxtjs.dev/vuetify
'@nuxtjs/vuetify',
],
// Modules (https://go.nuxtjs.dev/config-modules)
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
'@nuxt/content',
],
// Axios module configuration (https://go.nuxtjs.dev/config-axios)
axios: {},
content: {},
// Vuetify module configuration (https://go.nuxtjs.dev/config-vuetify)
vuetify: {
customVariables: ['~/assets/variables.scss'],
},
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {},
}
foo.md
---
title: Foo
description: Foo
---
# Hello World