Skip to content

Conversation

@mikeybinns
Copy link
Member

This PR updates the existing scss aliases to include Launchpad, and also provides the ability to modify the scss aliases per project with a config file.

Example scssAliases.config.ts:

import type { SCSSAliases } from "@atomicsmash/cli";
import { pathToFileURL } from "node:url";
import { resolve } from "node:path";

export default {
  importers: [
    // Launchpad alias is already available, but this removes the sitecss alias to prevent usage.
    {
      findFileUrl(url) {
        if (!url.startsWith("launchpad:")) return null;
        const pathname = url.substring(10);
        return pathToFileURL(
          `${resolve(process.cwd(), "public/wp-content/themes/launchpad/src/styles")}${pathname.startsWith("/") ? pathname : `/${pathname}`}`,
        );
      },
    },
  ],
} satisfies SCSSAliases;

Example usage:

@use "launchpad:some-folder/partial";

@changeset-bot
Copy link

changeset-bot bot commented Jul 24, 2025

🦋 Changeset detected

Latest commit: 33a7304

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@atomicsmash/compiler Minor
@atomicsmash/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mikeybinns mikeybinns added enhancement Package: CLI Issues related to the CLI package Package: Compiler Issues related to the compiler package labels Jul 24, 2025
Copy link
Contributor

@MeMattStone MeMattStone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good addition to me

@mikeybinns mikeybinns merged commit c6984da into pre-release Jul 25, 2025
9 checks passed
@mikeybinns mikeybinns deleted the feature/improve-scss-alias-handling branch July 25, 2025 13:02
This was referenced Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Package: CLI Issues related to the CLI package Package: Compiler Issues related to the compiler package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants