Skip to content

Commit d857475

Browse files
author
Bill Stavroulakis
committed
update to node 11
1 parent 305b218 commit d857475

35 files changed

+15394
-10940
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"presets": [["es2015", { "modules": false }], "stage-2"],
2+
"presets": ["@babel/preset-env"],
33
"ignore": ["node_modules/*"]
44
}

.eslintrc.js

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
module.exports = {
2-
root: true,
3-
parser: 'babel-eslint',
4-
parserOptions: {
5-
sourceType: 'module'
6-
},
7-
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
8-
extends: 'standard',
9-
// required to lint *.vue files
10-
plugins: [
11-
'html'
2+
extends: [
3+
// add more generic rulesets here, such as:
4+
// 'eslint:recommended',
5+
'plugin:vue/recommended'
126
],
13-
// add your custom rules here
14-
'rules': {
15-
// allow paren-less arrow functions
16-
'arrow-parens': 0,
17-
// allow async-await
18-
'generator-star-spacing': 0,
19-
// allow debugger during development
20-
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
7+
rules: {
8+
// override/add rules settings here, such as:
9+
// 'vue/no-unused-vars': 'error'
2110
}
22-
}
11+
}

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
language: node_js
22
node_js:
3-
- "7"
4-
- "8"
3+
- "11"
54
script: npm run test --single-run

build/webpack.base.config.js

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,85 @@
1-
const path = require('path')
2-
const webpack = require('webpack')
3-
const vueConfig = require('./vue-loader.config')
1+
const path = require("path");
2+
const VueLoaderPlugin = require("vue-loader/lib/plugin");
3+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
44

55
const config = {
6-
devtool: '#source-map',
6+
devtool: "#source-map",
77
entry: {
8-
app: './src/client-entry.js',
9-
vendor: ['vue', 'vue-router', 'vuex', 'vuex-router-sync', 'axios']
8+
app: "./src/client-entry.js",
9+
vendor: ["vue", "vue-router", "vuex", "vuex-router-sync", "axios"]
1010
},
1111
resolve: {
12-
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
13-
extensions: ['.js', '.vue'],
12+
modules: [path.resolve(__dirname, "src"), "node_modules"],
13+
extensions: [".js", ".vue"],
1414
alias: {
15-
'src': path.resolve(__dirname, '../src'),
16-
'assets': path.resolve(__dirname, '../src/assets'),
17-
'components': path.resolve(__dirname, '../src/components'),
18-
'theme': path.resolve(__dirname, './src/theme'),
15+
src: path.resolve(__dirname, "../src"),
16+
assets: path.resolve(__dirname, "../src/assets"),
17+
components: path.resolve(__dirname, "../src/components"),
18+
theme: path.resolve(__dirname, "./src/theme")
1919
}
2020
},
2121
output: {
22-
path: path.resolve(__dirname, '../dist'),
23-
publicPath: '/',
24-
filename: (process.env.NODE_ENV === 'production') ? 'assets/js/[name].[hash].js' : 'assets/js/[name].js'
22+
path: path.resolve(__dirname, "../dist"),
23+
publicPath: "/",
24+
filename:
25+
process.env.NODE_ENV === "production"
26+
? "assets/js/[name].[hash].js"
27+
: "assets/js/[name].js"
2528
},
2629
module: {
2730
rules: [
2831
{
29-
enforce: 'pre',
32+
enforce: "pre",
3033
test: /\.js$/,
31-
loader: 'eslint-loader',
34+
loader: "eslint-loader",
3235
exclude: /node_modules/
3336
},
3437
{
35-
enforce: 'pre',
38+
enforce: "pre",
3639
test: /\.vue$/,
37-
loader: 'eslint-loader',
40+
loader: "eslint-loader",
3841
exclude: /node_modules/
3942
},
4043
{
4144
test: /\.vue$/,
42-
loader: 'vue-loader',
43-
options: {
44-
css: 'css-loader',
45-
'scss': 'css-loader|sass-loader'
46-
}
45+
loader: "vue-loader"
46+
},
47+
{
48+
test: /\.scss$/,
49+
use: ["vue-style-loader", "css-loader", "sass-loader"]
50+
},
51+
{
52+
test: /\.css$/,
53+
use: [
54+
process.env.NODE_ENV !== "production"
55+
? "vue-style-loader"
56+
: MiniCssExtractPlugin.loader,
57+
"css-loader"
58+
]
4759
},
4860
{
4961
test: /\.js$/,
50-
loader: 'babel-loader',
62+
loader: "babel-loader",
5163
exclude: /node_modules/
5264
},
5365
{
5466
test: /\.(png|jpg|gif|svg)$/,
55-
loader: 'file-loader',
67+
loader: "file-loader",
5668
options: {
57-
name: 'assets/[name].[ext]?[hash]'
69+
name: "assets/[name].[ext]?[hash]"
5870
}
5971
},
6072
{
6173
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
62-
loader: 'url-loader',
74+
loader: "url-loader",
6375
query: {
6476
limit: 10000,
65-
name: 'assets/fonts/[name]_[hash:7].[ext]'
77+
name: "assets/fonts/[name]_[hash:7].[ext]"
6678
}
6779
}
6880
]
6981
},
70-
plugins: []
71-
}
82+
plugins: [new VueLoaderPlugin()]
83+
};
7284

