This repository has been archived by the owner on Sep 11, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow --reporter to be relative to CWD (#24)
* test: pass --reporter values relative to CWD This test ensures that a --reporter value can be passed with a path relative to the CWD. The test should fail with this error: 1) Commands should accept custom reporters relative to the current working directory: Command failed: /Users/spencerelliott/Dev/elliottsj/webpack-command/lib/cli.js --reporter ../../lib/reporters/BasicReporter /Users/spencerelliott/Dev/elliottsj/webpack-command/test/fixtures/flags/config/src TypeError: ReporterClass is not a constructor at module.exports (/Users/spencerelliott/Dev/elliottsj/webpack-command/lib/compiler.js:91:20) at load.then (/Users/spencerelliott/Dev/elliottsj/webpack-command/lib/index.js:45:47) at process._tickCallback (internal/process/next_tick.js:68:7) at Function.Module.runMain (internal/modules/cjs/loader.js:746:11) at startup (internal/bootstrap/node.js:238:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:572:3) * feat: allow --reporter to be relative to CWD Previously, the --reporter path must have been either absolute or in node_modules or relative to lib/compiler.js. This change ensures that a path passed to --reporter is resolved relative to process.cwd(). e.g. you can now run this inside of a project directory to use a custom reporter: webpack --reporter ./MyCustomReporter.js * refactor: loop rather than nest. makes for a little better readability * fix: exit the loop if reporter was found * fix: remove whitespace leftover from github editor
- Loading branch information