Introducing a new way to review your PRs.

Read the announcement

ikrishg / reseter.css

The Modern CSS Reset 🚀

View on GitHub

9 documents · Updated Oct 12, 2026

docs / css-alias-copy-automation

CSS alias copy automation

CSS alias copy automation keeps the package's compatibility stylesheet names aligned with the generated minified CSS output. It runs after minification and places two compatibility names under the published css/ paths, so consumers can use the established aliases without a separate build path.

Alias output

Compatibility aliases

The compatibility aliases are alternate public paths for the generated distribution stylesheet. The helper maps dist/index.min.css to both css/reseter.min.css and css/reseter.css. The two names therefore point to the same minified reset output rather than separate style variants.

References: scripts/copy-css-aliases.js• L6-15 package.json• L25-29

Published package role

The aliases are part of the package files exposed to consumers. The package includes both dist and css, so the copy step keeps the compatibility names present in the distribution that users install.

References: package.json• L25-29 scripts/copy-css-aliases.js• L6-9

Build flow

Post-minification copy stage

The copy stage runs as the postminify lifecycle step. The build first creates the minified full stylesheet, then minifies the smaller stylesheet, and finally invokes the alias helper. This ordering makes both aliases depend on the completed minified full stylesheet.

The flow from generated CSS to package aliases is:

flowchart LR
    A[dist/index.min.css] --> C[copy-css-aliases.js]
    C --> D[css/reseter.css]
    C --> E[css/reseter.min.css]

References: package.json• L39-46 scripts/copy-css-aliases.js• L10-19

Directory readiness

The helper creates the package's css directory before it copies files. This lets a clean build produce the alias output without requiring the directory to exist first.

References: scripts/copy-css-aliases.js• L6-10

The parent page CSS distribution build describes the full build that produces the source-based CSS outputs. The sibling page CSS artifact publishing explains the checked-in artifacts that consumers load. This page narrows the view to the final name-alignment step that connects generated files to compatibility aliases.

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep both alias source paths tied to dist/index.min.css. The smaller mini outputs are not the sources for the reseter aliases.
  • Keep the css directory in the package file list when alias paths are changed. Otherwise the build can create aliases that are not included in the published package.
  • Keep the copy stage after CSS generation and minification. Earlier execution can copy missing or stale source files.

Important failure modes

TriggerConsequenceGuard
The source file in the alias map is missingThe copy stage fails and the build does not completeRun the alias step after the full CSS generation and minification stages
An alias path changes without a matching package file entryConsumers cannot install the compatibility fileKeep public alias paths aligned with the package files list
The alias map points to a mini stylesheetThe compatibility name serves a reduced style setMap both reseter aliases only to dist/index.min.css

Key files

FileWhy to read it
scripts/copy-css-aliases.jsDefines the alias mapping and performs the final copies
package.jsonConnects the helper to the build lifecycle and includes css in the published package