Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

本地跑不起 来缺少config 文件 #57

Open
mimimile opened this issue Aug 29, 2019 · 4 comments
Open

本地跑不起 来缺少config 文件 #57

mimimile opened this issue Aug 29, 2019 · 4 comments

Comments

@mimimile
Copy link

// initComment.js
const CONFIG = require("../../../../config");

// config.js
const CONFIG = require("../../config");

// i18n/index.js
import { defaultLang, config } from "./config";
@AydenGen
Copy link

AydenGen commented Sep 5, 2019

本地根目录创建了 config.js,可以运行起来,但没内容

请问里面是需要什么配置内容?

@yukinotech
Copy link

同上,根据md里的步骤操作,执行npm run docs:dev这一步提示报错

> npx vuepress dev docs

wait Extracting site metadata...
Error: Cannot find module '../../config'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:649:15)
    at Function.Module._load (internal/modules/cjs/loader.js:575:25)
    at Module.require (internal/modules/cjs/loader.js:705:19)
    at require (internal/modules/cjs/helpers.js:14:16)

@QiShaoXuan
Copy link
Owner

这个 config 里放的是我私人东西,所以没有提交。
可以在根目录下创建 config.js,内容为

module.exports = {
  gitalk: {},
  ga: ""
};

@QiShaoXuan
Copy link
Owner

也可以在 docs/.vuepress/config.js 中删除插件配置中的require("./plugins/comment/index")["@vuepress/google-analytics",{ga: CONFIG.ga}],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants