Skip to content

Commit

Permalink
windows symlinks->junctions
Browse files Browse the repository at this point in the history
This may be a fix for #462.
  • Loading branch information
ef4 committed Oct 20, 2021
1 parent 497d5c5 commit 5871080
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions packages/ember-auto-import/ts/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Options } from './package';
import { PackageCache } from '@embroider/shared-internals';
import { Memoize } from 'typescript-memoize';
import makeDebug from 'debug';
import { ensureSymlinkSync } from 'fs-extra';
import { ensureDirSync, symlinkSync, existsSync } from 'fs-extra';

const debug = makeDebug('ember-auto-import:webpack');

Expand Down Expand Up @@ -363,7 +363,10 @@ export default class WebpackBundler extends Plugin implements Bundler {
}

private ensureLinked({ packageName, packageRoot }: { packageName: string; packageRoot: string }): void {
ensureSymlinkSync(packageRoot, join(this.stagingDir, 'node_modules', packageName), 'dir');
ensureDirSync(dirname(join(this.stagingDir, 'node_modules', packageName)));
if (!existsSync(join(this.stagingDir, 'node_modules', packageName))) {
symlinkSync(packageRoot, join(this.stagingDir, 'node_modules', packageName), 'junction');
}
}

private async runWebpack(): Promise<Required<Stats>> {
Expand Down

0 comments on commit 5871080

Please sign in to comment.