Merge remote-tracking branch 'upstream/main' into fully-qualified-sitemap-urls-7.5-next

This commit is contained in:
Art Lowel
2023-01-11 17:51:58 +01:00
408 changed files with 14589 additions and 14760 deletions

View File

@@ -13,14 +13,14 @@ module.exports = Object.assign({}, commonExports, {
new CompressionPlugin({
filename: '[path][base].gz',
algorithm: 'gzip',
test: /\.(js|css|html|svg|json5)$/,
test: /\.(js|css|html|svg|json)$/,
threshold: 10240,
minRatio: 0.8,
}),
new CompressionPlugin({
filename: '[path][base].br',
algorithm: 'brotliCompress',
test: /\.(js|css|html|svg|json5)$/,
test: /\.(js|css|html|svg|json)$/,
compressionOptions: {
params: {
[zlib.constants.BROTLI_PARAM_QUALITY]: 11,

View File

@@ -3,6 +3,7 @@ import { globalCSSImports, projectRoot } from './helpers';
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const sass = require('sass');
const JSON5 = require('json5');
export const copyWebpackOptions = {
patterns: [
@@ -11,6 +12,20 @@ export const copyWebpackOptions = {
to: path.join('assets', 'fonts'),
force: undefined
},
{
from: path.join(__dirname, '..', 'src', 'assets', '**', '*.json5').replace(/\\/g, '/'),
to({ absoluteFilename }) {
// use [\/|\\] to match both POSIX and Windows separators
const matches = absoluteFilename.match(/.*[\/|\\]assets[\/|\\](.+)\.json5$/);
if (matches) {
// matches[1] is the relative path from src/assets to the JSON5 file, without the extension
return path.join('assets', matches[1] + '.json');
}
},
transform(content) {
return JSON.stringify(JSON5.parse(content.toString()))
}
},
{
from: path.join(__dirname, '..', 'src', 'assets'),
to: 'assets',