Skip to content

Commit

Permalink
[nextjs] Make library path check OS agnostic (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
brijeshb42 authored Jun 25, 2024
1 parent 78b8d86 commit e99c195
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/pigment-css-unplugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {
css,
...rest
} = options;
const finalTransformLibraries = transformLibraries.concat(
process.env.RUNTIME_PACKAGE_NAME as string,
);
const finalTransformLibraries = transformLibraries
.concat(process.env.RUNTIME_PACKAGE_NAME as string)
.map((lib) => lib.split('/').join(path.sep));
const cache = new TransformCacheCollection();
const { emitter, onDone } = createFileReporter(debug ?? false);
const cssLookup = meta?.type === 'next' ? globalCssLookup : new Map<string, string>();
Expand Down
7 changes: 4 additions & 3 deletions packages/pigment-css-vite-plugin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as path from 'node:path';
import type { Plugin } from 'vite';
import {
preprocessor as basePreprocessor,
Expand Down Expand Up @@ -46,9 +47,9 @@ export function pigment(options: PigmentOptions) {
css,
...rest
} = options ?? {};
const finalTransformLibraries = transformLibraries.concat(
process.env.RUNTIME_PACKAGE_NAME as string,
);
const finalTransformLibraries = transformLibraries
.concat(process.env.RUNTIME_PACKAGE_NAME as string)
.map((lib) => lib.split('/').join(path.sep));

function injectMUITokensPlugin(): Plugin {
return {
Expand Down

0 comments on commit e99c195

Please sign in to comment.