Skip to content
This repository was archived by the owner on Apr 9, 2022. It is now read-only.

Commit 08e1aaf

Browse files
committed
apply build changes and config defaults from template v1.3.1
1 parent c8b606f commit 08e1aaf

File tree

8 files changed

+33
-21
lines changed

8 files changed

+33
-21
lines changed

client/.eslintrc.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
module.exports = {
44
root: true,
5-
parser: 'babel-eslint',
65
parserOptions: {
7-
sourceType: 'module'
6+
parser: 'babel-eslint'
87
},
98
env: {
109
browser: true,
1110
},
12-
extends: 'airbnb-base',
11+
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
12+
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
13+
extends: ['plugin:vue/essential', 'airbnb-base'],
1314
// required to lint *.vue files
1415
plugins: [
15-
'html'
16+
'vue'
1617
],
1718
// check if imports actually resolve
1819
settings: {

client/.postcssrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
module.exports = {
44
"plugins": {
5-
// to edit target browsers: use "browserslist" field in package.json
65
"postcss-import": {},
6+
"postcss-url": {},
7+
// to edit target browsers: use "browserslist" field in package.json
78
"autoprefixer": {}
89
}
910
}

client/build/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
2222
process.stdout.write(stats.toString({
2323
colors: true,
2424
modules: false,
25-
children: false, // if you are using ts-loader, setting this to true will make tyescript errors show up during build
25+
children: false, // if you are using ts-loader, setting this to true will make TypeScript errors show up during build
2626
chunks: false,
2727
chunkModules: false
2828
}) + '\n\n')

client/build/webpack.base.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = {
4949
{
5050
test: /\.js$/,
5151
loader: 'babel-loader',
52-
include: [resolve('src'), resolve('test')]
52+
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
5353
},
5454
{
5555
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,

client/build/webpack.dev.conf.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ const utils = require('./utils')
33
const webpack = require('webpack')
44
const config = require('../config')
55
const merge = require('webpack-merge')
6+
const path = require('path')
67
const baseWebpackConfig = require('./webpack.base.conf')
8+
const CopyWebpackPlugin = require('copy-webpack-plugin')
79
const HtmlWebpackPlugin = require('html-webpack-plugin')
810
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
911
const portfinder = require('portfinder')
@@ -24,8 +26,13 @@ const devWebpackConfig = merge(baseWebpackConfig, {
2426
// these devServer options should be customized in /config/index.js
2527
devServer: {
2628
clientLogLevel: 'warning',
27-
historyApiFallback: true,
29+
historyApiFallback: {
30+
rewrites: [
31+
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
32+
],
33+
},
2834
hot: true,
35+
contentBase: false, // since we use CopyWebpackPlugin.
2936
compress: true,
3037
host: HOST || config.dev.host,
3138
port: PORT || config.dev.port,
@@ -53,6 +60,14 @@ const devWebpackConfig = merge(baseWebpackConfig, {
5360
template: 'index.html',
5461
inject: true
5562
}),
63+
// copy custom static assets
64+
new CopyWebpackPlugin([
65+
{
66+
from: path.resolve(__dirname, '../static'),
67+
to: config.dev.assetsSubDirectory,
68+
ignore: ['.*']
69+
}
70+
])
5671
]
5772
})
5873

client/build/webpack.prod.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const webpackConfig = merge(baseWebpackConfig, {
7878
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
7979
chunksSortMode: 'dependency'
8080
}),
81-
// keep module.id stable when vender modules does not change
81+
// keep module.id stable when vendor modules does not change
8282
new webpack.HashedModuleIdsPlugin(),
8383
// enable scope hoisting
8484
new webpack.optimize.ModuleConcatenationPlugin(),

client/config/index.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict'
2-
// Template version: 1.2.7
2+
// Template version: 1.3.1
33
// see http://vuejs-templates.github.io/webpack for documentation.
44

55
const path = require('path')
@@ -46,13 +46,7 @@ module.exports = {
4646
// set this to false - it *may* help
4747
// https://vue-loader.vuejs.org/en/options.html#cachebusting
4848
cacheBusting: true,
49-
50-
// CSS Sourcemaps off by default because relative paths are "buggy"
51-
// with this option, according to the CSS-Loader README
52-
// (https://github.com/webpack/css-loader#sourcemaps)
53-
// In our experience, they generally work as expected,
54-
// just be aware of this issue when enabling this option.
55-
cssSourceMap: false,
49+
cssSourceMap: true,
5650
},
5751

5852
build: {

client/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"devDependencies": {
2323
"autoprefixer": "^7.1.2",
2424
"babel-core": "^6.22.1",
25-
"babel-eslint": "^7.1.1",
25+
"babel-eslint": "^8.2.1",
2626
"babel-helper-vue-jsx-merge-props": "^2.0.3",
2727
"babel-loader": "^7.1.1",
2828
"babel-plugin-istanbul": "^4.1.1",
@@ -39,13 +39,13 @@
3939
"cross-env": "^5.0.1",
4040
"cross-spawn": "^5.0.1",
4141
"css-loader": "^0.28.0",
42-
"eslint": "^3.19.0",
42+
"eslint": "^4.15.0",
4343
"eslint-config-airbnb-base": "^11.3.0",
4444
"eslint-friendly-formatter": "^3.0.0",
4545
"eslint-import-resolver-webpack": "^0.8.3",
4646
"eslint-loader": "^1.7.1",
47-
"eslint-plugin-html": "^3.0.0",
4847
"eslint-plugin-import": "^2.7.0",
48+
"eslint-plugin-vue": "^4.0.0",
4949
"extract-text-webpack-plugin": "^3.0.0",
5050
"file-loader": "^1.1.4",
5151
"friendly-errors-webpack-plugin": "^1.6.1",
@@ -69,6 +69,7 @@
6969
"portfinder": "^1.0.13",
7070
"postcss-import": "^11.0.0",
7171
"postcss-loader": "^2.0.8",
72+
"postcss-url": "^7.2.1",
7273
"rimraf": "^2.6.0",
7374
"selenium-server": "^3.0.1",
7475
"semver": "^5.3.0",
@@ -86,7 +87,7 @@
8687
"webpack-merge": "^4.1.0"
8788
},
8889
"engines": {
89-
"node": ">= 4.0.0",
90+
"node": ">= 6.0.0",
9091
"npm": ">= 3.0.0"
9192
},
9293
"browserslist": [

0 commit comments

Comments
 (0)