[build] upgrade eslint to 9.37.0 (#88)
Co-authored-by: tobi <tobi.smethurst@protonmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/88 Co-authored-by: Zoë Bijl <moiety@noreply.codeberg.org> Co-committed-by: Zoë Bijl <moiety@noreply.codeberg.org>
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
// Note: You must restart bin/webpack-dev-server for changes to take effect
|
||||
|
||||
const { createHash } = require('crypto');
|
||||
const { readFileSync } = require('fs');
|
||||
const { resolve } = require('path');
|
||||
const { createHash } = require("crypto");
|
||||
const { readFileSync } = require("fs");
|
||||
const { resolve } = require("path");
|
||||
|
||||
const CompressionPlugin = require('@renchap/compression-webpack-plugin');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||
const { merge } = require('webpack-merge');
|
||||
const { InjectManifest } = require('workbox-webpack-plugin');
|
||||
const CompressionPlugin = require("@renchap/compression-webpack-plugin");
|
||||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
|
||||
const { merge } = require("webpack-merge");
|
||||
const { InjectManifest } = require("workbox-webpack-plugin");
|
||||
|
||||
const sharedConfig = require('./shared');
|
||||
const sharedConfig = require("./shared");
|
||||
|
||||
const root = resolve(__dirname, '..', '..');
|
||||
const root = resolve(__dirname, "..", "..");
|
||||
|
||||
module.exports = merge(sharedConfig, {
|
||||
mode: 'production',
|
||||
devtool: 'source-map',
|
||||
stats: 'normal',
|
||||
mode: "production",
|
||||
devtool: "source-map",
|
||||
stats: "normal",
|
||||
bail: true,
|
||||
optimization: {
|
||||
minimize: true,
|
||||
@@ -30,31 +30,31 @@ module.exports = merge(sharedConfig, {
|
||||
|
||||
plugins: [
|
||||
new CompressionPlugin({
|
||||
filename: '[path][base].gz[query]',
|
||||
filename: "[path][base].gz[query]",
|
||||
cache: true,
|
||||
test: /\.(js|css|html|json|ico|svg|eot|otf|ttf|map)$/,
|
||||
}),
|
||||
new CompressionPlugin({
|
||||
filename: '[path][base].br[query]',
|
||||
algorithm: 'brotliCompress',
|
||||
filename: "[path][base].br[query]",
|
||||
algorithm: "brotliCompress",
|
||||
cache: true,
|
||||
test: /\.(js|css|html|json|ico|svg|eot|otf|ttf|map)$/,
|
||||
}),
|
||||
new BundleAnalyzerPlugin({ // generates report.html
|
||||
analyzerMode: 'static',
|
||||
analyzerMode: "static",
|
||||
openAnalyzer: false,
|
||||
logLevel: 'silent', // do not bother Webpacker, who runs with --json and parses stdout
|
||||
logLevel: "silent", // do not bother Webpacker, who runs with --json and parses stdout
|
||||
}),
|
||||
new InjectManifest({
|
||||
additionalManifestEntries: ['1f602.svg', 'sheet_13.png'].map((filename) => {
|
||||
const path = resolve(root, 'public', 'emoji', filename);
|
||||
additionalManifestEntries: ["1f602.svg", "sheet_13.png"].map((filename) => {
|
||||
const path = resolve(root, "public", "emoji", filename);
|
||||
const body = readFileSync(path);
|
||||
const md5 = createHash('md5');
|
||||
const md5 = createHash("md5");
|
||||
|
||||
md5.update(body);
|
||||
|
||||
return {
|
||||
revision: md5.digest('hex'),
|
||||
revision: md5.digest("hex"),
|
||||
url: `/emoji/${filename}`,
|
||||
};
|
||||
}),
|
||||
@@ -65,8 +65,8 @@ module.exports = merge(sharedConfig, {
|
||||
],
|
||||
include: [/\.js$/, /\.css$/],
|
||||
maximumFileSizeToCacheInBytes: 2 * 1_024 * 1_024, // 2 MiB
|
||||
swDest: resolve(root, 'public', 'packs', 'sw.js'),
|
||||
swSrc: resolve(root, 'app', 'javascript', 'mastodon', 'service_worker', 'entry.js'),
|
||||
swDest: resolve(root, "public", "packs", "sw.js"),
|
||||
swSrc: resolve(root, "app", "javascript", "mastodon", "service_worker", "entry.js"),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user