Skip to content

Instantly share code, notes, and snippets.

@liondancer
Created August 13, 2017 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liondancer/2025cc37ee0e0b0b1c9135ca944242c1 to your computer and use it in GitHub Desktop.
Save liondancer/2025cc37ee0e0b0b1c9135ca944242c1 to your computer and use it in GitHub Desktop.
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import CleanWebpackPlugin from 'clean-webpack-plugin';
export default {
entry: [
'./app/index'
],
devtool: 'inline-source-map',
target: 'web',
output: {
path: __dirname + '/app/dist/', // Note: Physical files are only output by the production build task `npm run build`.
publicPath: '/',
filename: 'bundle.js'
},
devServer: {
contentBase: './app',
historyApiFallback: {
index: './app/index.html'
}
},
plugins: [
new CleanWebpackPlugin(['dist']),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin()
],
module: {
rules: [
{test: /\.js$/, use: {loader: 'babel-loader'}},
{test: /(\.css)$/, use: ['style-loader', 'css-loader']},
{test: /\.(png|svg|jpg|gif)$/, use: ['file-loader']},
// for fonts
{test: /\.(woff|woff2|eot|ttf|otf)$/, use: ['file-loader']}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment