Skip to content

Commit

Permalink
Cache only in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineAugusti committed Dec 12, 2024
1 parent 3ddf213 commit bf7a254
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions apps/transport/client/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')

console.log('webpack production configuration is used 🚀')

module.exports = merge(common, {
const config = {
mode: 'production',
cache: {
type: 'filesystem',
compression: 'gzip'
},
optimization: {
minimizer: [
// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
'...',
new CssMinimizerPlugin()
]
}
})
}

// Enable caching only in the continuous integration env to speed-up builds
if (process.env.CI === 'true') {
config.cache = {
type: 'filesystem',
compression: 'gzip'
}
}

module.exports = merge(common, config)

0 comments on commit bf7a254

Please sign in to comment.