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 9acb104 commit f7c98a0
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 @@ -121,7 +121,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 @@ -162,7 +162,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 @@ -291,7 +291,7 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {
}

const slug = slugify(cssText);
const cssFilename = `${slug}.zero.css`;
const cssFilename = `${slug}.pigment.css`;
const cssId = `./${cssFilename}`;
cssFileLookup.set(cssId, cssFilename);
cssLookup.set(cssFilename, cssText);
Expand All @@ -310,15 +310,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 @@ -384,13 +384,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 f7c98a0

Please sign in to comment.