build:preview
This commit is contained in:
parent
059f998b3f
commit
a15d2e58d9
10
.env.netlify
10
.env.netlify
|
|
@ -1,10 +0,0 @@
|
||||||
# travis
|
|
||||||
|
|
||||||
# 指定构建模式
|
|
||||||
NODE_ENV=production
|
|
||||||
|
|
||||||
# 标记当前构建方式
|
|
||||||
VUE_APP_BUILD_MODE=NETLIFY
|
|
||||||
|
|
||||||
# 显示源码按钮
|
|
||||||
VUE_APP_SCOURCE_LINK=TRUE
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
# travis
|
# 构建预览页面
|
||||||
|
|
||||||
# 指定构建模式
|
# 指定构建模式
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
|
|
||||||
# 标记当前构建方式
|
# 标记当前构建方式
|
||||||
VUE_APP_BUILD_MODE=TRAVIS
|
VUE_APP_BUILD_MODE=PREVIEW
|
||||||
|
|
||||||
# 显示源码按钮
|
# 显示源码按钮
|
||||||
VUE_APP_SCOURCE_LINK=TRUE
|
VUE_APP_SCOURCE_LINK=TRUE
|
||||||
|
|
@ -16,7 +16,7 @@ jobs:
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npm install
|
||||||
npm run build:github
|
npm run build:preview
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: SamKirkland/FTP-Deploy-Action@2.0.0
|
uses: SamKirkland/FTP-Deploy-Action@2.0.0
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
25
.travis.yml
25
.travis.yml
|
|
@ -1,25 +0,0 @@
|
||||||
language: node_js
|
|
||||||
node_js: stable
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
webhooks: https://oapi.dingtalk.com/robot/send?access_token=a0918ec1b0461056fb9953fe2b03ecc3074a629e88992f327cc94bae93349e9e
|
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- "node_modules"
|
|
||||||
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
|
|
||||||
script:
|
|
||||||
- yarn run build:travis
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
|
||||||
- export PATH=$HOME/.yarn/bin:$PATH
|
|
||||||
|
|
||||||
after_success:
|
|
||||||
- ./deploy/qshell account $AK $SK liyang
|
|
||||||
- ./deploy/qshell qupload ./deploy/upload.conf
|
|
||||||
- ./deploy/qshell cdnrefresh --dirs -i ./deploy/cdnrefresh.txt
|
|
||||||
|
|
@ -17,9 +17,6 @@
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://www.travis-ci.org/d2-projects/d2-admin">
|
|
||||||
<img src="https://www.travis-ci.org/d2-projects/d2-admin.svg?branch=master"/>
|
|
||||||
</a>
|
|
||||||
<a href="https://app.netlify.com/sites/d2-admin/deploys">
|
<a href="https://app.netlify.com/sites/d2-admin/deploys">
|
||||||
<img src="https://api.netlify.com/api/v1/badges/a5dd4bbd-da3f-4145-98a9-8012577bdcf5/deploy-status"/>
|
<img src="https://api.netlify.com/api/v1/badges/a5dd4bbd-da3f-4145-98a9-8012577bdcf5/deploy-status"/>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,6 @@
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://www.travis-ci.org/d2-projects/d2-admin">
|
|
||||||
<img src="https://www.travis-ci.org/d2-projects/d2-admin.svg?branch=master"/>
|
|
||||||
</a>
|
|
||||||
<a href="https://app.netlify.com/sites/d2-admin/deploys">
|
<a href="https://app.netlify.com/sites/d2-admin/deploys">
|
||||||
<img src="https://api.netlify.com/api/v1/badges/a5dd4bbd-da3f-4145-98a9-8012577bdcf5/deploy-status"/>
|
<img src="https://api.netlify.com/api/v1/badges/a5dd4bbd-da3f-4145-98a9-8012577bdcf5/deploy-status"/>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,10 @@
|
||||||
"version": "1.7.2",
|
"version": "1.7.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve --open",
|
"serve": "vue-cli-service serve --open",
|
||||||
"build": "vue-cli-service build",
|
|
||||||
"lint": "vue-cli-service lint --fix",
|
"lint": "vue-cli-service lint --fix",
|
||||||
"build:netlify": "vue-cli-service build --mode netlify",
|
"build": "vue-cli-service build",
|
||||||
"build:nomock": "vue-cli-service build --mode nomock",
|
"build:nomock": "vue-cli-service build --mode nomock",
|
||||||
"build:travis": "vue-cli-service build --mode travis",
|
"build:preview": "NODE_OPTIONS=--max_old_space_size=4096 vue-cli-service build --mode preview",
|
||||||
"build:github": "NODE_OPTIONS=--max_old_space_size=4096 npm run build:travis",
|
|
||||||
"dev": "npm run serve",
|
"dev": "npm run serve",
|
||||||
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'",
|
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'",
|
||||||
"start": "npm run serve",
|
"start": "npm run serve",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ export default {
|
||||||
onChangeLocale (command) {
|
onChangeLocale (command) {
|
||||||
this.$i18n.locale = command
|
this.$i18n.locale = command
|
||||||
let message = `当前语言:${this.$t('_name')} [ ${this.$i18n.locale} ]`
|
let message = `当前语言:${this.$t('_name')} [ ${this.$i18n.locale} ]`
|
||||||
if (['TRAVIS', 'NETLIFY'].includes(process.env.VUE_APP_BUILD_MODE)) {
|
if (process.env.VUE_APP_BUILD_MODE === 'PREVIEW') {
|
||||||
message = [
|
message = [
|
||||||
`当前语言:${this.$t('_name')} [ ${this.$i18n.locale} ]`,
|
`当前语言:${this.$t('_name')} [ ${this.$i18n.locale} ]`,
|
||||||
`仅提供切换功能,没有配置具体的语言数据 `,
|
`仅提供切换功能,没有配置具体的语言数据 `,
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
<a><img src="https://img.shields.io/github/issues-pr-closed/d2-projects/d2-admin.svg"/></a>
|
<a><img src="https://img.shields.io/github/issues-pr-closed/d2-projects/d2-admin.svg"/></a>
|
||||||
</p>
|
</p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://www.travis-ci.org/d2-projects/d2-admin"><img src="https://www.travis-ci.org/d2-projects/d2-admin.svg?branch=master"/></a>
|
|
||||||
<a><img src="https://img.shields.io/github/last-commit/d2-projects/d2-admin.svg"/></a>
|
<a><img src="https://img.shields.io/github/last-commit/d2-projects/d2-admin.svg"/></a>
|
||||||
<a><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg"/></a>
|
<a><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg"/></a>
|
||||||
<a><img src="https://api.netlify.com/api/v1/badges/a5dd4bbd-da3f-4145-98a9-8012577bdcf5/deploy-status"/></a>
|
<a><img src="https://api.netlify.com/api/v1/badges/a5dd4bbd-da3f-4145-98a9-8012577bdcf5/deploy-status"/></a>
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ module.exports = {
|
||||||
// sourcemap不包含列信息
|
// sourcemap不包含列信息
|
||||||
config => config.devtool('cheap-source-map')
|
config => config.devtool('cheap-source-map')
|
||||||
)
|
)
|
||||||
// TRAVIS 构建 vue-loader 添加 filename
|
// 预览环境构建 vue-loader 添加 filename
|
||||||
.when(process.env.VUE_APP_SCOURCE_LINK === 'TRUE',
|
.when(process.env.VUE_APP_SCOURCE_LINK === 'TRUE',
|
||||||
VueFilenameInjector(config, {
|
VueFilenameInjector(config, {
|
||||||
propName: process.env.VUE_APP_SOURCE_VIEWER_PROP_NAME
|
propName: process.env.VUE_APP_SOURCE_VIEWER_PROP_NAME
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue