mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-09 19:33:10 +02:00
(refactor) do generateDTS in build-assets (#11812)
This commit is contained in:
parent
c0838c473f
commit
7bd0a5b7cb
3 changed files with 9 additions and 6 deletions
|
@ -1,6 +1,11 @@
|
||||||
import * as fs from 'node:fs';
|
import * as fs from 'node:fs';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import { dirname } from 'node:path';
|
||||||
import * as yaml from 'js-yaml';
|
import * as yaml from 'js-yaml';
|
||||||
import * as ts from 'typescript';
|
import ts from 'typescript';
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = dirname(__filename);
|
||||||
|
|
||||||
function createMembers(record) {
|
function createMembers(record) {
|
||||||
return Object.entries(record)
|
return Object.entries(record)
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { type UserConfig, defineConfig } from 'vite';
|
||||||
import ReactivityTransform from '@vue-macros/reactivity-transform/vite';
|
import ReactivityTransform from '@vue-macros/reactivity-transform/vite';
|
||||||
|
|
||||||
import locales from '../../locales';
|
import locales from '../../locales';
|
||||||
import generateDTS from '../../locales/generateDTS';
|
|
||||||
import meta from '../../package.json';
|
import meta from '../../package.json';
|
||||||
import pluginUnwindCssModuleClassName from './lib/rollup-plugin-unwind-css-module-class-name';
|
import pluginUnwindCssModuleClassName from './lib/rollup-plugin-unwind-css-module-class-name';
|
||||||
import pluginJson5 from './vite.json5';
|
import pluginJson5 from './vite.json5';
|
||||||
|
@ -67,10 +66,6 @@ export function getConfig(): UserConfig {
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
: [],
|
: [],
|
||||||
{
|
|
||||||
name: 'locale:generateDTS',
|
|
||||||
buildStart: generateDTS,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
|
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import postcss from 'postcss';
|
||||||
import * as terser from 'terser';
|
import * as terser from 'terser';
|
||||||
|
|
||||||
import locales from '../locales/index.js';
|
import locales from '../locales/index.js';
|
||||||
|
import generateDTS from '../locales/generateDTS.js';
|
||||||
import meta from '../package.json' assert { type: "json" };
|
import meta from '../package.json' assert { type: "json" };
|
||||||
|
|
||||||
async function copyFrontendFonts() {
|
async function copyFrontendFonts() {
|
||||||
|
@ -21,6 +22,8 @@ async function copyFrontendTablerIcons() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function copyFrontendLocales() {
|
async function copyFrontendLocales() {
|
||||||
|
generateDTS();
|
||||||
|
|
||||||
await fs.mkdir('./built/_frontend_dist_/locales', { recursive: true });
|
await fs.mkdir('./built/_frontend_dist_/locales', { recursive: true });
|
||||||
|
|
||||||
const v = { '_version_': meta.version };
|
const v = { '_version_': meta.version };
|
||||||
|
|
Loading…
Reference in a new issue