mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 07:49:29 +00:00
Merge commit 'e9170e2de1d75e02f04ad39f2af131c70189fb50' into glitch-soc/merge-upstream
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import path from 'node:path';
|
||||
|
||||
import { optimizeLodashImports } from '@optimize-lodash/rollup-plugin';
|
||||
import legacy from '@vitejs/plugin-legacy';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { PluginOption } from 'vite';
|
||||
import svgr from 'vite-plugin-svgr';
|
||||
import { visualizer } from 'rollup-plugin-visualizer';
|
||||
import RailsPlugin from 'vite-plugin-rails';
|
||||
import { VitePWA } from 'vite-plugin-pwa';
|
||||
import RailsPlugin from 'vite-plugin-rails';
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
import svgr from 'vite-plugin-svgr';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
import legacy from '@vitejs/plugin-legacy';
|
||||
|
||||
import { defineConfig, UserConfigFnPromise, UserConfig } from 'vite';
|
||||
import postcssPresetEnv from 'postcss-preset-env';
|
||||
@@ -78,8 +79,11 @@ export const config: UserConfigFnPromise = async ({ mode, command }) => {
|
||||
},
|
||||
},
|
||||
},
|
||||
worker: {
|
||||
format: 'es',
|
||||
},
|
||||
plugins: [
|
||||
tsconfigPaths(),
|
||||
tsconfigPaths({ projects: [path.resolve(__dirname, 'tsconfig.json')] }),
|
||||
RailsPlugin({
|
||||
compress: mode === 'production' && command === 'build',
|
||||
sri: {
|
||||
@@ -92,6 +96,21 @@ export const config: UserConfigFnPromise = async ({ mode, command }) => {
|
||||
plugins: ['formatjs', 'transform-react-remove-prop-types'],
|
||||
},
|
||||
}),
|
||||
viteStaticCopy({
|
||||
targets: [
|
||||
{
|
||||
src: path.resolve(
|
||||
__dirname,
|
||||
'node_modules/emojibase-data/**/compact.json',
|
||||
),
|
||||
dest: 'emoji',
|
||||
rename(_name, ext, dir) {
|
||||
const locale = path.basename(path.dirname(dir));
|
||||
return `${locale}.${ext}`;
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
MastodonServiceWorkerLocales(),
|
||||
MastodonEmojiCompressed(),
|
||||
legacy({
|
||||
|
||||
Reference in New Issue
Block a user