From 68329698332939d74c48ba2d4ba6f2434a59cc56 Mon Sep 17 00:00:00 2001 From: Vladimir Metnev Date: Tue, 15 Aug 2017 01:05:52 +0300 Subject: [PATCH] feat(webpack_config/client): remove unused plugins, add WriteFilePlugin feat(webpack_config/client): remove unused plugins, add WriteFilePlugin, remove devtool re-assignment Removed plugins: - HtmlWebpackPlugin - webpack.NoEmitOnErrorsPlugin - FriendlyErrors --- webpack_config/client/webpack.dev.babel.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/webpack_config/client/webpack.dev.babel.js b/webpack_config/client/webpack.dev.babel.js index 66d9c5b7..fe309bde 100644 --- a/webpack_config/client/webpack.dev.babel.js +++ b/webpack_config/client/webpack.dev.babel.js @@ -1,8 +1,8 @@ import path from 'path' import webpack from 'webpack' -import HtmlWebpackPlugin from 'html-webpack-plugin' import baseWebpackConfig from './webpack.base' -import FriendlyErrors from 'friendly-errors-webpack-plugin' +import WriteFilePlugin from 'write-file-webpack-plugin' +// import AutoDllPlugin from 'autodll-webpack-plugin' import config from '../config' import _ from 'lodash' @@ -19,7 +19,6 @@ const loaders = { sass: {loader: 'sass-loader', options: {sourceMap: true}} } -baseWebpackConfig.devtool = 'eval-source-map' baseWebpackConfig.module.rules.push( { test: /\.css$/, @@ -37,16 +36,16 @@ baseWebpackConfig.module.rules.push( } ) +baseWebpackConfig.entry.client = [ + 'react-hot-loader/patch', + 'webpack-hot-middleware/client?reload=true', + baseWebpackConfig.entry.client +] + // add dev plugins baseWebpackConfig.plugins.push( - // add index.html - new HtmlWebpackPlugin({ - title: config.title, - template: path.resolve(config.rootPath, 'webpack_config', 'assets', 'index.ejs') - }), new webpack.HotModuleReplacementPlugin(), - new webpack.NoEmitOnErrorsPlugin(), - new FriendlyErrors() + new WriteFilePlugin() ) export default baseWebpackConfig