Files
deployment-portal-fe/webpack.config.js

85 lines
2.0 KiB
JavaScript
Raw Normal View History

const path = require('path');
const HtmlPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
2024-02-15 16:46:56 +05:30
target: 'web',
2024-02-14 15:48:15 +05:30
entry: {
2024-02-15 16:46:56 +05:30
entry: ['./src/index.tsx', 'whatwg-fetch', 'core-js/features/promise'],
2024-02-14 15:48:15 +05:30
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.css', '.scss'],
2024-04-22 16:52:04 +05:30
alias: {
'@src': path.resolve(__dirname, 'src'),
'@components': path.resolve(__dirname, 'src/components/'),
'@action': path.resolve(__dirname, 'src/action/'),
'@constants': path.resolve(__dirname, 'src/constants/'),
'@store': path.resolve(__dirname, 'src/store/'),
'@slices': path.resolve(__dirname, 'src/slices/'),
},
fallback: {
buffer: require.resolve('buffer/'),
},
2024-02-14 15:48:15 +05:30
},
devServer: {
historyApiFallback: true,
host: '0.0.0.0',
hot: true,
port: 3000,
proxy: [
{
context: ['/api', '/oauth2', '/login'],
target: 'http://localhost:8080',
},
],
2024-02-14 15:48:15 +05:30
},
output: {
path: path.join(__dirname, '/dist'),
filename: `bundle.js?t=${new Date().getTime()}`,
publicPath: '/',
},
module: {
rules: [
{
test: /\.(ts|js)x?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'],
},
},
},
2024-03-28 14:22:01 +05:30
{
test: /\.svg$/,
use: ['@svgr/webpack'],
},
2024-02-14 15:48:15 +05:30
{
2024-02-15 16:46:56 +05:30
test: /\.css$/,
2024-02-14 15:48:15 +05:30
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
{
2024-02-15 16:46:56 +05:30
test: /\.scss$/,
use: [MiniCssExtractPlugin.loader, 'sass-loader'],
2024-02-14 15:48:15 +05:30
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: `bundle.css?t=${new Date().getTime()}`,
}),
new HtmlPlugin({
template: './index.html',
}),
new CopyPlugin([
{
from: 'config.js',
},
]),
],
watchOptions: {
ignored: /node_modules/,
},
};