mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00

This allows us to get rid of the json5 dependency in the main bundle and reduces the size of the i18n files we serve a bit
40 lines
1017 B
TypeScript
40 lines
1017 B
TypeScript
import { join } from 'path';
|
|
|
|
import { buildAppConfig } from '../src/config/config.server';
|
|
import { commonExports } from './webpack.common';
|
|
|
|
const CompressionPlugin = require('compression-webpack-plugin');
|
|
const zlib = require('zlib');
|
|
|
|
module.exports = Object.assign({}, commonExports, {
|
|
target: 'web',
|
|
plugins: [
|
|
...commonExports.plugins,
|
|
new CompressionPlugin({
|
|
filename: '[path][base].gz',
|
|
algorithm: 'gzip',
|
|
test: /\.(js|css|html|svg|json)$/,
|
|
threshold: 10240,
|
|
minRatio: 0.8,
|
|
}),
|
|
new CompressionPlugin({
|
|
filename: '[path][base].br',
|
|
algorithm: 'brotliCompress',
|
|
test: /\.(js|css|html|svg|json)$/,
|
|
compressionOptions: {
|
|
params: {
|
|
[zlib.constants.BROTLI_PARAM_QUALITY]: 11,
|
|
},
|
|
},
|
|
threshold: 10240,
|
|
minRatio: 0.8,
|
|
}),
|
|
],
|
|
devServer: {
|
|
setupMiddlewares(middlewares, server) {
|
|
buildAppConfig(join(process.cwd(), 'src/assets/config.json'));
|
|
return middlewares;
|
|
}
|
|
}
|
|
});
|