Skip to content

Commit

Permalink
feat(bundler): support module resolution for lerna hoisting
Browse files Browse the repository at this point in the history
When standard resolution failed, try app's local folder.
  • Loading branch information
3cp committed Dec 29, 2018
1 parent 76dae4b commit dabc8b9
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 373 deletions.
2 changes: 1 addition & 1 deletion bin/aurelia-cli.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
'use strict';
const resolve = require('../lib/resolve');
const resolve = require('resolve');

const semver = require('semver');
const nodeVersion = process.versions.node;
Expand Down
8 changes: 7 additions & 1 deletion lib/build/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ exports.couldMissGulpPreprocess = function(id) {
// require.resolve(packageName) cannot resolve package has no main.
// for instance: font-awesome v4.7.0
// manually try resolve paths
const PACKAGE_PATHS = require.resolve.paths('not-core/');
const PACKAGE_PATHS = [
// normal search from cli
...require.resolve.paths('not-core/'),
// additional search from app's folder, this is necessary to support
// lerna hoisting where cli is out of app's local node_modules folder.
...require('resolve/lib/node-modules-paths')(process.cwd(), {})
];

// resolve npm package path
exports.resolvePackagePath = function(packageName) {
Expand Down
5 changes: 0 additions & 5 deletions lib/resolve/index.js

This file was deleted.

192 changes: 0 additions & 192 deletions lib/resolve/lib/async.js

This file was deleted.

8 changes: 0 additions & 8 deletions lib/resolve/lib/caller.js

This file was deleted.

4 changes: 0 additions & 4 deletions lib/resolve/lib/core.js

This file was deleted.

38 changes: 0 additions & 38 deletions lib/resolve/lib/core.json

This file was deleted.

38 changes: 0 additions & 38 deletions lib/resolve/lib/node-modules-paths.js

This file was deleted.

81 changes: 0 additions & 81 deletions lib/resolve/lib/sync.js

This file was deleted.

Loading

0 comments on commit dabc8b9

Please sign in to comment.