73-
module.exports = config
85+
module.exports = config;

build/webpack.client.config.js

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,46 @@ const path = require('path')
22
const base = require('./webpack.base.config')
33
const webpack = require('webpack')
44
const HtmlWebpackPlugin = require('html-webpack-plugin')
5-
const appConfig = require('../src/app.config.js')
6-
const ExtractTextPlugin = require('extract-text-webpack-plugin')
5+
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
76

87
const config = Object.assign({}, base, {
8+
mode: process.env.NODE_ENV,
9+
optimization: {
10+
splitChunks: {
11+
chunks: 'async',
12+
minSize: 30000,
13+
maxSize: 0,
14+
minChunks: 1,
15+
maxAsyncRequests: 5,
16+
maxInitialRequests: 3,
17+
automaticNameDelimiter: '~',
18+
name: true,
19+
cacheGroups: {
20+
vendor: {
21+
test: /[\\/]node_modules[\\/]/,
22+
priority: -10
23+
},
24+
default: {
25+
minChunks: 2,
26+
priority: -20,
27+
reuseExistingChunk: true
28+
}
29+
}
30+
}
31+
},
932
plugins: (base.plugins || []).concat([
1033
// strip comments in Vue code
1134
new webpack.DefinePlugin({
1235
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
1336
BROWSER_BUILD: true
14-
}),
15-
// extract vendor chunks for better caching
16-
new webpack.optimize.CommonsChunkPlugin({
17-
name: 'vendor',
18-
filename: (process.env.NODE_ENV === 'production') ? 'assets/js/[name].[hash].js' : 'assets/js/[name].js'
1937
})
2038
])
2139
})
2240

23-
config.module.rules.filter(x => { return x.loader == 'vue-loader'}).forEach( x => x.options.extractCSS = true)
24-
2541
config.plugins.push(
26-
new ExtractTextPlugin('assets/styles.css')
42+
new MiniCssExtractPlugin({
43+
filename: 'assets/styles.css'
44+
})
2745
)
2846

2947
if (process.env.NODE_ENV === 'production') {
@@ -39,20 +57,10 @@ if (process.env.NODE_ENV === 'production') {
3957
})
4058
)
4159
config.plugins.push(
42-
new ExtractTextPlugin('assets/styles.[hash].css'),
43-
new webpack.LoaderOptionsPlugin({
44-
minimize: true
45-
}),
46-
new webpack.optimize.UglifyJsPlugin({
47-
compress: {
48-
warnings: false
49-
}
60+
new MiniCssExtractPlugin({
61+
filename: 'assets/styles.[hash].css'
5062
})
5163
)
52-
} else {
53-
config.plugins.push(
54-
new ExtractTextPlugin('assets/styles.css')
55-
)
5664
}
5765

5866
module.exports = config

build/webpack.server.config.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
const path = require('path')
22
const webpack = require('webpack')
33
const base = require('./webpack.base.config')
4-
const ExtractTextPlugin = require('extract-text-webpack-plugin')
4+
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
55

66
const config = Object.assign({}, base, {
7+
mode: process.env.NODE_ENV,
78
target: 'node',
89
devtool: false,
910
entry: './src/server-entry.js',
@@ -23,19 +24,15 @@ const config = Object.assign({}, base, {
2324

2425
if (process.env.NODE_ENV === 'production') {
2526
config.plugins.push(
26-
new ExtractTextPlugin('assets/styles.[hash].css'),
27-
new webpack.LoaderOptionsPlugin({
28-
minimize: true
29-
}),
30-
new webpack.optimize.UglifyJsPlugin({
31-
compress: {
32-
warnings: false
33-
}
27+
new MiniCssExtractPlugin({
28+
filename: 'assets/styles.[hash].css'
3429
})
3530
)
3631
} else {
3732
config.plugins.push(
38-
new ExtractTextPlugin('assets/styles.css')
33+
new MiniCssExtractPlugin({
34+
filename: 'assets/styles.css'
35+
})
3936
)
4037
}
4138

0 commit comments

Comments
 (0)