diff --git a/webpack.config.dev.js b/webpack.config.dev.js index 84f09e3c..2fb71a17 100644 --- a/webpack.config.dev.js +++ b/webpack.config.dev.js @@ -1,3 +1,4 @@ +/* eslint-disable */ var webpack = require('webpack'); var HtmlWebpackPlugin = require('html-webpack-plugin'); @@ -5,7 +6,7 @@ const commonWebpackConfig = require('./webpack.config'); const developmentWebpackConfig = Object.assign(commonWebpackConfig, { cache: true, - devtool: 'eval', + devtool: 'eval-source-map', entry: [ 'babel-polyfill', 'babel-regenerator-runtime', @@ -18,11 +19,15 @@ developmentWebpackConfig.module.loaders.push({ test: /\.s?css$/, loader: 'style-loader!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass?sourceMap', }); -developmentWebpackConfig.plugins.push(new webpack.optimize.OccurenceOrderPlugin()); +developmentWebpackConfig.plugins.push( + new webpack.optimize.OccurenceOrderPlugin() +); developmentWebpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin()); developmentWebpackConfig.plugins.push(new webpack.NoErrorsPlugin()); -developmentWebpackConfig.plugins.push(new HtmlWebpackPlugin({ - title: 'Atlas', -})); +developmentWebpackConfig.plugins.push( + new HtmlWebpackPlugin({ + title: 'Atlas', + }) +); module.exports = developmentWebpackConfig; diff --git a/webpack.config.prod.js b/webpack.config.prod.js index 6c7630ba..1c460696 100644 --- a/webpack.config.prod.js +++ b/webpack.config.prod.js @@ -1,18 +1,15 @@ +/* eslint-disable */ var path = require('path'); var webpack = require('webpack'); var HtmlWebpackPlugin = require('html-webpack-plugin'); -var ExtractTextPlugin = require("extract-text-webpack-plugin"); +var ExtractTextPlugin = require('extract-text-webpack-plugin'); commonWebpackConfig = require('./webpack.config'); productionWebpackConfig = Object.assign(commonWebpackConfig, { cache: true, devtool: 'cheap-module-source-map', - entry: [ - 'babel-polyfill', - 'babel-regenerator-runtime', - './frontend/index', - ], + entry: ['babel-polyfill', 'babel-regenerator-runtime', './frontend/index'], output: { path: path.join(__dirname, 'dist'), filename: 'bundle.[hash].js', @@ -21,25 +18,34 @@ productionWebpackConfig = Object.assign(commonWebpackConfig, { }); productionWebpackConfig.module.loaders.push({ test: /\.s?css$/, - loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass?sourceMap') + loader: ExtractTextPlugin.extract( + 'style-loader', + 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass?sourceMap' + ), }); -productionWebpackConfig.plugins.push(new HtmlWebpackPlugin({ - template: 'server/static/index.html' -})); -productionWebpackConfig.plugins.push(new ExtractTextPlugin('styles.[hash].css')); -productionWebpackConfig.plugins.push(new webpack.optimize.OccurenceOrderPlugin()); +productionWebpackConfig.plugins.push( + new HtmlWebpackPlugin({ + template: 'server/static/index.html', + }) +); +productionWebpackConfig.plugins.push( + new ExtractTextPlugin('styles.[hash].css') +); +productionWebpackConfig.plugins.push( + new webpack.optimize.OccurenceOrderPlugin() +); productionWebpackConfig.plugins.push( new webpack.optimize.UglifyJsPlugin({ compress: { - warnings: false - } + warnings: false, + }, }) ); productionWebpackConfig.plugins.push( new webpack.DefinePlugin({ 'process.env': { - 'NODE_ENV': JSON.stringify('production') - } + NODE_ENV: JSON.stringify('production'), + }, }) );