concord-client/webpack.config.js

59 lines
1.6 KiB
JavaScript

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
module.exports = {
target: 'electron-renderer',
entry: './src/renderer/index.tsx',
output: {
path: path.resolve(__dirname, 'dist/renderer'),
filename: 'bundle.js',
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
alias: {
'@': path.resolve(__dirname, 'src/renderer'),
},
fallback: {
"path": false,
"fs": false,
"crypto": false,
}
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
],
},
},
},
],
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: './public/index.html',
}),
new webpack.DefinePlugin({
'process.env.CONCORD_SERVER': JSON.stringify(process.env.CONCORD_SERVER || 'localhost:9090'),
}),
],
devtool: 'source-map',
};