2022-04-13 10:48:10 -06:00
|
|
|
const path = require('path');
|
2022-04-15 09:28:11 -06:00
|
|
|
const webpack = require('webpack');
|
2022-04-13 10:48:10 -06:00
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
2022-04-15 23:51:26 -06:00
|
|
|
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
|
2022-04-15 09:28:11 -06:00
|
|
|
// const { config: { portDev, portReloadDev } } = require('./config');
|
2022-04-13 10:48:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
2022-04-15 09:28:11 -06:00
|
|
|
entry: ['webpack-hot-middleware/client?path=/reload_wss&timeout=2000&overlay=false&reload=true', './frontend/index.js'],
|
2022-04-13 10:48:10 -06:00
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'build'),
|
2022-04-17 16:54:45 -06:00
|
|
|
filename: 'assets/app.js',
|
2022-04-13 10:48:10 -06:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.js', '.jsx'],
|
|
|
|
},
|
|
|
|
mode: 'development',
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
2022-04-17 16:54:45 -06:00
|
|
|
test: /\.(js|jsx|tsx)$/,
|
2022-04-13 10:48:10 -06:00
|
|
|
exclude: /node_modules/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
2022-04-17 16:54:45 -06:00
|
|
|
options: { plugins: ['react-refresh/babel'] }
|
2022-04-13 10:48:10 -06:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2022-04-17 16:54:45 -06:00
|
|
|
test: /\.(css|sass|scss)$/,
|
2022-04-13 10:48:10 -06:00
|
|
|
use: [
|
2022-04-17 16:54:45 -06:00
|
|
|
MiniCssExtractPlugin.loader,
|
2022-04-13 10:48:10 -06:00
|
|
|
'css-loader',
|
|
|
|
'sass-loader',
|
2022-04-17 16:54:45 -06:00
|
|
|
],
|
2022-04-13 10:48:10 -06:00
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
|
|
|
plugins: [
|
2022-04-15 09:28:11 -06:00
|
|
|
new webpack.HotModuleReplacementPlugin(),
|
2022-04-15 23:51:26 -06:00
|
|
|
new ReactRefreshWebpackPlugin(),
|
2022-04-13 10:48:10 -06:00
|
|
|
new MiniCssExtractPlugin({
|
2022-04-17 16:54:45 -06:00
|
|
|
filename: 'assets/app.css',
|
2022-04-13 10:48:10 -06:00
|
|
|
}),
|
|
|
|
],
|
2022-04-15 09:28:11 -06:00
|
|
|
/* devServer: {
|
2022-04-13 10:48:10 -06:00
|
|
|
static: {
|
2022-04-13 14:12:15 -06:00
|
|
|
directory: path.join(__dirname, 'build')
|
2022-04-13 10:48:10 -06:00
|
|
|
},
|
|
|
|
allowedHosts: "all",
|
|
|
|
compress: true,
|
|
|
|
port: portDev,
|
|
|
|
hot: true,
|
|
|
|
client: {
|
|
|
|
reconnect: true,
|
|
|
|
webSocketURL: {
|
|
|
|
port: portReloadDev ? portReloadDev : portDev,
|
|
|
|
}
|
|
|
|
},
|
2022-04-15 09:28:11 -06:00
|
|
|
}, */
|
2022-04-13 10:48:10 -06:00
|
|
|
}
|