Skip to content

Commit

Permalink
Remove references to zero and replace with Pigment
Browse files Browse the repository at this point in the history
  • Loading branch information
brijeshb42 committed Apr 4, 2024
1 parent 11cc1d1 commit 52393b4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/pigment-css-unplugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {
const isNext = meta?.type === 'next';
const outputCss = isNext && meta.outputCss;
const babelTransformPlugin: UnpluginOptions = {
name: 'zero-plugin-transform-babel',
name: 'pigment-css-plugin-transform-babel',
enforce: 'post',
transformInclude(id) {
return isZeroRuntimeProcessableFile(id, transformLibraries);
Expand Down Expand Up @@ -155,7 +155,7 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {
};

const wywInJSTransformPlugin: UnpluginOptions = {
name: 'zero-plugin-transform-wyw-in-js',
name: 'pigment-css-plugin-transform-wyw-in-js',
enforce: 'post',
buildEnd() {
onDone(process.cwd());
Expand Down Expand Up @@ -250,7 +250,7 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {
};
}
const slug = slugify(cssText);
const cssFilename = `${slug}.zero.css`;
const cssFilename = `${slug}.pigment.css`;

if (isNext) {
// Handle url() replacement in css. Only handled in Next.js as the css is injected
Expand Down Expand Up @@ -300,15 +300,15 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {

const plugins: Array<UnpluginOptions> = [
{
name: 'zero-plugin-theme-tokens',
name: 'pigment-css-plugin-theme-tokens',
enforce: 'pre',
webpack(compiler) {
compiler.hooks.normalModuleFactory.tap(pluginName, (nmf) => {
nmf.hooks.createModule.tap(
pluginName,
// @ts-expect-error CreateData is typed as 'object'...
(createData: { matchResource?: string; settings: { sideEffects?: boolean } }) => {
if (createData.matchResource && createData.matchResource.endsWith('.zero.css')) {
if (createData.matchResource && createData.matchResource.endsWith('.pigment.css')) {
createData.settings.sideEffects = true;
}
},
Expand Down Expand Up @@ -374,13 +374,13 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {
// This is already handled separately for Next.js using `placeholderCssFile`
if (!isNext) {
plugins.push({
name: 'zero-plugin-load-output-css',
name: 'pigment-css-plugin-load-output-css',
enforce: 'pre',
resolveId(source: string) {
return cssFileLookup.get(source);
},
loadInclude(id) {
return id.endsWith('.zero.css');
return id.endsWith('.pigment.css');
},
load(id) {
return cssLookup.get(id) ?? '';
Expand Down

0 comments on commit 52393b4

Please sign in to comment.