2020-02-04 17:20:39 +01:00
|
|
|
const webpack = require('webpack')
|
2020-03-09 16:40:54 +01:00
|
|
|
const HTMLPlugin = require('html-webpack-plugin');
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
2020-02-04 17:20:39 +01:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
|
|
|
main: ['babel-polyfill', './src/index.js']
|
|
|
|
},
|
|
|
|
node: {
|
|
|
|
fs: 'empty'
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{ test: /\.(js|jsx)$/, exclude: /node_modules/, use: ['babel-loader'] },
|
2020-03-09 16:40:54 +01:00
|
|
|
{ test: /\.(css)$/, use: ['style-loader', { loader: MiniCssExtractPlugin.loader }, 'css-loader'] },
|
2020-02-04 17:20:39 +01:00
|
|
|
{ test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)(\?.*$|$)/, use: ['file-loader'] }
|
|
|
|
]
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['*', '.js', '.jsx']
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
'React': 'react'
|
|
|
|
}),
|
|
|
|
new HTMLPlugin({
|
|
|
|
title: 'MyApp',
|
|
|
|
hash: true,
|
|
|
|
template: 'src/index.html'
|
2020-03-09 16:40:54 +01:00
|
|
|
}),
|
|
|
|
new MiniCssExtractPlugin(),
|
2020-02-04 17:20:39 +01:00
|
|
|
]
|
|
|
|
}
|