Skip to content

Commit

Permalink
tests(migrate): moved to typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Oct 1, 2018
1 parent 4019d7d commit e89dde5
Show file tree
Hide file tree
Showing 112 changed files with 874 additions and 893 deletions.
4 changes: 4 additions & 0 deletions .prettierrc
@@ -0,0 +1,4 @@
{
"useTabs": true,
"tabWidth": 120
}
10 changes: 9 additions & 1 deletion packages/add/README.md
Expand Up @@ -10,17 +10,25 @@ This package contains the logic to add new properties in a webpack configuration
npm i -D webpack-cli @webpack-cli/add
```

or

```bash
yarn add --dev webpack-cli @webpack-cli/add
```

## Usage

To run the scaffolding instance programmatically, install it as a dependency. When using the package programmatically, one does not have to install webpack-cli.

### Node

```js
const add = require("@webpack-cli/add");
add();
```

### CLI (via `webpack-cli`)

```bash
npx webpack-cli add
```
```
15 changes: 7 additions & 8 deletions packages/add/index.ts
Expand Up @@ -9,15 +9,14 @@ import modifyConfigHelper from "@webpack-cli/utils/modify-config-helper";
* we're given on a generator
*
*/
const DEFAULT_WEBPACK_CONFIG_FILENAME: string = "webpack.config.js";

export default function add(...args: string[]): Function {
const DEFAULT_WEBPACK_CONFIG_FILENAME: string = "webpack.config.js";
const filePaths: string[] = args.slice(3);
let configFile: string = DEFAULT_WEBPACK_CONFIG_FILENAME;
if (filePaths.length) {
configFile = filePaths[0];
}

const filePaths: string[] = args.slice(3);
let configFile: string = DEFAULT_WEBPACK_CONFIG_FILENAME;
if (filePaths.length) {
configFile = filePaths[0];
}

return modifyConfigHelper("add", defaultGenerator, configFile);
return modifyConfigHelper("add", defaultGenerator, configFile);
}

0 comments on commit e89dde5

Please sign in to comment.