pages loading twice poc

Cherry-picked from original branch started from Angular 13 PR
This commit is contained in:
Art Lowel
2022-04-26 11:15:42 +02:00
committed by Yura Bondarenko
parent e4f483c308
commit 3bc5ee0253
31 changed files with 15697 additions and 15452 deletions

View File

@@ -3,14 +3,39 @@ 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',
node: {
module: 'empty'
},
plugins: [
...commonExports.plugins,
new CompressionPlugin({
filename: '[path][base].gz',
algorithm: 'gzip',
test: /\.(js|css|html|svg)$/,
threshold: 10240,
minRatio: 0.8,
}),
new CompressionPlugin({
filename: '[path][base].br',
algorithm: 'brotliCompress',
test: /\.(js|css|html|svg)$/,
compressionOptions: {
params: {
[zlib.constants.BROTLI_PARAM_QUALITY]: 11,
},
},
threshold: 10240,
minRatio: 0.8,
}),
],
devServer: {
before(app, server) {
buildAppConfig(join(process.cwd(), 'src/assets/config.json'));
}
}
}
});