chore(tools): disable hmr by default (#9286)

This commit is contained in:
doodlewind
2024-12-24 10:32:01 +00:00
parent cd830d6f81
commit 20aca4d051
3 changed files with 4 additions and 76 deletions

View File

@@ -19,7 +19,6 @@
"@clack/prompts": "^0.9.0",
"@napi-rs/simple-git": "^0.1.19",
"@perfsee/webpack": "^1.13.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
"@sentry/webpack-plugin": "^2.22.7",
"@vanilla-extract/webpack-plugin": "^2.3.15",
"autoprefixer": "^10.4.20",

View File

@@ -4,7 +4,6 @@ import { getBuildConfig } from '@affine-tools/utils/build-config';
import { ProjectRoot } from '@affine-tools/utils/path';
import type { Package } from '@affine-tools/utils/workspace';
import { PerfseePlugin } from '@perfsee/webpack';
import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
import { sentryWebpackPlugin } from '@sentry/webpack-plugin';
import { VanillaExtractPlugin } from '@vanilla-extract/webpack-plugin';
import CopyPlugin from 'copy-webpack-plugin';
@@ -207,11 +206,6 @@ export function createWebpackConfig(
transform: {
react: {
runtime: 'automatic',
refresh: flags.mode === 'development' && {
refreshReg: '$RefreshReg$',
refreshSig: '$RefreshSig$',
emitFullSignatures: true,
},
},
useDefineForClassFields: false,
decoratorVersion: '2022-03',
@@ -288,11 +282,7 @@ export function createWebpackConfig(
plugins: compact([
IN_CI ? null : new webpack.ProgressPlugin({ percentBy: 'entries' }),
flags.mode === 'development'
? new ReactRefreshWebpackPlugin({
overlay: false,
esModule: true,
include: /\.tsx$/,
})
? null
: // todo: support multiple entry points
new MiniCssExtractPlugin({
filename: `[name].[contenthash:8].css`,
@@ -343,7 +333,7 @@ export function createWebpackConfig(
devServer: {
host: '0.0.0.0',
allowedHosts: 'all',
hot: true,
hot: false,
liveReload: true,
client: {
overlay: process.env.DISABLE_DEV_OVERLAY === 'true' ? false : undefined,