Skip to content

docs: document postinstall copy-out workaround for shopware-cli #1466 - #2487

Open
Soner (shyim) wants to merge 2 commits into
mainfrom
docs/storefront-build-postinstall-npm-workaround
Open

docs: document postinstall copy-out workaround for shopware-cli #1466#2487
Soner (shyim) wants to merge 2 commits into
mainfrom
docs/storefront-build-postinstall-npm-workaround

Conversation

@shyim

Copy link
Copy Markdown
Member

Documents the known workaround from shopware/shopware-cli#1466 so theme authors can keep using npm packages (e.g. @fortawesome/fontawesome-free) from SCSS while the upstream fix is still open.

Problem

shopware-cli project storefront-build fails for a pure-SCSS theme that imports from node_modules because:

  • it only runs npm install for storefront extensions with a JS entry point, and
  • even with a main.js, the storefront-root node_modules is removed before theme:compile runs.

Changes

  • New section "Using npm packages in a pure-SCSS theme (no JS entry point)" in guides/plugins/plugins/dependencies/using-npm-dependencies.md describing the postinstall copy-out workaround: empty main.js, package.json postinstall that copies SCSS into .vendor/node_modules/... and webfonts into public/static/fonts/, updated theme.json/SCSS paths, and .gitignore entries.
  • Short pointer with anchor link from guides/plugins/themes/styling/add-css-js-to-theme.md so theme authors find the workaround from the theme styling guide.
  • Added webfonts to .wordlist.txt.

Quality

  • make spellcheck passes.
  • make fix (markdown lint) passes.

Refs shopware/shopware-cli#1466.

@shopware-dev-docs-connector

shopware-dev-docs-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Developer Docs healthcheck

Status: Completed with success.
Repository: shopware/docs
Commit: 8cfb4d6
Preview: https://developer-documentation-m70dhuco7-shopware-frontends.vercel.app
Workflow run: #5125

@shyim
Soner (shyim) force-pushed the docs/storefront-build-postinstall-npm-workaround branch from 945e8ea to fe96932 Compare August 31, 2026 11:15
Comment thread guides/plugins/plugins/dependencies/using-npm-dependencies.md
Comment thread guides/plugins/plugins/dependencies/using-npm-dependencies.md
Comment thread guides/plugins/plugins/dependencies/using-npm-dependencies.md
Comment thread guides/plugins/plugins/dependencies/using-npm-dependencies.md
A pure-SCSS theme that imports from `node_modules` (e.g. @fortawesome/fontawesome-free)
fails `shopware-cli project storefront-build` because the storefront-root `node_modules`
is deleted before `theme:compile` runs. Document the known `postinstall` copy-out
workaround in the npm dependencies guide and link to it from the theme styling guide,
with a reference to shopware/shopware-cli#1466 for the longer-term fix.
@shyim
Soner (shyim) force-pushed the docs/storefront-build-postinstall-npm-workaround branch from fe96932 to f7daa36 Compare September 1, 2026 08:10
@shyim
Soner (shyim) marked this pull request as ready for review September 1, 2026 08:19
@shyim
Soner (shyim) requested review from Micha Hobert (Isengo1989) and a lite review from Copilot September 1, 2026 08:19
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

📢 Developer Announcement Recommendation

Recommendation: ❌ No Announcement Recommended

No developer announcement signals were detected.

This PR does not appear to introduce developer-facing changes that require a community announcement.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Shopware developer documentation to describe a known workaround for shopware-cli project storefront-build when a pure-SCSS theme needs to import assets from npm packages (e.g. Font Awesome) while the upstream shopware-cli issue remains unresolved.

Changes:

  • Adds a new “Using npm packages in a pure-SCSS theme (no JS entry point)” section documenting a postinstall “copy-out” workaround.
  • Adds a pointer from the theme styling guide to the new workaround section.
  • Extends the spellcheck wordlist with webfonts.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
guides/plugins/themes/styling/add-css-js-to-theme.md Adds a short section pointing theme authors to the new workaround documentation.
guides/plugins/plugins/dependencies/using-npm-dependencies.md Adds detailed steps and examples for the postinstall copy-out workaround for SCSS-only themes.
.wordlist.txt Adds webfonts to avoid spellcheck failures for the new content.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread guides/plugins/plugins/dependencies/using-npm-dependencies.md Outdated
}
```

The script does three things:
Comment on lines +192 to +193
// <plugin root>/src/Resources/app/storefront/src/scss/base.scss
@import '../../.vendor/node_modules/@fortawesome/fontawesome-free/scss/fontawesome';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Soner (@shyim) not sure about this, can you check?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes thats valid for the referencing .woff files

@Isengo1989 Micha Hobert (Isengo1989) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Soner (@shyim) Left one comment where I am not sure about, rest looks good to me, thanks for the PR 👍

Just added some code-blocks to avoid inline comments in JSON

Comment on lines +192 to +193
// <plugin root>/src/Resources/app/storefront/src/scss/base.scss
@import '../../.vendor/node_modules/@fortawesome/fontawesome-free/scss/fontawesome';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Soner (@shyim) not sure about this, can you check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants