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

scripts: Don’t make empty subfolders for ignored files in build folder #7001

Merged
merged 2 commits into from
Sep 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- `[docs]` Replace shallow equality with referential identity in `ExpectAPI.md` ([#6991](https://github.com/facebook/jest/pull/6991))
- `[jest-changed-files]` Refactor to use `execa` over `child_process` ([#6987](https://github.com/facebook/jest/pull/6987))
- `[*]` Bump dated dependencies ([#6978](https://github.com/facebook/jest/pull/6978))
- `[scripts]` Don’t make empty subfolders for ignored files in build folder ([#7001](https://github.com/facebook/jest/pull/7001))

## 23.6.0

Expand Down
11 changes: 7 additions & 4 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

/**
* script to build (transpile) files.
* By default it transpiles all files for all packages and writes them
* By default it transpiles js files for all packages and writes them
* into `build/` directory.
* Non-js or files matching IGNORE_PATTERN will be copied without transpiling.
* Non-js files not matching IGNORE_PATTERN will be copied without transpiling.
*
* Example:
* node ./scripts/build.js
Expand Down Expand Up @@ -124,15 +124,18 @@ function buildBrowserPackage(p) {
function buildFile(file, silent) {
const destPath = getBuildPath(file, BUILD_DIR);

mkdirp.sync(path.dirname(destPath));
if (micromatch.isMatch(file, IGNORE_PATTERN)) {
silent ||
process.stdout.write(
chalk.dim(' \u2022 ') +
path.relative(PACKAGES_DIR, file) +
' (ignore)\n'
);
} else if (!micromatch.isMatch(file, JS_FILES_PATTERN)) {
return;
}

mkdirp.sync(path.dirname(destPath));
if (!micromatch.isMatch(file, JS_FILES_PATTERN)) {
fs.createReadStream(file).pipe(fs.createWriteStream(destPath));
silent ||
process.stdout.write(
Expand Down