Skip to content
This repository was archived by the owner on Nov 29, 2020. It is now read-only.

Commit 6963ed7

Browse files
committed
fix eslint warnings and errors in webpack configs
1 parent 24b3a27 commit 6963ed7

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

webpack.config.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
const { resolve } = require('path');
22

3-
var webpack = require('webpack');
4-
var ExtractTextPlugin = require('extract-text-webpack-plugin');
5-
var CopyWebpackPlugin = require('copy-webpack-plugin');
6-
var OpenBrowserPlugin = require('open-browser-webpack-plugin');
3+
const webpack = require('webpack');
4+
const ExtractTextPlugin = require('extract-text-webpack-plugin');
5+
const CopyWebpackPlugin = require('copy-webpack-plugin');
6+
const OpenBrowserPlugin = require('open-browser-webpack-plugin');
77

8-
var config = {
8+
const config = {
99
devtool: 'cheap-module-eval-source-map',
1010

1111
entry: [
1212
'react-hot-loader/patch',
1313
'webpack-dev-server/client?http://localhost:8080',
1414
'webpack/hot/only-dev-server',
1515
'./main.js',
16-
'./assets/scss/main.scss'
16+
'./assets/scss/main.scss',
1717
],
1818

1919
output: {
@@ -27,7 +27,7 @@ var config = {
2727
devServer: {
2828
hot: true,
2929
contentBase: resolve(__dirname, 'dist'),
30-
publicPath: '/'
30+
publicPath: '/',
3131
},
3232

3333
module: {
@@ -37,37 +37,37 @@ var config = {
3737
loaders: [
3838
'babel-loader',
3939
],
40-
exclude: /node_modules/
40+
exclude: /node_modules/,
4141
},
4242
{
4343
test: /\.scss$/,
4444
exclude: /node_modules/,
4545
loader: ExtractTextPlugin.extract({
46-
fallbackLoader: "style-loader",
46+
fallbackLoader: 'style-loader',
4747
loader: [
4848
'css-loader',
4949
{
5050
loader: 'sass-loader',
5151
query: {
5252
sourceMap: false,
53-
}
54-
}
55-
]
56-
})
53+
},
54+
},
55+
],
56+
}),
5757
},
5858
{
5959
test: /\.(png|jpg)$/,
60-
loader: 'url?limit=15000'
61-
}
62-
]
60+
loader: 'url?limit=15000',
61+
},
62+
],
6363
},
6464

6565
plugins: [
66-
new ExtractTextPlugin({ filename: 'style.css', disable: false, allChunks: true}),
66+
new ExtractTextPlugin({ filename: 'style.css', disable: false, allChunks: true }),
6767
new CopyWebpackPlugin([{ from: 'vendors', to: 'vendors' }]),
6868
new OpenBrowserPlugin({ url: 'http://localhost:8080' }),
6969
new webpack.HotModuleReplacementPlugin(),
70-
]
70+
],
7171
};
7272

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

webpack.production.config.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
var { resolve } = require('path');
2-
var webpack = require('webpack');
3-
var HtmlWebpackPlugin = require('html-webpack-plugin');
4-
var CopyWebpackPlugin = require('copy-webpack-plugin');
5-
var ExtractTextPlugin = require("extract-text-webpack-plugin");
1+
const { resolve } = require('path');
2+
const webpack = require('webpack');
3+
const HtmlWebpackPlugin = require('html-webpack-plugin');
4+
const CopyWebpackPlugin = require('copy-webpack-plugin');
5+
const ExtractTextPlugin = require('extract-text-webpack-plugin');
66

7-
var config = {
7+
const config = {
88
devtool: 'cheap-module-source-map',
99

1010
entry: [
1111
'./main.js',
12-
'./assets/scss/main.scss'
12+
'./assets/scss/main.scss',
1313
],
1414

1515
context: resolve(__dirname, 'app'),
@@ -22,55 +22,55 @@ var config = {
2222

2323
plugins: [
2424
new HtmlWebpackPlugin({
25-
template: __dirname + '/app/index.html',
25+
template: `${__dirname}/app/index.html`,
2626
filename: 'index.html',
27-
inject: 'body'
27+
inject: 'body',
2828
}),
2929
new webpack.optimize.OccurrenceOrderPlugin(),
3030
new webpack.LoaderOptionsPlugin({
3131
minimize: true,
32-
debug: false
32+
debug: false,
3333
}),
3434
new webpack.optimize.UglifyJsPlugin({
3535
beautify: false,
3636
mangle: {
3737
screw_ie8: true,
38-
keep_fnames: true
38+
keep_fnames: true,
3939
},
4040
compress: {
41-
screw_ie8: true
41+
screw_ie8: true,
4242
},
43-
comments: false
43+
comments: false,
4444
}),
4545
new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production') } }),
46-
new ExtractTextPlugin({ filename: 'style.css', disable: false, allChunks: true}),
47-
new CopyWebpackPlugin([{ from: './vendors', to: 'vendors' }])
46+
new ExtractTextPlugin({ filename: 'style.css', disable: false, allChunks: true }),
47+
new CopyWebpackPlugin([{ from: './vendors', to: 'vendors' }]),
4848
],
4949

5050
module: {
5151
loaders: [
5252
{
5353
test: /\.js?$/,
5454
exclude: /node_modules/,
55-
loader: 'babel-loader'
55+
loader: 'babel-loader',
5656
},
5757
{
5858
test: /\.scss$/,
5959
exclude: /node_modules/,
6060
loader: ExtractTextPlugin.extract({
61-
fallbackLoader: "style-loader",
61+
fallbackLoader: 'style-loader',
6262
loader: [
6363
'css-loader',
64-
{ loader: 'sass-loader', query: { sourceMap: false } }
65-
]
66-
})
64+
{ loader: 'sass-loader', query: { sourceMap: false } },
65+
],
66+
}),
6767
},
6868
{
6969
test: /\.(png|jpg)$/,
70-
loader: 'url?limit=15000'
70+
loader: 'url?limit=15000',
7171
},
72-
]
72+
],
7373
},
7474
};
7575

76-
module.exports = config;
76+
module.exports = config;

0 commit comments

Comments
 (0)