Skip to content

Commit

Permalink
feat: optimize all
Browse files Browse the repository at this point in the history
  • Loading branch information
lavyun committed Nov 30, 2019
1 parent 7fcb440 commit 7f75e9a
Show file tree
Hide file tree
Showing 65 changed files with 12,573 additions and 10,303 deletions.
30 changes: 6 additions & 24 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
{
"presets": [
[
"env",
{
"modules": false,
"targets": {
"browsers": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
],
}],
"stage-2"
],
"plugins": ["transform-runtime"],
"env": {
"test": {
"presets": [
"env",
"stage-2"
],
"plugins": [
"istanbul"
]
}
}
"plugins": ["transform-vue-jsx", "transform-runtime"]
}
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/build/
/config/
/dist/
/*.js
29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// https://eslint.org/docs/user-guide/configuring

module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ npm-debug.log
dist/
.git/
.idea/
package-lock.json
10 changes: 10 additions & 0 deletions .postcssrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// https://github.com/michael-ciniawsky/postcss-load-config

module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
FOLLOW A KUGOU
vue-demo-kugou
----------------

vuejs仿写酷狗音乐webapp
vuejs仿写的酷狗音乐webapp
-----------------

在线预览:
----

在线预览使用nuxt重写的demo
[vue-kugou-demo-nuxt](http://github.com/lavyun/vue-demo-kugou-nuxt)


项目截图:
----
![](http://opj15jbpo.bkt.clouddn.com/81854091-77E3-413F-BB11-0C24F27744BE.png?imageView2/3/w/400/h/200/q/75|imageslim)<br><br>
![](http://opj15jbpo.bkt.clouddn.com/0B7FDF5C-F820-4C43-BA7F-A82CDB464F29.png?imageView2/3/w/400/h/200/q/75|imageslim)<br><br>
![](http://opj15jbpo.bkt.clouddn.com/9F60D9FD-3463-46F2-848A-62D4AAD4A1BB.png?imageView2/3/w/400/h/200/q/75|imageslim)<br><br>
![](https://kano-sns.guahao.cn/S2H180728859)<br><br>
![](https://kano-sns.guahao.cn/69V180729357)<br><br>
![](https://kano-sns.guahao.cn/UK3180729485)<br><br>
![](https://kano-sns.guahao.cn/LMi180729645)<br><br>

如何使用
----
Expand Down
26 changes: 16 additions & 10 deletions build/build.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
'use strict'
require('./check-versions')()

process.env.NODE_ENV = 'production'

var ora = require('ora')
var rm = require('rimraf')
var path = require('path')
var chalk = require('chalk')
var webpack = require('webpack')
var config = require('../config')
var webpackConfig = require('./webpack.prod.conf')
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')

var spinner = ora('building for production...')
const spinner = ora('building for production...')
spinner.start()

rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, function (err, stats) {
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')

if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}

console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
Expand Down
28 changes: 17 additions & 11 deletions build/check-versions.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
var chalk = require('chalk')
var semver = require('semver')
var packageConfig = require('../package.json')
var shell = require('shelljs')
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')

function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}

var versionRequirements = [
const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
},
}
]

if (shell.which('npm')) {
Expand All @@ -23,9 +25,11 @@ if (shell.which('npm')) {
}

module.exports = function () {
var warnings = []
for (var i = 0; i < versionRequirements.length; i++) {
var mod = versionRequirements[i]
const warnings = []

for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]

if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
Expand All @@ -38,10 +42,12 @@ module.exports = function () {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (var i = 0; i < warnings.length; i++) {
var warning = warnings[i]

for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}

console.log()
process.exit(1)
}
Expand Down
9 changes: 0 additions & 9 deletions build/dev-client.js

This file was deleted.

89 changes: 0 additions & 89 deletions build/dev-server.js

This file was deleted.

Binary file added build/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7f75e9a

Please sign in to comment.