1
0
mirror of https://github.com/kremalicious/blowfish.git synced 2024-12-29 16:17:52 +01:00
blowfish/webpack.common.config.js

49 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-05-05 13:34:21 +02:00
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
2019-05-17 00:19:00 +02:00
const CopyPlugin = require('copy-webpack-plugin')
2019-05-05 13:34:21 +02:00
2019-05-25 03:16:53 +02:00
const defaultInclude = [path.resolve(__dirname, 'src', 'renderer')]
2019-05-05 13:34:21 +02:00
module.exports = {
2019-05-25 03:16:53 +02:00
entry: path.resolve(__dirname, 'src', 'renderer', 'index.js'),
2019-05-05 13:34:21 +02:00
output: {
2019-05-11 22:55:51 +02:00
path: path.resolve(__dirname, 'build'),
filename: 'bundle.js',
publicPath: './'
2019-05-05 13:34:21 +02:00
},
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
2019-05-05 13:34:21 +02:00
}
]
},
resolve: {
extensions: ['*', '.js', '.jsx']
},
target: 'electron-renderer',
2019-05-17 00:19:00 +02:00
plugins: [
new HtmlWebpackPlugin(),
new CopyPlugin([
2019-05-25 03:16:53 +02:00
{ from: './src/renderer/images/icon.*', to: './', flatten: true }
2019-05-17 00:19:00 +02:00
])
]
2019-05-05 13:34:21 +02:00
}