mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Only do asset compression im production mode.
This improves speed in watch mode.
This commit is contained in:
parent
47702d6131
commit
059bb99f87
1 changed files with 14 additions and 12 deletions
|
@ -108,7 +108,13 @@ Encore
|
||||||
}
|
}
|
||||||
]))
|
]))
|
||||||
|
|
||||||
.addPlugin(new CompressionPlugin({
|
// uncomment if you use API Platform Admin (composer req api-admin)
|
||||||
|
//.enableReactPreset()
|
||||||
|
//.addEntry('admin', './assets/js/admin.js')
|
||||||
|
;
|
||||||
|
|
||||||
|
if (Encore.isProduction()) {
|
||||||
|
Encore.addPlugin(new CompressionPlugin({
|
||||||
filename: '[path].br[query]',
|
filename: '[path].br[query]',
|
||||||
algorithm: 'brotliCompress',
|
algorithm: 'brotliCompress',
|
||||||
test: /\.(js|css|html|svg)$/,
|
test: /\.(js|css|html|svg)$/,
|
||||||
|
@ -121,16 +127,12 @@ Encore
|
||||||
deleteOriginalAssets: false,
|
deleteOriginalAssets: false,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
.addPlugin(new CompressionPlugin({
|
.addPlugin(new CompressionPlugin({
|
||||||
filename: '[path].gz[query]',
|
filename: '[path].gz[query]',
|
||||||
algorithm: 'gzip',
|
algorithm: 'gzip',
|
||||||
test: /\.(js|css|html|svg)$/,
|
test: /\.(js|css|html|svg)$/,
|
||||||
deleteOriginalAssets: false,
|
deleteOriginalAssets: false,
|
||||||
}))
|
}))
|
||||||
|
}
|
||||||
// uncomment if you use API Platform Admin (composer req api-admin)
|
|
||||||
//.enableReactPreset()
|
|
||||||
//.addEntry('admin', './assets/js/admin.js')
|
|
||||||
;
|
|
||||||
|
|
||||||
module.exports = Encore.getWebpackConfig();
|
module.exports = Encore.getWebpackConfig();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue