replace icons in embeds
This commit is contained in:
parent
7628fe9c46
commit
a2d47f686f
|
@ -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);
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue