mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
32 lines
654 B
JavaScript
32 lines
654 B
JavaScript
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
import path from 'node:path';
|
|
import {fileURLToPath} from 'node:url';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
export function getLinguiSwcPluginConfig() {
|
|
return [
|
|
'@lingui/swc-plugin',
|
|
{
|
|
localeDir: 'src/locales/{locale}/messages',
|
|
runtimeModules: {
|
|
i18n: ['@lingui/core', 'i18n'],
|
|
trans: ['@lingui/react', 'Trans'],
|
|
},
|
|
stripNonEssentialFields: false,
|
|
},
|
|
];
|
|
}
|
|
|
|
export function createPoFileRule() {
|
|
return {
|
|
test: /\.po$/,
|
|
type: 'javascript/auto',
|
|
use: {
|
|
loader: path.join(__dirname, 'po-loader.mjs'),
|
|
},
|
|
};
|
|
}
|