Files
HangmanLab.Frontend/webpack.config.js
2024-12-04 14:06:30 +00:00

44 lines
1.1 KiB
JavaScript

//webpack.config.js
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack')
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'bundle.js',
clean: true,
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
}
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: "./public/index.html",
}),
new webpack.DefinePlugin({
FRONT_END_CLIENT_ID: process.env.FRONT_END_CLIENT_ID,
SERVER_HOST: process.env.SERVER_HOST,
}),
],
devServer: {
static: path.join(__dirname, 'public'),
port: 3000,
open: true,
hot: true,
historyApiFallback: true,
}
};