update
This commit is contained in:
@@ -18,7 +18,4 @@ npm run dev
|
|||||||
|
|
||||||
# Build for production with minification
|
# Build for production with minification
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
# Build for production and view the bundle analyzer report
|
|
||||||
npm run build --report
|
|
||||||
```
|
```
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
require('./check-versions')()
|
require('./check-versions')()
|
||||||
|
|
||||||
process.env.NODE_ENV = 'production'
|
|
||||||
|
|
||||||
const ora = require('ora')
|
const ora = require('ora')
|
||||||
const rm = require('rimraf')
|
const rm = require('rimraf')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
@@ -10,8 +8,12 @@ const chalk = require('chalk')
|
|||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
const config = require('../config')
|
const config = require('../config')
|
||||||
const webpackConfig = require('./webpack.prod.conf')
|
const webpackConfig = require('./webpack.prod.conf')
|
||||||
|
var connect = require('connect')
|
||||||
|
var serveStatic = require('serve-static')
|
||||||
|
|
||||||
const spinner = ora('building for production...')
|
const spinner = ora(
|
||||||
|
'building for ' + process.env.env_config + ' environment...'
|
||||||
|
)
|
||||||
spinner.start()
|
spinner.start()
|
||||||
|
|
||||||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||||
@@ -41,5 +43,25 @@ rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
|||||||
" Opening index.html over file:// won't work.\n"
|
" Opening index.html over file:// won't work.\n"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (process.env.npm_config_preview) {
|
||||||
|
const port = 9526
|
||||||
|
const host = 'http://localhost:' + port
|
||||||
|
const basePath = config.build.assetsPublicPath
|
||||||
|
const app = connect()
|
||||||
|
|
||||||
|
app.use(
|
||||||
|
basePath,
|
||||||
|
serveStatic('./dist', {
|
||||||
|
index: ['index.html', '/']
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
app.listen(port, function() {
|
||||||
|
console.log(
|
||||||
|
chalk.green(`> Listening at http://localhost:${port}${basePath}`)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
module.exports = {
|
module.exports = {
|
||||||
NODE_ENV: '"production"',
|
NODE_ENV: '"production"',
|
||||||
BASE_API: '"https://easy-mock.com/mock/5950a2419adc231f356a6636/vue-admin"',
|
BASE_API: '"http://api.auauz.net"',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,10 @@
|
|||||||
"author": "Pan <panfree23@gmail.com>",
|
"author": "Pan <panfree23@gmail.com>",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "cross-env BABEL_ENV=development webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
|
"dev": "cross-env BABEL_ENV=development webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
|
||||||
"start": "npm run dev",
|
"build": "cross-env NODE_ENV=production env_config=prod node build/build.js",
|
||||||
"build": "node build/build.js",
|
|
||||||
"build:report": "npm_config_report=true npm run build",
|
|
||||||
"lint": "eslint --ext .js,.vue src",
|
"lint": "eslint --ext .js,.vue src",
|
||||||
"test": "npm run lint",
|
"test": "npm run lint",
|
||||||
|
"precommit": "lint-staged",
|
||||||
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
|
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<a href="https://gitee.com/elunez/eladmin" target="_blank" class="github-corner" aria-label="View source on Github">
|
<a href="https://github.com/elunez/eladmin" target="_blank" class="github-corner" aria-label="View source on Github">
|
||||||
<svg
|
<svg
|
||||||
width="80"
|
width="80"
|
||||||
height="80"
|
height="80"
|
||||||
|
|||||||
@@ -21,6 +21,11 @@
|
|||||||
首页
|
首页
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
<a target="_blank" href="https://github.com/elunez/eladmin">
|
||||||
|
<el-dropdown-item>
|
||||||
|
项目地址
|
||||||
|
</el-dropdown-item>
|
||||||
|
</a>
|
||||||
<el-dropdown-item divided>
|
<el-dropdown-item divided>
|
||||||
<span style="display:block;" @click="logout">退出登录</span>
|
<span style="display:block;" @click="logout">退出登录</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
|||||||
Reference in New Issue
Block a user