From 014651e35d4e702c3e6be35890b39716cc5c1b31 Mon Sep 17 00:00:00 2001 From: Zeeland Date: Thu, 6 Apr 2023 19:31:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(global):=20=E6=8C=87=E5=AE=9A=20core-js,def?= =?UTF-8?q?u=20=E7=89=88=E6=9C=AC,=E4=BF=AE=E5=A4=8D=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 28 ++++++++++++++++++++-------- nuxt.config.js | 2 +- package.json | 5 ++++- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index fe9a686..d18e3b3 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Frymcu%2Fnebula.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Frymcu%2Fnebula?ref=badge_shield) ## 💡 简介 + nebula([ˈnebyələ],n.星云)是一款现代化的知识社区项目,使用 Vue + NuxtJS + Element-UI 实现 与 [forest](https://github.com/rymcu/forest) ([ˈfôrəst],n.森林)一起食用,让我们一起探索知识社区的未来。 @@ -13,7 +14,6 @@ nebula([ˈnebyələ],n.星云)是一款现代化的知识社区项目, 在很多方面受到了 [Symphony](https://github.com/88250/symphony) 的启发,并尝试着在 [Symphony](https://github.com/88250/symphony) 和 [B3log 思想](https://ld246.com/article/1546941897596) 的基础上进一步探索。 - ## ✨ 特性 - 内容编辑器 @@ -93,6 +93,7 @@ nebula([ˈnebyələ],n.星云)是一款现代化的知识社区项目, 在提功能建议前可以先看一下 [计划表](https://rymcu.com/article/29) ,避免重复提议 ## 鸣谢 + - 感谢以下开发者对 Nebula 作出的贡献: @@ -102,37 +103,48 @@ nebula([ˈnebyələ],n.星云)是一款现代化的知识社区项目, - 感谢 `JetBrains` 对本项目的帮助,为作者提供了开源许可版 `JetBrains` 全家桶 ![JetBrains](assets/jb_beam.svg) + ## Build Setup ```bash +# install yarn +npm install -g yarn + # install dependencies -$ yarn install +yarn install # serve with hot reload at localhost:3000 -$ yarn run dev +yarn run dev # build for production and launch server -$ yarn run build -$ yarn run start +yarn run build +yarn run start # generate static project -$ yarn run generate +yarn run generate ``` +> 如果遇到网络超时的问题可以尝试配置国内镜像源: +> `yarn config set registry https://registry.npm.taobao.org` +> 和`npm config set registry https://registry.npm.taobao.org` + + + ## 项目部署 + 1. 关闭本地项目后,在控制台执行 `npm run build` 进行打包 2. 拷贝以下文件至服务器 ![build](assets/build.png) - + 3. 服务器安装 `Nodejs` 环境 4. 项目目录下执行 `yarn install` 5. 执行 `npm install pm2 -g` 6. 执行 `pm2 list` 检查 `pm2` 是否安装好 7. 执行 `pm2 start npm --name nebula -- run start` - For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org). ## License + [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Frymcu%2Fnebula.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Frymcu%2Fnebula?ref=badge_large) diff --git a/nuxt.config.js b/nuxt.config.js index 44f13f8..d4ddde2 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -125,7 +125,7 @@ export default { ** See https://nuxtjs.org/api/configuration-build/ */ build: { - transpile: [/^element-ui/], + transpile: [/^element-ui/,'defu'], optimization: { splitChunks: { minSize: 10000, diff --git a/package.json b/package.json index 375e2ce..dd36420 100644 --- a/package.json +++ b/package.json @@ -30,11 +30,14 @@ "stompjs": "^2.3.3", "vditor": "^3.8.18", "vue-cropperjs": "^4.2.0", - "vuejs-avataaars": "^4.0.1" + "vuejs-avataaars": "^4.0.1", + "core-js": "^2.6.12", + "defu": "^5.0.1" }, "devDependencies": { "@commitlint/cli": "^17.4.0", "@commitlint/config-conventional": "^17.4.0", + "@nuxt/types": "~2.16.0", "@nuxtjs/proxy": "^2.1.0", "conventional-changelog-cli": "^2.2.2", "cz-git": "^1.4.1",