Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@ecopages/postcss-processor

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ecopages/postcss-processor

Postcss processor, transform string or postcss file to css

Source
npmnpm
Version
0.2.0-alpha.42
Version published
Weekly downloads
107
-92.87%
Maintainers
1
Weekly downloads
 
Created
Source

@ecopages/postcss-processor

PostCSS processing pipeline for Ecopages. It provides a processor plugin that seamlessly integrates PostCSS into the Ecopages build system, and includes built-in presets for Tailwind CSS (v3 and v4).

Features

  • Ecopages Processor Plugin: Hook right into the build pipeline.
  • Tailwind Presets: Pre-configured pipelines for Tailwind CSS v3 and v4.
  • Automatic Configuration: Detects existing postcss.config.{js,ts,etc}.
  • Bun Loader: Registers a Bun loader for importing CSS in TS/JS files.

Installation

bun add @ecopages/postcss-processor

Usage

Integrate the processor into your eco.config.ts using a preset.

Requires @tailwindcss/postcss and tailwindcss to be installed.

// eco.config.ts
import path from 'node:path';
import { ConfigBuilder } from '@ecopages/core/config-builder';
import { postcssProcessorPlugin } from '@ecopages/postcss-processor';
import { tailwindV4Preset } from '@ecopages/postcss-processor/presets/tailwind-v4';

const config = await new ConfigBuilder()
	.setProcessors([
		postcssProcessorPlugin(
			tailwindV4Preset({
				referencePath: path.resolve(import.meta.dirname, 'src/styles/app.css'),
			}),
		),
	])
	.build();

export default config;

Tailwind v3 Preset

Requires tailwindcss@3, autoprefixer, postcss-import, and cssnano to be installed.

// eco.config.ts
import { ConfigBuilder } from '@ecopages/core/config-builder';
import { postcssProcessorPlugin } from '@ecopages/postcss-processor';
import { tailwindV3Preset } from '@ecopages/postcss-processor/presets/tailwind-v3';

const config = await new ConfigBuilder().setProcessors([postcssProcessorPlugin(tailwindV3Preset())]).build();

export default config;

Custom Configuration

To use your own postcss.config.js, simply call postcssProcessorPlugin() without arguments.

You can also pass raw plugins or transformation hooks manually:

import { ConfigBuilder } from '@ecopages/core/config-builder';
import { postcssProcessorPlugin } from '@ecopages/postcss-processor';
import myPlugin from 'postcss-my-plugin';

const config = await new ConfigBuilder()
	.setProcessors([
		postcssProcessorPlugin({
			filter: /\.css$/,
			plugins: {
				'my-plugin': myPlugin(),
			},
			transformInput: async (css) => `/* Header */\n${css}`,
			transformOutput: async (css) => css.replace('blue', 'red'),
		}),
	])
	.build();

export default config;

Standalone Processing

You can bypass Ecopages entirely and use the processor utilities directly:

import { PostCssProcessor } from '@ecopages/postcss-processor';

// Process a file
const css = await PostCssProcessor.processPath('path/to/file.css');

// Process a string
const result = await PostCssProcessor.processStringOrBuffer('.class { @apply bg-red-500; }', { filePath: 'style.css' });

Keywords

postcss

FAQs

Package last updated on 21 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts