Skip to content

Commit

Permalink
vuecli3
Browse files Browse the repository at this point in the history
  • Loading branch information
mgbq committed Apr 19, 2020
1 parent f78d2de commit c67281c
Show file tree
Hide file tree
Showing 444 changed files with 588 additions and 919 deletions.
19 changes: 0 additions & 19 deletions .babelrc

This file was deleted.

14 changes: 14 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# just a flag
ENV = 'development'

# base api
VUE_APP_BASE_API = '/dev-api'

# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
# It only does one thing by converting all import() to require().
# This configuration can significantly increase the speed of hot updates,
# when you have a large number of pages.
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js

VUE_CLI_BABEL_TRANSPILE_MODULES = true
6 changes: 6 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# just a flag
ENV = 'production'

# base api
VUE_APP_BASE_API = '/prod-api'

8 changes: 8 additions & 0 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
NODE_ENV = production

# just a flag
ENV = 'staging'

# base api
VUE_APP_BASE_API = '/stage-api'

3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/*.js
config/*.js
src/assets
public
dist
35 changes: 17 additions & 18 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
node: true,
es6: true,
},
extends: 'eslint:recommended',
// required to lint *.vue files
plugins: [
'html',
'vue'
],
// check if imports actually resolve
'settings': {
'import/resolver': {
'webpack': {
'config': 'build/webpack.base.conf.js'
}
}
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],

// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
"vue/max-attributes-per-line": [2, {
"singleline": 10,
"multiline": {
"max": 1,
"allowFirstLine": false
}
}],
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline":"off",
"vue/name-property-casing": ["error", "PascalCase"],
"vue/no-v-html": "off",
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
Expand All @@ -48,7 +47,7 @@ module.exports = {
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': [2, 'allow-null'],
'eqeqeq': ["error", "always", {"null": "ignore"}],
'generator-star-spacing': [2, {
'before': true,
'after': true
Expand Down Expand Up @@ -77,7 +76,7 @@ module.exports = {
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 2,
'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
Expand Down Expand Up @@ -162,7 +161,7 @@ module.exports = {
':': 'before'
}
}],
'padded-blocks': [2, 'never'], //要求或禁止块内填充
'padded-blocks': [2, 'never'],
'quotes': [2, 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
Expand Down
4 changes: 0 additions & 4 deletions .gitattributes

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
tests/**/coverage/

# Editor directories and files
.idea
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js: stable
node_js: 10
script: npm run test
notifications:
email: false
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
**完整版**

[Github 仓库](https://github.com/mgbq/nx-admin) |
[码云仓库](https://gitee.com/nxmin/nx-admin) |
[预览地址](https://sdsdsy.gitee.io/nxadmin)
[码云仓库](https://gitee.com/symgg/nx-admin) |
[预览地址](https://mgbq.github.io/vue-permission/#/login)

<img src="./github/nx-admin.png" width="800px" height="400" alt="nx-admin">

**简化版**

[Github 仓库](https://github.com/mgbq/nxAdmin-template) |
[码云仓库](https://gitee.com/nxmin/nxAdmin-template) |
[码云仓库](https://gitee.com/symgg/nxAdmin-template) |
[预览地址](https://mgbq.github.io/nxAdmin-template)

## 前序准备
Expand Down
5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/app'
]
}
41 changes: 0 additions & 41 deletions build/build.js

This file was deleted.

54 changes: 0 additions & 54 deletions build/check-versions.js

This file was deleted.

35 changes: 35 additions & 0 deletions build/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const { run } = require('runjs')
const chalk = require('chalk')
const config = require('../vue.config.js')
const rawArgv = process.argv.slice(2)
const args = rawArgv.join(' ')

if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
const report = rawArgv.includes('--report')

run(`vue-cli-service build ${args}`)

const port = 9526
const publicPath = config.publicPath

var connect = require('connect')
var serveStatic = require('serve-static')
const app = connect()

app.use(
publicPath,
serveStatic('./dist', {
index: ['index.html', '/']
})
)

app.listen(port, function () {
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
if (report) {
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
}

})
} else {
run(`vue-cli-service build ${args}`)
}
Binary file removed build/logo.png
Binary file not shown.
Loading

0 comments on commit c67281c

Please sign in to comment.