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

Commit

Permalink
fix eslint warnings and errors in webpack configs
Browse files Browse the repository at this point in the history
  • Loading branch information
KleoPetroff committed Jan 30, 2017
1 parent 24b3a27 commit 6963ed7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
38 changes: 19 additions & 19 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
const { resolve } = require('path');

var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var OpenBrowserPlugin = require('open-browser-webpack-plugin');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const OpenBrowserPlugin = require('open-browser-webpack-plugin');

var config = {
const config = {
devtool: 'cheap-module-eval-source-map',

entry: [
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./main.js',
'./assets/scss/main.scss'
'./assets/scss/main.scss',
],

output: {
Expand All @@ -27,7 +27,7 @@ var config = {
devServer: {
hot: true,
contentBase: resolve(__dirname, 'dist'),
publicPath: '/'
publicPath: '/',
},

module: {
Expand All @@ -37,37 +37,37 @@ var config = {
loaders: [
'babel-loader',
],
exclude: /node_modules/
exclude: /node_modules/,
},
{
test: /\.scss$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract({
fallbackLoader: "style-loader",
fallbackLoader: 'style-loader',
loader: [
'css-loader',
{
loader: 'sass-loader',
query: {
sourceMap: false,
}
}
]
})
},
},
],
}),
},
{
test: /\.(png|jpg)$/,
loader: 'url?limit=15000'
}
]
loader: 'url?limit=15000',
},
],
},

plugins: [
new ExtractTextPlugin({ filename: 'style.css', disable: false, allChunks: true}),
new ExtractTextPlugin({ filename: 'style.css', disable: false, allChunks: true }),
new CopyWebpackPlugin([{ from: 'vendors', to: 'vendors' }]),
new OpenBrowserPlugin({ url: 'http://localhost:8080' }),
new webpack.HotModuleReplacementPlugin(),
]
],
};

module.exports = config;
module.exports = config;
46 changes: 23 additions & 23 deletions webpack.production.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
var { resolve } = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
const { resolve } = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

var config = {
const config = {
devtool: 'cheap-module-source-map',

entry: [
'./main.js',
'./assets/scss/main.scss'
'./assets/scss/main.scss',
],

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

plugins: [
new HtmlWebpackPlugin({
template: __dirname + '/app/index.html',
template: `${__dirname}/app/index.html`,
filename: 'index.html',
inject: 'body'
inject: 'body',
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
debug: false,
}),
new webpack.optimize.UglifyJsPlugin({
beautify: false,
mangle: {
screw_ie8: true,
keep_fnames: true
keep_fnames: true,
},
compress: {
screw_ie8: true
screw_ie8: true,
},
comments: false
comments: false,
}),
new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production') } }),
new ExtractTextPlugin({ filename: 'style.css', disable: false, allChunks: true}),
new CopyWebpackPlugin([{ from: './vendors', to: 'vendors' }])
new ExtractTextPlugin({ filename: 'style.css', disable: false, allChunks: true }),
new CopyWebpackPlugin([{ from: './vendors', to: 'vendors' }]),
],

module: {
loaders: [
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader'
loader: 'babel-loader',
},
{
test: /\.scss$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract({
fallbackLoader: "style-loader",
fallbackLoader: 'style-loader',
loader: [
'css-loader',
{ loader: 'sass-loader', query: { sourceMap: false } }
]
})
{ loader: 'sass-loader', query: { sourceMap: false } },
],
}),
},
{
test: /\.(png|jpg)$/,
loader: 'url?limit=15000'
loader: 'url?limit=15000',
},
]
],
},
};

module.exports = config;
module.exports = config;

0 comments on commit 6963ed7

Please sign in to comment.