Bug 41587: (follow-up) Clean Cypress plugin dist on rebuild to prevent stale sourcemaps
Add output.clean: true to the Cypress plugin rspack build config. Before Bug 36674 (Nov 2025), this build emitted .map files into t/cypress/plugins/dist/. After devtool: false was added, the map files were no longer generated but stale ones persisted on developer machines (dist/ is gitignored). When the rspack update in Bug 41587 rebuilt api-client.cjs.js with dynamic chunk loading, Cypress's webpack created a context module for the require() expression and matched the stale .map files (webpack's context regex matches substrings, so *.js.map matches *.js). Webpack then failed trying to parse JSON sourcemaps as JavaScript. output.clean: true ensures the dist directory is wiped on every build, so stale files from previous configurations can never accumulate. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This commit is contained in:
parent
1623f6898f
commit
bb4407a0ff
|
|
@ -196,6 +196,7 @@ module.exports = [
|
|||
output: {
|
||||
filename: "[name].js",
|
||||
path: path.resolve(__dirname, "t/cypress/plugins/dist/"),
|
||||
clean: true,
|
||||
library: {
|
||||
type: "commonjs",
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue