Skip to content

Commit

Permalink
fix(builder): create output directory before building (#2980)
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz authored Jun 7, 2021
1 parent d2dfdb5 commit 74fcb72
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .yarn/versions/04e0bcd3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
releases:
"@yarnpkg/builder": patch

declined:
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-exec"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/cli"
- "@yarnpkg/pnp"
4 changes: 3 additions & 1 deletion packages/yarnpkg-builder/sources/commands/build/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {StreamReport, MessageName, Configuration, formatUtils, structUtils} from '@yarnpkg/core';
import {pnpPlugin} from '@yarnpkg/esbuild-plugin-pnp';
import {npath} from '@yarnpkg/fslib';
import {npath, xfs} from '@yarnpkg/fslib';
import {Command, Option, Usage, UsageError} from 'clipanion';
import {build, Plugin} from 'esbuild-wasm';
import fs from 'fs';
Expand Down Expand Up @@ -62,6 +62,8 @@ export default class BuildPluginCommand extends Command {
const prettyName = structUtils.prettyIdent(configuration, structUtils.parseIdent(name));
const output = path.join(basedir, `bundles/${name}.js`);

await xfs.mkdirPromise(npath.toPortablePath(path.dirname(output)), {recursive: true});

const report = await StreamReport.start({
configuration,
includeFooter: false,
Expand Down

0 comments on commit 74fcb72

Please sign in to comment.