From b7c3aad29f7149276731f6c68458daa9e755b987 Mon Sep 17 00:00:00 2001 From: Denys Bohdan Date: Wed, 7 Feb 2024 13:38:21 +0100 Subject: [PATCH] for serve command, write build to disk and rewrite sourcemaps so vscode can load the files for debugging --- webpack.config.cli.js | 3 ++- webpack/serve.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/webpack.config.cli.js b/webpack.config.cli.js index b2f6f2e..62b255c 100644 --- a/webpack.config.cli.js +++ b/webpack.config.cli.js @@ -9,6 +9,7 @@ module.exports = { filename: 'bundle.[name][contenthash].js', chunkFilename: 'chunk.[name][chunkhash].js', publicPath: '/', - clean: true + clean: true, + devtoolModuleFilenameTemplate: 'file:///[absolute-resource-path]' // map to source with absolute file path not webpack:// protocol }, }; diff --git a/webpack/serve.js b/webpack/serve.js index f3d60d6..f8a6edb 100644 --- a/webpack/serve.js +++ b/webpack/serve.js @@ -63,6 +63,7 @@ module.exports = function serve(stripesConfig, options) { app.use(webpackDevMiddleware(compiler, { stats: 'errors-only', publicPath: config.output.publicPath, + writeToDisk: true, })); app.use(webpackHotMiddleware(compiler));