Skip to content

Commit d522e89

Browse files
authored
feat: allow setting devtool=false (#69)
1 parent c4de26f commit d522e89

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

config/rspack.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module.exports = (webpackEnv, argv) => {
3131
}
3232

3333
const isDevServerOnly = env.dev_server_only?.toLowerCase() === 'true';
34+
const devtool = (env.devtool?.toLowerCase() === 'false' ? false : env.devtool) || (isEnvDevelopment ? 'eval-cheap-module-source-map' : 'source-map');
3435
const isReactRefresh = isDevServer && isEnvDevelopment;
3536

3637
const now = new Date();
@@ -92,7 +93,7 @@ module.exports = (webpackEnv, argv) => {
9293
mode,
9394
// Logging noise constrained to errors and warnings
9495
stats: 'errors-warnings', // { logging: 'verbose', timings: true, assets: true },
95-
devtool: isEnvDevelopment ? 'cheap-module-source-map' : 'source-map',
96+
devtool,
9697
// These are the "entry points" to our application.
9798
// This means they will be the "root" imports that are included in JS bundle.
9899
entry: Object.fromEntries(
@@ -105,6 +106,9 @@ module.exports = (webpackEnv, argv) => {
105106
? {
106107
static: path.resolve(workspacePath, 'bundles'),
107108
compress: true,
109+
// Explicitly set hot to true and liveReload to false to ensure that hot is preferred over liveReload
110+
hot: true,
111+
liveReload: false,
108112
// Explicitly set the host to ipv4 local address to ensure that the dev server is reachable from the host machine: https://github.com/cypress-io/cypress/issues/25397
109113
host: '127.0.0.1',
110114
open: true,

0 commit comments

Comments
 (0)