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

Build: support build single file #11469

Merged
merged 3 commits into from Sep 9, 2021
Merged

Build: support build single file #11469

merged 3 commits into from Sep 9, 2021

Conversation

fisker
Copy link
Sponsor Member

@fisker fisker commented Sep 8, 2021

Description

yarn build --file=parser-babel.js

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

Copy link
Member

@sosukesuzuki sosukesuzuki left a comment

Choose a reason for hiding this comment

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

Just a question, when do you use this feature?

if (!params.playground) {
await execa("mkdir", ["-p", "dist/esm"]);
const shouldUseCache = !params.file && !params["purge-cache"];
const shouldBuildMetaFiles = !params.playground && !params.file;
Copy link
Member

Choose a reason for hiding this comment

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

This is actually only used as condition for if we should do preparePackage. So what about rename to shouldPreparePackage.

@sosukesuzuki
Copy link
Member

Also for some reason, our CI fails...

@fisker
Copy link
Sponsor Member Author

fisker commented Sep 8, 2021

when do you use this feature?

Debug build problem, for example, when parser-postcss.js is broken, I have to disable many lines to only build that file, because I need other files to run test.

}

await execa("mkdir", ["-p", "dist"]);
await execa("mkdir", ["-p", "dist/esm"]);

This comment was marked as resolved.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

I don't think it matters to make an empty dir.

@fisker fisker merged commit 62a2629 into prettier:main Sep 9, 2021
@fisker fisker deleted the build-file branch September 9, 2021 07:10
sosukesuzuki pushed a commit to sosukesuzuki/prettier that referenced this pull request Sep 9, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants