Skip to content
Snippets Groups Projects
Commit a2d47f68 authored by dakkar's avatar dakkar
Browse files

replace icons in embeds

parent 7628fe9c
No related branches found
No related tags found
No related merge requests found
......@@ -630,9 +630,9 @@ seems to do a decent job)
* check the changes against our `develop` (`git diff develop`) and
against Misskey (`git diff misskey/develop`)
* re-generate `misskey-js` (`pnpm build-misskey-js-with-types`) and commit
* build the frontend: `rm -rf built/; NODE_ENV=development pnpm --filter=frontend
build` (the `development` tells it to keep some of the original
filenames in the built files)
* build the frontend: `rm -rf built/; NODE_ENV=development pnpm
--filter=frontend --filter=frontend-embed build` (the `development`
tells it to keep some of the original filenames in the built files)
* make sure there aren't any new `ti-*` classes (Tabler Icons), and
replace them with appropriate `ph-*` ones (Phosphor Icons):
`grep -rP '["'\'']ti[ -](?!fw)' -- built/` should show you what to change.
......
......@@ -6,6 +6,7 @@ import locales from '../../locales/index.js';
import meta from '../../package.json';
import packageInfo from './package.json' with { type: 'json' };
import pluginJson5 from './vite.json5.js';
import { pluginReplaceIcons } from '../frontend/vite.replaceIcons.ts';
const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.json', '.json5', '.svg', '.sass', '.scss', '.css', '.vue'];
......@@ -68,6 +69,7 @@ export function getConfig(): UserConfig {
plugins: [
pluginVue(),
pluginJson5(),
...pluginReplaceIcons(),
],
resolve: {
......@@ -84,11 +86,8 @@ export function getConfig(): UserConfig {
modules: {
generateScopedName(name, filename, _css): string {
const id = (path.relative(__dirname, filename.split('?')[0]) + '-' + name).replace(/[\\\/\.\?&=]/g, '-').replace(/(src-|vue-)/g, '');
if (process.env.NODE_ENV === 'production') {
return 'x' + toBase62(hash(id)).substring(0, 4);
} else {
return id;
}
const shortId = id.replace(/^(components(-global)?|widgets|ui(-_common_)?)-/, '');
return shortId + '-' + toBase62(hash(id)).substring(0, 4);
},
},
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment