From 549078351ef381e9b4cdd73d7aa7a4d57534e4a2 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Fri, 15 Dec 2017 17:04:44 +0100 Subject: [PATCH 01/11] fix #1140 --- template/build/webpack.base.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/build/webpack.base.conf.js b/template/build/webpack.base.conf.js index 16e6c0c..391160c 100644 --- a/template/build/webpack.base.conf.js +++ b/template/build/webpack.base.conf.js @@ -53,7 +53,7 @@ module.exports = { { test: /\.js$/, loader: 'babel-loader', - include: [resolve('src'), resolve('test')] + include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] }, { test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, From cd4d7d957c9af3d37092c79bf490b56b8d88b108 Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Sun, 17 Dec 2017 19:54:55 +0100 Subject: [PATCH 02/11] fix typo in a comment (#1183) --- template/build/webpack.prod.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/build/webpack.prod.conf.js b/template/build/webpack.prod.conf.js index bf613e8..fc5d53f 100644 --- a/template/build/webpack.prod.conf.js +++ b/template/build/webpack.prod.conf.js @@ -78,7 +78,7 @@ const webpackConfig = merge(baseWebpackConfig, { // necessary to consistently work with multiple chunks via CommonsChunkPlugin chunksSortMode: 'dependency' }), - // keep module.id stable when vender modules does not change + // keep module.id stable when vendor modules does not change new webpack.HashedModuleIdsPlugin(), // enable scope hoisting new webpack.optimize.ModuleConcatenationPlugin(), From 3f232bff489238a0b8c47165175168e229472512 Mon Sep 17 00:00:00 2001 From: Suhas Karanth Date: Wed, 27 Dec 2017 22:07:31 +0530 Subject: [PATCH 03/11] Load, render template version using helper (#1202) --- meta.js | 8 +++++++- template/config/index.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/meta.js b/meta.js index 4371faa..f318f2b 100644 --- a/meta.js +++ b/meta.js @@ -6,10 +6,13 @@ const { runLintFix, printMessage, } = require('./utils') +const pkg = require('./package.json') + +const templateVersion = pkg.version module.exports = { helpers: { - if_or: function(v1, v2, options) { + if_or(v1, v2, options) { if (v1 || v2) { return options.fn(this) } @@ -17,6 +20,9 @@ module.exports = { return options.inverse(this) }, }, + template_version() { + return templateVersion + }, prompts: { name: { type: 'string', diff --git a/template/config/index.js b/template/config/index.js index f0d536b..9cb902f 100644 --- a/template/config/index.js +++ b/template/config/index.js @@ -1,5 +1,5 @@ 'use strict' -// Template version: 1.2.7 +// Template version: {{ template_version }} // see http://vuejs-templates.github.io/webpack for documentation. const path = require('path') From b30c4aadf736568fa37618c0437e1499887e0f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20L=C3=BCnborg?= Date: Wed, 27 Dec 2017 17:37:57 +0100 Subject: [PATCH 04/11] Fix static file serving for publicPath != `/` (fix#1176) (#1180) * Batman! * fix typo --- template/build/webpack.dev.conf.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/template/build/webpack.dev.conf.js b/template/build/webpack.dev.conf.js index 03e9428..11ce7d3 100755 --- a/template/build/webpack.dev.conf.js +++ b/template/build/webpack.dev.conf.js @@ -3,7 +3,9 @@ const utils = require('./utils') const webpack = require('webpack') const config = require('../config') const merge = require('webpack-merge') +const path = require('path') const baseWebpackConfig = require('./webpack.base.conf') +const CopyWebpackPlugin = require('copy-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') const portfinder = require('portfinder') @@ -23,6 +25,7 @@ const devWebpackConfig = merge(baseWebpackConfig, { clientLogLevel: 'warning', historyApiFallback: true, hot: true, + contentBase: false, // since we use CopyWebpackPlugin. compress: true, host: HOST || config.dev.host, port: PORT || config.dev.port, @@ -50,6 +53,14 @@ const devWebpackConfig = merge(baseWebpackConfig, { template: 'index.html', inject: true }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) ] }) From c48c910eaf599537c81e75331f6309487c575695 Mon Sep 17 00:00:00 2001 From: Suhas Karanth Date: Thu, 28 Dec 2017 13:44:07 +0530 Subject: [PATCH 05/11] Change engine>node{4 => 6} for template (#1206) --- template/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/package.json b/template/package.json index 1cadecc..ba2b702 100644 --- a/template/package.json +++ b/template/package.json @@ -118,7 +118,7 @@ "webpack-merge": "^4.1.0" }, "engines": { - "node": ">= 4.0.0", + "node": ">= 6.0.0", "npm": ">= 3.0.0" }, "browserslist": [ From a8ba91f494db5121c84a719ae8df81ddb7296eb0 Mon Sep 17 00:00:00 2001 From: z Date: Fri, 29 Dec 2017 22:53:48 +0800 Subject: [PATCH 06/11] Add postcss-url to match postcss-import (#1115) --- template/.postcssrc.js | 3 ++- template/package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/template/.postcssrc.js b/template/.postcssrc.js index 249472d..eee3e92 100644 --- a/template/.postcssrc.js +++ b/template/.postcssrc.js @@ -2,8 +2,9 @@ module.exports = { "plugins": { - // to edit target browsers: use "browserslist" field in package.json "postcss-import": {}, + "postcss-url": {}, + // to edit target browsers: use "browserslist" field in package.json "autoprefixer": {} } } diff --git a/template/package.json b/template/package.json index ba2b702..a135953 100644 --- a/template/package.json +++ b/template/package.json @@ -102,6 +102,7 @@ "node-notifier": "^5.1.2", "postcss-import": "^11.0.0", "postcss-loader": "^2.0.8", + "postcss-url": "^7.2.1", "semver": "^5.3.0", "shelljs": "^0.7.6", "optimize-css-assets-webpack-plugin": "^3.2.0", From 89998068807e71b674eeca51e91d55aa183adadc Mon Sep 17 00:00:00 2001 From: Evan You Date: Sun, 31 Dec 2017 00:04:25 -0500 Subject: [PATCH 07/11] use old sourcemap option --- template/config/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/config/index.js b/template/config/index.js index 9cb902f..fc20199 100644 --- a/template/config/index.js +++ b/template/config/index.js @@ -34,7 +34,7 @@ module.exports = { */ // https://webpack.js.org/configuration/devtool/#development - devtool: 'eval-source-map', + devtool: 'cheap-module-eval-source-map', // If you have problems debugging vue-files in devtools, // set this to false - it *may* help From 77f818fa7e1cad836d5d89164c2c93bccc4a5b96 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Sun, 31 Dec 2017 14:31:24 +0100 Subject: [PATCH 08/11] Ensure page reloads in history mode serve index.html After the switch to CopyWebpackPlugin (#1176), historyAPIFallback had to be adjusted to still serve index.html from all catched paths correctly. See: https://github.com/vuejs-templates/webpack/issues/1176#issuecomment-354347953 --- template/build/webpack.dev.conf.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/template/build/webpack.dev.conf.js b/template/build/webpack.dev.conf.js index 11ce7d3..d950ba5 100755 --- a/template/build/webpack.dev.conf.js +++ b/template/build/webpack.dev.conf.js @@ -23,7 +23,11 @@ const devWebpackConfig = merge(baseWebpackConfig, { // these devServer options should be customized in /config/index.js devServer: { clientLogLevel: 'warning', - historyApiFallback: true, + historyApiFallback: { + rewrites: [ + { from: /.*/, to: path.join(config.dev.assetsPublicPath, 'index.html') }, + ], + }, hot: true, contentBase: false, // since we use CopyWebpackPlugin. compress: true, From 1b7687130ca22f7f8f77499aeeca49aa81eb4c1c Mon Sep 17 00:00:00 2001 From: Thorsten Date: Sun, 31 Dec 2017 14:33:14 +0100 Subject: [PATCH 09/11] Make CSS sourcemaps on by default The problem described shouldn't even matter since it's a prob of style-loader, and we use vue-style-loader which had this fixed a long time ago --- template/config/index.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/template/config/index.js b/template/config/index.js index fc20199..d1ec13d 100644 --- a/template/config/index.js +++ b/template/config/index.js @@ -41,12 +41,7 @@ module.exports = { // https://vue-loader.vuejs.org/en/options.html#cachebusting cacheBusting: true, - // CSS Sourcemaps off by default because relative paths are "buggy" - // with this option, according to the CSS-Loader README - // (https://github.com/webpack/css-loader#sourcemaps) - // In our experience, they generally work as expected, - // just be aware of this issue when enabling this option. - cssSourceMap: false, + cssSourceMap: true, }, build: { From 834abb709518376f4f5366b6582d4d2fb6fc611a Mon Sep 17 00:00:00 2001 From: Thorsten Date: Sun, 31 Dec 2017 14:53:54 +0100 Subject: [PATCH 10/11] fix bug with #1202 helper function was outside of the helpe object where it would belong --- meta.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/meta.js b/meta.js index f318f2b..0dc63e6 100644 --- a/meta.js +++ b/meta.js @@ -19,10 +19,11 @@ module.exports = { return options.inverse(this) }, + template_version() { + return templateVersion + }, }, - template_version() { - return templateVersion - }, + prompts: { name: { type: 'string', From 52003cd5971831decd5b20644641653b18982c28 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Sun, 31 Dec 2017 14:54:33 +0100 Subject: [PATCH 11/11] bump template version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8dc8968..3b8c657 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-cli-template-webpack", - "version": "1.2.7", + "version": "1.2.8", "license": "MIT", "description": "A full-featured Webpack setup with hot-reload, lint-on-save, unit testing & css extraction.", "scripts": {