Skip to content

Commit 7f75e9a

Browse files
committed
feat: optimize all
1 parent 7fcb440 commit 7f75e9a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+12573
-10303
lines changed

.babelrc

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
11
{
22
"presets": [
3-
[
4-
"env",
5-
{
6-
"modules": false,
7-
"targets": {
8-
"browsers": [
9-
"> 1%",
10-
"last 2 versions",
11-
"not ie <= 8"
12-
]
13-
}
3+
["env", {
4+
"modules": false,
5+
"targets": {
6+
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
147
}
15-
],
8+
}],
169
"stage-2"
1710
],
18-
"plugins": ["transform-runtime"],
19-
"env": {
20-
"test": {
21-
"presets": [
22-
"env",
23-
"stage-2"
24-
],
25-
"plugins": [
26-
"istanbul"
27-
]
28-
}
29-
}
11+
"plugins": ["transform-vue-jsx", "transform-runtime"]
3012
}

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/build/
2+
/config/
3+
/dist/
4+
/*.js

.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// https://eslint.org/docs/user-guide/configuring
2+
3+
module.exports = {
4+
root: true,
5+
parserOptions: {
6+
parser: 'babel-eslint'
7+
},
8+
env: {
9+
browser: true,
10+
},
11+
extends: [
12+
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
13+
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
14+
'plugin:vue/essential',
15+
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
16+
'standard'
17+
],
18+
// required to lint *.vue files
19+
plugins: [
20+
'vue'
21+
],
22+
// add your custom rules here
23+
rules: {
24+
// allow async-await
25+
'generator-star-spacing': 'off',
26+
// allow debugger during development
27+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
28+
}
29+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ npm-debug.log
44
dist/
55
.git/
66
.idea/
7+
package-lock.json

.postcssrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// https://github.com/michael-ciniawsky/postcss-load-config
2+
3+
module.exports = {
4+
"plugins": {
5+
"postcss-import": {},
6+
"postcss-url": {},
7+
// to edit target browsers: use "browserslist" field in package.json
8+
"autoprefixer": {}
9+
}
10+
}

README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
FOLLOW A KUGOU
1+
vue-demo-kugou
22
----------------
33

4-
vuejs仿写酷狗音乐webapp
4+
vuejs仿写的酷狗音乐webapp
55
-----------------
66

7-
在线预览:
8-
----
9-
10-
在线预览使用nuxt重写的demo
11-
[vue-kugou-demo-nuxt](http://github.com/lavyun/vue-demo-kugou-nuxt)
12-
13-
147
项目截图:
158
----
16-
![](http://opj15jbpo.bkt.clouddn.com/81854091-77E3-413F-BB11-0C24F27744BE.png?imageView2/3/w/400/h/200/q/75|imageslim)<br><br>
17-
![](http://opj15jbpo.bkt.clouddn.com/0B7FDF5C-F820-4C43-BA7F-A82CDB464F29.png?imageView2/3/w/400/h/200/q/75|imageslim)<br><br>
18-
![](http://opj15jbpo.bkt.clouddn.com/9F60D9FD-3463-46F2-848A-62D4AAD4A1BB.png?imageView2/3/w/400/h/200/q/75|imageslim)<br><br>
9+
![](https://kano-sns.guahao.cn/S2H180728859)<br><br>
10+
![](https://kano-sns.guahao.cn/69V180729357)<br><br>
11+
![](https://kano-sns.guahao.cn/UK3180729485)<br><br>
12+
![](https://kano-sns.guahao.cn/LMi180729645)<br><br>
1913

2014
如何使用
2115
----

build/build.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
1+
'use strict'
12
require('./check-versions')()
23

34
process.env.NODE_ENV = 'production'
45

5-
var ora = require('ora')
6-
var rm = require('rimraf')
7-
var path = require('path')
8-
var chalk = require('chalk')
9-
var webpack = require('webpack')
10-
var config = require('../config')
11-
var webpackConfig = require('./webpack.prod.conf')
6+
const ora = require('ora')
7+
const rm = require('rimraf')
8+
const path = require('path')
9+
const chalk = require('chalk')
10+
const webpack = require('webpack')
11+
const config = require('../config')
12+
const webpackConfig = require('./webpack.prod.conf')
1213

13-
var spinner = ora('building for production...')
14+
const spinner = ora('building for production...')
1415
spinner.start()
1516

1617
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
1718
if (err) throw err
18-
webpack(webpackConfig, function (err, stats) {
19+
webpack(webpackConfig, (err, stats) => {
1920
spinner.stop()
2021
if (err) throw err
2122
process.stdout.write(stats.toString({
2223
colors: true,
2324
modules: false,
24-
children: false,
25+
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
2526
chunks: false,
2627
chunkModules: false
2728
}) + '\n\n')
2829

30+
if (stats.hasErrors()) {
31+
console.log(chalk.red(' Build failed with errors.\n'))
32+
process.exit(1)
33+
}
34+
2935
console.log(chalk.cyan(' Build complete.\n'))
3036
console.log(chalk.yellow(
3137
' Tip: built files are meant to be served over an HTTP server.\n' +

build/check-versions.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
var chalk = require('chalk')
2-
var semver = require('semver')
3-
var packageConfig = require('../package.json')
4-
var shell = require('shelljs')
1+
'use strict'
2+
const chalk = require('chalk')
3+
const semver = require('semver')
4+
const packageConfig = require('../package.json')
5+
const shell = require('shelljs')
6+
57
function exec (cmd) {
68
return require('child_process').execSync(cmd).toString().trim()
79
}
810

9-
var versionRequirements = [
11+
const versionRequirements = [
1012
{
1113
name: 'node',
1214
currentVersion: semver.clean(process.version),
1315
versionRequirement: packageConfig.engines.node
14-
},
16+
}
1517
]
1618

1719
if (shell.which('npm')) {
@@ -23,9 +25,11 @@ if (shell.which('npm')) {
2325
}
2426

2527
module.exports = function () {
26-
var warnings = []
27-
for (var i = 0; i < versionRequirements.length; i++) {
28-
var mod = versionRequirements[i]
28+
const warnings = []
29+
30+
for (let i = 0; i < versionRequirements.length; i++) {
31+
const mod = versionRequirements[i]
32+
2933
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
3034
warnings.push(mod.name + ': ' +
3135
chalk.red(mod.currentVersion) + ' should be ' +
@@ -38,10 +42,12 @@ module.exports = function () {
3842
console.log('')
3943
console.log(chalk.yellow('To use this template, you must update following to modules:'))
4044
console.log()
41-
for (var i = 0; i < warnings.length; i++) {
42-
var warning = warnings[i]
45+
46+
for (let i = 0; i < warnings.length; i++) {
47+
const warning = warnings[i]
4348
console.log(' ' + warning)
4449
}
50+
4551
console.log()
4652
process.exit(1)
4753
}

build/dev-client.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

build/dev-server.js

Lines changed: 0 additions & 89 deletions
This file was deleted.

build/logo.png

6.69 KB
Loading

0 commit comments

Comments
 (0)