This repository has been archived on 2021-06-30. You can view files and clone it, but cannot push or open issues or pull requests.
melodii/webpack.config.js

45 lines
989 B
JavaScript
Raw Normal View History

2019-02-09 01:34:04 +00:00
require('dotenv').config();
const path = require('path');
const webpack = require('webpack');
module.exports = {
mode: process.env.NODE_ENV,
entry: ['@babel/polyfill', './src/renderer.js'],
output: {
path: path.resolve(__dirname, 'build'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
}
}, {
test: /\.s?css$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
{ loader: 'sass-loader' }
]
}, {
test: /\.(png|jpg|svg)$/,
use: [{ loader: 'file-loader' }]
}
]
},
devtool: 'inline-source-map',
target: 'electron-renderer',
devServer: {
contentBase: path.join(__dirname, 'build'),
compress: true,
port: process.env.PORT
}
};