1.2.0 • Published 6 years ago
eject-dependencies v1.2.0
🪂 Eject dependencies
If you have dependencies in your node_modules folder, this package copies them to your source directory and changes all import references. It's like create-react-app's eject function but for all or some dependencies.
💡 Usage
Install the package globally from npm:
npm install --save-global eject-dependenciesUse the CLI:
eject-dependencies
# With configuration (see options below)
eject-dependencies --source-dir './node_modules'Or, use without installation using npx:
npx eject-dependenciesOr, use programmatically with the API:
import { eject } from "eject-dependencies";
// Default
eject();
// With configuration
eject({ sourceDir: "./node_modules" });Configuration
| Option | Description | Example value |
|---|---|---|
sourceDir | string with dependencies dir | "./node_modules" |
destDir | string with dir to copy in | "./ejected" |
codeFiles | string[] with glob files | ["src/**/*.{js,jsx"] |
updateTestFiles | boolean to also update specfiles | true |
dependenciesFilter 📦 | Function to filter dependencies (Set) | dependencies => dependencies |
📦 → This option is only supported by the API, not the CLI
👩💻 Development
Build TypeScript:
npm run buildRun unit tests and view coverage:
npm run test-without-reporting