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

Watching all these directories can cause systems to exceed maximum watched files / inotify limits, especially in dev mode with IDEs etc also watching files.
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
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;
|
|
}
|
|
},
|
|
watchOptions: {
|
|
// Ignore directories that should not be watched for recompiling angular
|
|
ignored: [
|
|
'**/node_modules', '**/_build', '**/.git', '**/docker',
|
|
'**/.angular', '**/.idea', '**/.vscode', '**/.history', '**/.vsix'
|
|
]
|
|
},
|
|
});
|