Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
feat(webpack_config/client): remove unused plugins, add WriteFilePlugin
Browse files Browse the repository at this point in the history
feat(webpack_config/client): remove unused plugins, add
WriteFilePlugin, remove devtool re-assignment
Removed plugins:
- HtmlWebpackPlugin
- webpack.NoEmitOnErrorsPlugin
- FriendlyErrors
  • Loading branch information
Metnew committed Aug 14, 2017
1 parent 2185e6e commit 6832969
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions webpack_config/client/webpack.dev.babel.js
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -19,7 +19,6 @@ const loaders = {
sass: {loader: 'sass-loader', options: {sourceMap: true}}
}

baseWebpackConfig.devtool = 'eval-source-map'
baseWebpackConfig.module.rules.push(
{
test: /\.css$/,
Expand All @@ -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

0 comments on commit 6832969

Please sign in to comment.