2019-05-05 13:34:21 +02:00
|
|
|
const path = require('path')
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
|
|
|
|
|
|
// Any directories you will be adding code/files into, need to be added to this array so webpack will pick them up
|
|
|
|
const defaultInclude = [path.resolve(__dirname, 'src')]
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: path.resolve(__dirname, 'src') + '/index.js',
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'dist'),
|
|
|
|
filename: 'bundle.js'
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
|
|
|
use: ['style-loader', 'css-loader'],
|
|
|
|
include: defaultInclude
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(js|jsx)?$/,
|
|
|
|
use: ['babel-loader'],
|
|
|
|
include: defaultInclude
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(jpe?g|png|gif)$/,
|
|
|
|
use: ['file-loader?name=img/[name]__[hash:base64:5].[ext]'],
|
|
|
|
include: defaultInclude
|
|
|
|
},
|
|
|
|
{
|
2019-05-09 00:58:05 +02:00
|
|
|
test: /\.svg$/,
|
|
|
|
use: ['@svgr/webpack'],
|
|
|
|
include: defaultInclude
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(eot|ttf|woff|woff2)$/,
|
2019-05-05 13:34:21 +02:00
|
|
|
use: ['file-loader?name=font/[name]__[hash:base64:5].[ext]'],
|
|
|
|
include: defaultInclude
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['*', '.js', '.jsx']
|
|
|
|
},
|
|
|
|
target: 'electron-renderer',
|
|
|
|
plugins: [new HtmlWebpackPlugin()]
|
|
|
|
}
|