Browse Source

Combine `npm watch` and `npm devserver`

Fix issue where `debugger` was stripped from the built dev bundle
JC Brand 1 month ago
parent
commit
329c77c19f
2 changed files with 5 additions and 2 deletions
  1. 1 1
      package.json
  2. 4 1
      rspack/rspack.serve.js

+ 1 - 1
package.json

@@ -61,7 +61,7 @@
     "serve": "http-server -c-1",
     "serve-tls": "http-server -S -C certs/chat.example.org.crt -K certs/chat.example.org.key",
     "devserver": "npx rspack serve --config rspack/rspack.serve.js",
-    "watch": "rspack build --watch --config rspack/rspack.build.js --mode=development",
+    "watch": "npm run devserver",
     "types": "tsc -p ./src/log/tsconfig.json && tsc -p ./src/headless/tsconfig.json && tsc",
     "check:types": "tsc --noEmit"
   },

+ 4 - 1
rspack/rspack.serve.js

@@ -8,11 +8,14 @@ module.exports = merge(common, {
         'converse': path.resolve(__dirname, '../src/entry.js'),
     },
     devtool: 'inline-source-map',
+    optimization: {
+        minimize: false,
+    },
     devServer: {
         static: {
             directory: path.resolve(__dirname, '../'),
         },
-        port: 3003,
+        port: 8008,
         allowedHosts: ['localhost'],
         devMiddleware: {
             publicPath: '/dist/',