mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
(nuxt) configure postcss to enable RTL stylings
This commit is contained in:
parent
9639d2204e
commit
26688dd7e9
@ -1,10 +1,8 @@
|
||||
import './src/dotenv.ts';
|
||||
|
||||
import { loadSuml } from './server/loader.ts';
|
||||
import autoprefixer from 'autoprefixer';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import rtlcss from 'rtlcss';
|
||||
import { defineNuxtConfig } from 'nuxt/config';
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||
import replacePlugin from '@rollup/plugin-replace';
|
||||
@ -12,7 +10,6 @@ import yamlPlugin from '@rollup/plugin-yaml';
|
||||
import { sentryVitePlugin } from '@sentry/vite-plugin';
|
||||
import type { IncomingMessage } from 'connect';
|
||||
import type { ServerResponse } from 'http';
|
||||
import type { Plugin as PostcssPlugin } from 'postcss';
|
||||
import { buildList } from './src/helpers.ts';
|
||||
import buildLocaleList from './src/buildLocaleList.ts';
|
||||
import formatError from './src/error.ts';
|
||||
@ -72,12 +69,13 @@ const esBuildOptions = {
|
||||
},
|
||||
};
|
||||
|
||||
const postCssPlugins: PostcssPlugin[] = [
|
||||
autoprefixer(),
|
||||
];
|
||||
const postCssPlugins: Record<string, object> = {
|
||||
autoprefixer: {},
|
||||
cssnano: {},
|
||||
};
|
||||
|
||||
if (config.dir === 'rtl') {
|
||||
postCssPlugins.push(rtlcss() as PostcssPlugin);
|
||||
postCssPlugins.rtlcss = {};
|
||||
}
|
||||
|
||||
const hostname = process.env.HOST ?? '0.0.0.0';
|
||||
@ -218,12 +216,8 @@ exports.randomFillSync = randomFillSync`],
|
||||
options: esBuildOptions,
|
||||
},
|
||||
},
|
||||
build: {
|
||||
postcss: {
|
||||
postcssOptions: {
|
||||
plugins: postCssPlugins,
|
||||
},
|
||||
},
|
||||
postcss: {
|
||||
plugins: postCssPlugins,
|
||||
},
|
||||
serverHandlers: [
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user