Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 65aaffe

Browse filesBrowse files
committed
upgrade webpack/eslint and fix linting issues
1 parent 5d50069 commit 65aaffe
Copy full SHA for 65aaffe

File tree

Expand file treeCollapse file tree

7 files changed

+266
-206
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+266
-206
lines changed

‎.eslintrc

Copy file name to clipboard
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"extends": "vue",
2+
"extends": ["plugin:vue/recommended"],
33
"rules": {
44
"space-before-function-paren": [2, "never"],
55
"indent": ["error",4],
66
"camelcase": [2, {"properties": "never"}]
77
}
8-
}
8+
}

‎build/webpack.dev.js

Copy file name to clipboard
+33-19Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
11
let path = require('path')
22
let webpack = require('webpack')
3+
const VueLoaderPlugin = require('vue-loader/lib/plugin')
34

45
module.exports = {
5-
entry: {
6-
'paystack': './examples/commonjs/app.js'
7-
},
8-
output: {
9-
path: path.resolve(__dirname, '../dist'),
10-
publicPath: '/dist/',
11-
filename: '[name].js'
12-
},
13-
module: {
14-
rules: [{
15-
test: /\.vue$/,
16-
loader: 'vue-loader'
17-
}, {
18-
test: /\.js$/,
19-
loader: 'babel-loader',
20-
exclude: /node_modules/
21-
}]
22-
},
23-
devtool: 'eval-source-map'
6+
entry: {
7+
'paystack': './examples/commonjs/app.js'
8+
},
9+
output: {
10+
path: path.resolve(__dirname, '../dist'),
11+
publicPath: '/dist/',
12+
filename: '[name].js'
13+
},
14+
module: {
15+
rules: [{
16+
test: /\.vue$/,
17+
loader: 'vue-loader'
18+
}, {
19+
test: /\.js$/,
20+
loader: 'babel-loader',
21+
exclude: /node_modules/
22+
}, {
23+
test: /\.css$/,
24+
use: [
25+
'vue-style-loader',
26+
'css-loader'
27+
]
28+
}]
29+
},
30+
plugins: [
31+
new VueLoaderPlugin(),
32+
new webpack.LoaderOptionsPlugin({
33+
minimize: true,
34+
debug: false
35+
})
36+
],
37+
devtool: 'eval-source-map'
2438
}

‎build/webpack.dist.js

Copy file name to clipboard
+75-40Lines changed: 75 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,80 @@
11
var path = require('path')
22
var webpack = require('webpack')
3+
const VueLoaderPlugin = require('vue-loader/lib/plugin')
4+
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
35

46
module.exports = {
5-
entry: {
6-
'paystack': './src/index.js'
7-
},
8-
output: {
9-
path: path.resolve(__dirname, '../dist'),
10-
publicPath: '/dist/',
11-
filename: '[name].min.js',
12-
library: 'VuePaystack',
13-
libraryTarget: 'umd',
14-
umdNamedDefine: true
15-
},
16-
module: {
17-
rules: [{
18-
enforce: 'pre',
19-
test: /\.(js|vue)$/,
20-
exclude: /node_modules/,
21-
loader: 'eslint-loader'
22-
}, {
23-
test: /\.vue$/,
24-
loader: 'vue-loader'
25-
}, {
26-
test: /\.js$/,
27-
loader: 'babel-loader',
28-
exclude: /node_modules/
29-
}]
30-
},
31-
plugins: [
32-
new webpack.LoaderOptionsPlugin({
33-
minimize: true,
34-
debug: false
35-
}),
36-
new webpack.optimize.UglifyJsPlugin({
37-
sourceMap: true,
38-
include: /\.min\.js$/,
39-
compress: {
40-
warnings: false
41-
}
42-
})
43-
],
44-
devtool: 'source-map'
7+
entry: {
8+
'paystack': './src/index.js'
9+
},
10+
output: {
11+
path: path.resolve(__dirname, '../dist'),
12+
publicPath: '/dist/',
13+
filename: '[name].min.js',
14+
library: 'VuePaystack',
15+
libraryTarget: 'umd',
16+
umdNamedDefine: true
17+
},
18+
module: {
19+
rules: [{
20+
enforce: 'pre',
21+
test: /\.(js|vue)$/,
22+
exclude: /node_modules/,
23+
loader: 'eslint-loader'
24+
}, {
25+
test: /\.vue$/,
26+
loader: 'vue-loader'
27+
}, {
28+
test: /\.js$/,
29+
loader: 'babel-loader',
30+
exclude: /node_modules/
31+
}, {
32+
test: /\.css$/,
33+
use: [
34+
'vue-style-loader',
35+
'css-loader'
36+
]
37+
}]
38+
},
39+
optimization: {
40+
minimizer: [
41+
new UglifyJsPlugin({
42+
uglifyOptions: {
43+
output: {
44+
comments: false
45+
},
46+
compress: {
47+
unsafe_comps: true,
48+
properties: true,
49+
keep_fargs: false,
50+
pure_getters: true,
51+
collapse_vars: true,
52+
unsafe: true,
53+
warnings: false,
54+
sequences: true,
55+
dead_code: true,
56+
drop_debugger: true,
57+
comparisons: true,
58+
conditionals: true,
59+
evaluate: true,
60+
booleans: true,
61+
loops: true,
62+
unused: true,
63+
hoist_funs: true,
64+
if_return: true,
65+
join_vars: true,
66+
drop_console: true
67+
}
68+
}
69+
})
70+
]
71+
},
72+
plugins: [
73+
new VueLoaderPlugin(),
74+
new webpack.LoaderOptionsPlugin({
75+
minimize: true,
76+
debug: false
77+
})
78+
],
79+
devtool: 'source-map'
4580
}

‎dist/paystack.min.js

Copy file name to clipboardExpand all lines: dist/paystack.min.js
+1-2Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/paystack.min.js.map

Copy file name to clipboardExpand all lines: dist/paystack.min.js.map
-1Lines changed: 0 additions & 1 deletion
This file was deleted.

‎package.json

Copy file name to clipboardExpand all lines: package.json
+13-11Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,20 @@
3131
},
3232
"homepage": "",
3333
"devDependencies": {
34-
"babel-core": "^6.24.1",
35-
"babel-loader": "^7.0.0",
34+
"babel-core": "^6.26.3",
35+
"babel-loader": "^7.1.5",
3636
"babel-preset-es2015": "^6.18.0",
37-
"css-loader": "^0.28.1",
37+
"css-loader": "^1.0.0",
3838
"eslint-config-vue": "^2.0.2",
39-
"eslint-loader": "^1.7.1",
40-
"eslint-plugin-vue": "^2.0.1",
41-
"standard": "^10.0.3",
42-
"vue": "^2.5.2",
43-
"vue-loader": "^13.3.0",
44-
"vue-template-compiler": "^2.5.2",
45-
"webpack": "^3.8.1",
46-
"webpack-dev-server": "^2.9.4"
39+
"eslint-loader": "^2.1.0",
40+
"eslint-plugin-vue": "^4.7.1",
41+
"standard": "^11.0.1",
42+
"uglifyjs-webpack-plugin": "^1.3.0",
43+
"vue": "^2.5.17",
44+
"vue-loader": "^15.3.0",
45+
"vue-template-compiler": "^2.5.17",
46+
"webpack": "^4.16.5",
47+
"webpack-cli": "^3.1.0",
48+
"webpack-dev-server": "^3.1.5"
4749
}
4850
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.