Commit b05533ea by mamingqun

配置了环境变量和输出的相对路径

parent 9d75a1a6
VUE_APP_BUILD_TYPE = 'test'
\ No newline at end of file
# testnihao # testnihao
## Project setup ## 测试地址
``` ```
yarn install https://wanda-h5.bdideal.com/blessing-common-test/index.html
``` ```
### Compiles and hot-reloads for development
```
yarn run serve
```
### Compiles and minifies for production
```
yarn run build
```
### Run your tests
```
yarn run test
```
### Lints and fixes files
```
yarn run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
// 基本路径
publicPath: './',
// 生产环境是否生成 sourceMap 文件
productionSourceMap: true,
// 服务器端口号
// devServer: {
// port: 1234,
// },
}
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"build-test": "vue-cli-service build --mode stage",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
...@@ -18,6 +19,7 @@ ...@@ -18,6 +19,7 @@
"@vue/cli-plugin-eslint": "^3.11.0", "@vue/cli-plugin-eslint": "^3.11.0",
"@vue/cli-service": "^3.11.0", "@vue/cli-service": "^3.11.0",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"cross-env": "^6.0.0",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"less": "^3.0.4", "less": "^3.0.4",
......
<template> <template>
<div class="home"> <div class="home">
<img alt="Vue logo" src="../assets/logo.png"> <img alt="Vue logo" src="../assets/logo.png" />
<HelloWorld msg="Welcome to Your Vue.js App"/> <!-- <HelloWorld msg="Welcome to Your Vue.js App"/> -->
<h1>22{{msg}}</h1>
</div> </div>
</template> </template>
...@@ -11,6 +12,16 @@ import HelloWorld from '@/components/HelloWorld.vue' ...@@ -11,6 +12,16 @@ import HelloWorld from '@/components/HelloWorld.vue'
export default { export default {
name: 'home', name: 'home',
data() {
return {
msg: null
}
},
mounted() {
this.msg = process.env.VUE_APP_BUILD_TYPE
console.log(process.env.VUE_APP_BUILD_TYPE);
},
components: { components: {
HelloWorld HelloWorld
} }
......
...@@ -2310,6 +2310,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: ...@@ -2310,6 +2310,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1" safe-buffer "^5.0.1"
sha.js "^2.4.8" sha.js "^2.4.8"
cross-env@^6.0.0:
version "6.0.0"
resolved "https://registry.npm.taobao.org/cross-env/download/cross-env-6.0.0.tgz#3c8e71440ea20aa6faaf5aec541235efc565dac6"
integrity sha1-PI5xRA6iCqb6r1rsVBI178Vl2sY=
dependencies:
cross-spawn "^7.0.0"
cross-spawn@^5.0.1, cross-spawn@^5.1.0: cross-spawn@^5.0.1, cross-spawn@^5.1.0:
version "5.1.0" version "5.1.0"
resolved "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-5.1.0.tgz?cache=0&sync_timestamp=1567511208574&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcross-spawn%2Fdownload%2Fcross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" resolved "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-5.1.0.tgz?cache=0&sync_timestamp=1567511208574&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcross-spawn%2Fdownload%2Fcross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
...@@ -2330,6 +2337,15 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: ...@@ -2330,6 +2337,15 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5:
shebang-command "^1.2.0" shebang-command "^1.2.0"
which "^1.2.9" which "^1.2.9"
cross-spawn@^7.0.0:
version "7.0.0"
resolved "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-7.0.0.tgz?cache=0&sync_timestamp=1567511208574&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcross-spawn%2Fdownload%2Fcross-spawn-7.0.0.tgz#21ef9470443262f33dba80b2705a91db959b2e03"
integrity sha1-Ie+UcEQyYvM9uoCycFqR25WbLgM=
dependencies:
path-key "^3.1.0"
shebang-command "^1.2.0"
which "^1.2.9"
crypto-browserify@^3.11.0: crypto-browserify@^3.11.0:
version "3.12.0" version "3.12.0"
resolved "https://registry.npm.taobao.org/crypto-browserify/download/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" resolved "https://registry.npm.taobao.org/crypto-browserify/download/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec"
...@@ -5862,7 +5878,7 @@ path-key@^2.0.0, path-key@^2.0.1: ...@@ -5862,7 +5878,7 @@ path-key@^2.0.0, path-key@^2.0.1:
resolved "https://registry.npm.taobao.org/path-key/download/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" resolved "https://registry.npm.taobao.org/path-key/download/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
path-key@^3.0.0: path-key@^3.0.0, path-key@^3.1.0:
version "3.1.0" version "3.1.0"
resolved "https://registry.npm.taobao.org/path-key/download/path-key-3.1.0.tgz#99a10d870a803bdd5ee6f0470e58dfcd2f9a54d3" resolved "https://registry.npm.taobao.org/path-key/download/path-key-3.1.0.tgz#99a10d870a803bdd5ee6f0470e58dfcd2f9a54d3"
integrity sha1-maENhwqAO91e5vBHDljfzS+aVNM= integrity sha1-maENhwqAO91e5vBHDljfzS+aVNM=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment