|
@@ -10,10 +10,18 @@ const {
|
|
|
|
|
|
|
|
const PackageVersions = require('./app/src/infrastructure/PackageVersions.js')
|
|
const PackageVersions = require('./app/src/infrastructure/PackageVersions.js')
|
|
|
const invalidateBabelCacheIfNeeded = require('./frontend/macros/invalidate-babel-cache-if-needed')
|
|
const invalidateBabelCacheIfNeeded = require('./frontend/macros/invalidate-babel-cache-if-needed')
|
|
|
|
|
+const cypressCacheVariant = require('./frontend/macros/cypress-cache-variant')
|
|
|
|
|
|
|
|
// Make sure that babel-macros are re-evaluated after changing the modules config
|
|
// Make sure that babel-macros are re-evaluated after changing the modules config
|
|
|
invalidateBabelCacheIfNeeded()
|
|
invalidateBabelCacheIfNeeded()
|
|
|
|
|
|
|
|
|
|
+// Use a unique babel-loader cache directory per Cypress CT variant to avoid
|
|
|
|
|
+// parallel jobs corrupting the shared cache.
|
|
|
|
|
+const cypressVariant = cypressCacheVariant()
|
|
|
|
|
+const babelCacheDirectory = cypressVariant
|
|
|
|
|
+ ? path.join(__dirname, 'node_modules/.cache', cypressVariant, 'babel-loader')
|
|
|
|
|
+ : true
|
|
|
|
|
+
|
|
|
// Generate a hash of entry points, including modules
|
|
// Generate a hash of entry points, including modules
|
|
|
const entryPoints = {
|
|
const entryPoints = {
|
|
|
bootstrap: './frontend/js/bootstrap.ts',
|
|
bootstrap: './frontend/js/bootstrap.ts',
|
|
@@ -123,7 +131,7 @@ module.exports = {
|
|
|
{
|
|
{
|
|
|
loader: 'babel-loader',
|
|
loader: 'babel-loader',
|
|
|
options: {
|
|
options: {
|
|
|
- cacheDirectory: true,
|
|
|
|
|
|
|
+ cacheDirectory: babelCacheDirectory,
|
|
|
configFile: path.join(__dirname, './babel.config.json'),
|
|
configFile: path.join(__dirname, './babel.config.json'),
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -156,7 +164,7 @@ module.exports = {
|
|
|
options: {
|
|
options: {
|
|
|
// Configure babel-loader to cache compiled output so that
|
|
// Configure babel-loader to cache compiled output so that
|
|
|
// subsequent compile runs are much faster
|
|
// subsequent compile runs are much faster
|
|
|
- cacheDirectory: true,
|
|
|
|
|
|
|
+ cacheDirectory: babelCacheDirectory,
|
|
|
configFile: path.join(__dirname, './babel.config.json'),
|
|
configFile: path.join(__dirname, './babel.config.json'),
|
|
|
plugins: [
|
|
plugins: [
|
|
|
process.env.REACT_REFRESH_ENABLED === 'true' &&
|
|
process.env.REACT_REFRESH_ENABLED === 'true' &&
|