const webpack = require('webpack'); const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const { config } = require('dotenv'); config({path: '../.env'}); module.exports = { entry: './src/index.tsx', mode: 'production', module: { rules: [ { test: /\.tsx?$/, use: 'ts-loader', exclude: /node_modules/, }, ], }, resolve: { extensions: ['.tsx', '.ts', '.js'], }, output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist'), }, plugins: [ new HtmlWebpackPlugin({ template: './src/index.html', }), new HtmlWebpackPlugin({ filename: 'silent-check-sso.html', template: './silent-check-sso.html', }), new webpack.DefinePlugin({ 'process.env': { KEYCLOAK_URL: JSON.stringify(process.env.KEYCLOAK_FRONTEND_URL), KEYCLOAK_REALM: JSON.stringify(process.env.KEYCLOAK_REALM), KEYCLOAK_CLIENT: JSON.stringify(process.env.KEYCLOAK_FRONTEND_CLIENT), } }) ], };