Various build shenenigans (#5)
This PR extends the build pipeline of the www service to support locale-prefixed static builds (EN/RU) with build-time SSG output injection, while also refactoring UI typography to a tokenized Tailwind v4 @theme-driven approach. Changes: - Add build-time SSG plugin to @ermnvldmr/rsbuild-config and wire multi-locale builds (/en/, /ru/) into services/www. - Introduce new @ermnvldmr/i18n package (locale constants, path helpers, keysets, pluralization) and apply it to www navigation/text. - Refactor ui typography to a shared getTypographyClassNames utility + Tailwind token definitions, with stl/cn updated for correct Tailwind-merge behavior.
This commit is contained in:
1 parent
ac9c455e5a
commit
b84ef775b8
68 files changed
+2991
-397
No files matched your search
@@ -1,32 +1,71 @@
|
||||
import { defineServiceConfig, discoverEntries } from '@ermnvldmr/rsbuild-config/dev';
|
||||
import { defineServiceConfig, discoverEntries, mergeConfig } from '@ermnvldmr/rsbuild-config/dev';
|
||||
import { THEME_INIT_SCRIPT, THEME_INIT_STYLES } from '@ermnvldmr/ui/dev';
|
||||
import { localeRsbuildConfig } from '@ermnvldmr/i18n/dev';
|
||||
import { RsdoctorRspackPlugin } from '@rsdoctor/rspack-plugin';
|
||||
import { pluginMdx } from '@rsbuild/plugin-mdx';
|
||||
import remarkFrontmatter from 'remark-frontmatter';
|
||||
import remarkMdxFrontmatter from 'remark-mdx-frontmatter';
|
||||
|
||||
export default defineServiceConfig({
|
||||
plugins: [
|
||||
pluginMdx({
|
||||
mdxLoaderOptions: {
|
||||
remarkPlugins: [remarkFrontmatter, [remarkMdxFrontmatter, { name: 'frontmatter' }]],
|
||||
},
|
||||
}),
|
||||
],
|
||||
source: {
|
||||
entry: discoverEntries(import.meta.dirname, './src/app/**/*.tsx'),
|
||||
},
|
||||
html: {
|
||||
tags: [
|
||||
{
|
||||
tag: 'script',
|
||||
children: THEME_INIT_SCRIPT,
|
||||
head: true,
|
||||
},
|
||||
{
|
||||
tag: 'style',
|
||||
children: THEME_INIT_STYLES,
|
||||
head: true,
|
||||
const fontBase = 'static/font';
|
||||
|
||||
export default defineServiceConfig(
|
||||
mergeConfig(localeRsbuildConfig(), {
|
||||
tools: {
|
||||
rspack: {
|
||||
plugins: [
|
||||
process.env.RSDOCTOR === 'true' &&
|
||||
new RsdoctorRspackPlugin({
|
||||
disableClientServer: true,
|
||||
output: { reportDir: './rsdoctor', mode: 'brief' },
|
||||
}),
|
||||
].filter(Boolean),
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
pluginMdx({
|
||||
mdxLoaderOptions: {
|
||||
remarkPlugins: [remarkFrontmatter, [remarkMdxFrontmatter, { name: 'frontmatter' }]],
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
});
|
||||
source: {
|
||||
entry: discoverEntries(import.meta.dirname, './src/app/**/*.tsx'),
|
||||
},
|
||||
html: {
|
||||
tags: [
|
||||
{ tag: 'script', children: THEME_INIT_SCRIPT, head: true },
|
||||
{ tag: 'style', children: THEME_INIT_STYLES, head: true },
|
||||
{
|
||||
tag: 'link',
|
||||
attrs: {
|
||||
rel: 'preload',
|
||||
as: 'font',
|
||||
type: 'font/woff2',
|
||||
href: `${fontBase}/lato-400.woff2`,
|
||||
crossorigin: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
tag: 'link',
|
||||
attrs: {
|
||||
rel: 'preload',
|
||||
as: 'font',
|
||||
type: 'font/woff2',
|
||||
href: `${fontBase}/lato-700.woff2`,
|
||||
crossorigin: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
tag: 'link',
|
||||
attrs: {
|
||||
rel: 'preload',
|
||||
as: 'font',
|
||||
type: 'font/woff2',
|
||||
href: `${fontBase}/eb-garamond-var.woff2`,
|
||||
crossorigin: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
);
|
||||
Reference in new issue
Block a user