Merge remote-tracking branch 'soapbox/develop' into cleanup

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2023-01-03 21:09:43 +01:00
12 changed files with 644 additions and 537 deletions

View File

@ -3,6 +3,7 @@ console.log('Running in development mode'); // eslint-disable-line no-console
import { join } from 'path';
import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
import { merge } from 'webpack-merge';
import sharedConfig from './shared';
@ -78,7 +79,7 @@ const devServer: DevServerConfiguration = {
host: devServerUrl.hostname,
port: devServerUrl.port,
https: devServerUrl.protocol === 'https:',
hot: false,
hot: true,
allowedHosts: 'all',
historyApiFallback: {
disableDotRule: true,
@ -116,6 +117,10 @@ const configuration: Configuration = {
watchOptions,
),
plugins: [
new ReactRefreshWebpackPlugin(),
],
devServer,
};

View File

@ -4,6 +4,8 @@ import { env, settings } from '../configuration';
import type { RuleSetRule } from 'webpack';
const isDevelopment = process.env.NODE_ENV === 'development';
const rule: RuleSetRule = {
test: /\.(js|jsx|mjs|ts|tsx)$/,
include: [
@ -25,6 +27,7 @@ const rule: RuleSetRule = {
cacheDirectory: join(settings.cache_path, 'babel-loader'),
cacheCompression: env.NODE_ENV === 'production',
compact: env.NODE_ENV === 'production',
plugins: isDevelopment ? ['react-refresh/babel'] : [],
},
},
],