Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: work around npm6/postcss8 hoisting issue #6358

Merged
merged 3 commits into from Mar 24, 2021

Conversation

sodatea
Copy link
Member

@sodatea sodatea commented Mar 17, 2021

Closes #6342

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:

Copy link
Contributor

@merceyz merceyz left a comment

Choose a reason for hiding this comment

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

You really shouldn't run an install during an install

packages/@vue/cli-service/bin/postinstall.js Outdated Show resolved Hide resolved
@sodatea sodatea changed the title fix: use a postinstall script to fix npm6/postcss8 hoisting issue (WIP) fix: work around npm6/postcss8 hoisting issue Mar 17, 2021
@@ -0,0 +1,8 @@
// this file will be renamed to hotfix.js if the package is installed by npm 6
module.exports = (api) => {
api.extendPackage({
Copy link
Contributor

Choose a reason for hiding this comment

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

You can check the package manager version here and avoid the postinstall

Copy link
Member Author

Choose a reason for hiding this comment

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

The generator is controlled by @vue/cli itself, so npm is not involved during the execution, therefore the package manager version is not available.

I don't feel like adding an ad hoc API just for this fix, so I chose to keep the postinstall script.

@sodatea sodatea changed the title (WIP) fix: work around npm6/postcss8 hoisting issue fix: work around npm6/postcss8 hoisting issue Mar 18, 2021
@sodatea sodatea merged commit 27b4263 into vuejs:dev Mar 24, 2021
@sodatea sodatea deleted the fix-postcss-peer-dep branch March 24, 2021 05:55
@sodatea
Copy link
Member Author

sodatea commented Mar 24, 2021

Oh I shouldn't have merged this one…
The postinstall script does not help.

I may better throw a runtime error for incorrect hoisting results.

sodatea added a commit that referenced this pull request Mar 24, 2021
sodatea added a commit that referenced this pull request Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build throws "PostCSS plugin autoprefixer requires PostCSS 8" (alpha.6 regression)
2 participants