Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ plugins: [
peerDependencies: true,
// Reduce amount of console logging
quiet: false,
// npm command used inside company, yarn is not supported yet
npm: 'tnpm'
});
],
```
Expand Down
9 changes: 7 additions & 2 deletions src/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ var util = require("util");
var EXTERNAL = /^\w[a-z\-0-9\.]+$/; // Match "react", "path", "fs", "lodash.random", etc.
var PEERS = /UNMET PEER DEPENDENCY ([a-z\-0-9\.]+)@(.+)/gm;

var defaultOptions = { dev: false, peerDependencies: true, quiet: false };
var defaultOptions = {
dev: false,
peerDependencies: true,
quiet: false,
npm: 'npm',
};
var erroneous = [];

function normalizeBabelPlugin(plugin, prefix) {
Expand Down Expand Up @@ -145,7 +150,7 @@ module.exports.install = function install(deps, options) {
});

// Ignore input, capture output, show errors
var output = spawn.sync("npm", args, {
var output = spawn.sync(options.npm, args, {
stdio: ["ignore", "pipe", "inherit"]
});

Expand Down
2 changes: 1 addition & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ NpmInstallPlugin.prototype.resolve = function(resolver, result, callback) {
);
}

if (major === "2") {
if (major === "2" || major === "3") {
return this.compiler.resolvers[resolver].resolve(
result.context || {},
result.path,
Expand Down
1 change: 1 addition & 0 deletions test/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe("plugin", function() {
dev: false,
peerDependencies: true,
quiet: false,
npm: 'npm',
};

this.plugin = new Plugin(this.options);
Expand Down