From accdeeca2759dc9e49010120c708aa72896a0a87 Mon Sep 17 00:00:00 2001 From: fouding Date: Sun, 23 Oct 2016 21:38:29 +0800 Subject: [PATCH 1/4] update to vue 2.0 --- client/webpack.config.js | 65 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 client/webpack.config.js diff --git a/client/webpack.config.js b/client/webpack.config.js new file mode 100644 index 0000000..1cb4d00 --- /dev/null +++ b/client/webpack.config.js @@ -0,0 +1,65 @@ +var path = require('path') +var webpack = require('webpack') + +module.exports = { + entry: './src/main.js', + output: { + path: path.resolve(__dirname, './dist'), + publicPath: '/dist/', + filename: 'build.js' + }, + module: { + rules: [{ + test: /\.vue$/, + loader: 'vue', + options: { + // vue-loader options go here + } + }, + { + test: /\.js$/, + loader: 'babel', + exclude: /node_modules/ + }, + { + test: /\.(png|jpg|gif|svg)$/, + loader: 'file', + options: { + name: '[name].[ext]?[hash]' + } + } + ] + }, + resolve: { + alias: { + 'vue$': 'vue/dist/vue' + } + }, + devServer: { + historyApiFallback: true, + noInfo: true, + port: 10010 //z http://stackoverflow.com/questions/33272967/how-to-make-the-webpack-dev-server-run-on-port-80-and-on-0-0-0-0-to-make-it-publ + }, + // devtool: '#eval-source-map' + devtool: '#inline-source-map' +} + +if (process.env.NODE_ENV === 'production') { + module.exports.devtool = '#source-map' + // http://vue-loader.vuejs.org/en/workflow/production.html + module.exports.plugins = (module.exports.plugins || []).concat([ + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: '"production"' + } + }), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + } + }), + new webpack.LoaderOptionsPlugin({ + minimize: true + }) + ]) +} \ No newline at end of file From fbd6176216dddf74e38dfdc3086037de15736210 Mon Sep 17 00:00:00 2001 From: fouding Date: Sun, 23 Oct 2016 23:37:42 +0800 Subject: [PATCH 2/4] upgrade to vue 2.0 --- client/.babelrc | 6 +- client/index.html | 6 +- client/package.json | 98 +++++++-------------------- client/src/components/Home.vue | 2 +- client/src/components/LogTime.vue | 19 ++++-- client/src/components/TimeEntries.vue | 18 ++--- client/src/main.js | 85 ++++++++++++++++++----- 7 files changed, 120 insertions(+), 114 deletions(-) diff --git a/client/.babelrc b/client/.babelrc index 41789ca..9897749 100644 --- a/client/.babelrc +++ b/client/.babelrc @@ -1,5 +1,5 @@ { - "presets": ["es2015", "stage-2"], - "plugins": ["transform-runtime"], - "comments": false + "presets": [ + ["es2015", { "modules": false }] + ] } diff --git a/client/index.html b/client/index.html index 571c1bf..e47c4e2 100644 --- a/client/index.html +++ b/client/index.html @@ -6,9 +6,7 @@ -
- - -
+
+ diff --git a/client/package.json b/client/package.json index 9c47345..48b8d55 100644 --- a/client/package.json +++ b/client/package.json @@ -1,74 +1,26 @@ { - "name": "vue-time-test", - "version": "0.1.0", - "description": "A Vue.js project", - "author": "Ryan Chenkie ", - "scripts": { - "dev": "node build/dev-server.js", - "build": "node build/build.js", - "unit": "karma start test/unit/karma.conf.js --single-run", - "e2e": "node test/e2e/runner.js", - "test": "npm run unit && npm run e2e" - }, - "dependencies": { - "vue": "^1.0.18", - "babel-runtime": "^5.8.0", - "vue-resource": "^0.7.0", - "vue-router": "^0.7.12" - }, - "devDependencies": { - "babel-core": "^6.0.0", - "babel-loader": "^6.0.0", - "babel-plugin-transform-runtime": "^6.0.0", - "babel-preset-es2015": "^6.0.0", - "babel-preset-stage-2": "^6.0.0", - "chai": "^3.5.0", - "chromedriver": "^2.21.2", - "connect-history-api-fallback": "^1.1.0", - "cross-spawn": "^2.1.5", - "css-loader": "^0.23.0", - "eslint": "^2.0.0", - "eslint-config-standard": "^5.1.0", - "eslint-friendly-formatter": "^1.2.2", - "eslint-loader": "^1.3.0", - "eslint-plugin-html": "^1.3.0", - "eslint-plugin-promise": "^1.0.8", - "eslint-plugin-standard": "^1.3.2", - "eventsource-polyfill": "^0.9.6", - "express": "^4.13.3", - "extract-text-webpack-plugin": "^1.0.1", - "file-loader": "^0.8.4", - "function-bind": "^1.0.2", - "html-webpack-plugin": "^2.8.1", - "http-proxy-middleware": "^0.12.0", - "inject-loader": "^2.0.1", - "isparta-loader": "^2.0.0", - "json-loader": "^0.5.4", - "karma": "^0.13.15", - "karma-coverage": "^0.5.5", - "karma-mocha": "^0.2.2", - "karma-phantomjs-launcher": "^1.0.0", - "karma-sinon-chai": "^1.2.0", - "karma-sourcemap-loader": "^0.3.7", - "karma-spec-reporter": "0.0.24", - "karma-webpack": "^1.7.0", - "lolex": "^1.4.0", - "mocha": "^2.4.5", - "nightwatch": "^0.8.18", - "ora": "^0.2.0", - "phantomjs-prebuilt": "^2.1.3", - "selenium-server": "2.53.0", - "shelljs": "^0.6.0", - "sinon": "^1.17.3", - "sinon-chai": "^2.8.0", - "url-loader": "^0.5.7", - "vue-hot-reload-api": "^1.2.0", - "vue-html-loader": "^1.0.0", - "vue-loader": "^8.2.1", - "vue-style-loader": "^1.0.0", - "webpack": "^1.12.2", - "webpack-dev-middleware": "^1.4.0", - "webpack-hot-middleware": "^2.6.0", - "webpack-merge": "^0.8.3" - } -} + "name": "simple-vue-time-tracker", + "description": "a vue timetracker inited with vue cli's webpack-simple template.", + "author": "fzh@ajyj", + "private": true, + "scripts": { + "dev": "cross-env NODE_ENV=development webpack-dev-server --open --inline --hot", + "build": "cross-env NODE_ENV=production webpack --progress --hide-modules" + }, + "dependencies": { + "vue": "^2.0.1", + "vue-resource": "^1.0.3", + "vue-router": "^2.0.1" + }, + "devDependencies": { + "babel-core": "^6.0.0", + "babel-loader": "^6.0.0", + "babel-preset-es2015": "^6.0.0", + "cross-env": "^3.0.0", + "css-loader": "^0.25.0", + "file-loader": "^0.9.0", + "vue-loader": "^9.7.0", + "webpack": "^2.1.0-beta.25", + "webpack-dev-server": "^2.1.0-beta.0" + } +} \ No newline at end of file diff --git a/client/src/components/Home.vue b/client/src/components/Home.vue index e79632f..d814fb8 100644 --- a/client/src/components/Home.vue +++ b/client/src/components/Home.vue @@ -3,7 +3,7 @@

Vue Time Tracker

- Get started by creating a time entry. + Get started by creating a time entry.

diff --git a/client/src/components/LogTime.vue b/client/src/components/LogTime.vue index 00c48ea..dbf2ff0 100644 --- a/client/src/components/LogTime.vue +++ b/client/src/components/LogTime.vue @@ -32,10 +32,10 @@ - +
- + \ No newline at end of file + diff --git a/client/src/components/TimeEntries.vue b/client/src/components/TimeEntries.vue index 3e864f6..8d5f242 100644 --- a/client/src/components/TimeEntries.vue +++ b/client/src/components/TimeEntries.vue @@ -1,11 +1,8 @@