-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(add-cmd): add typescript support
- Loading branch information
Showing
10 changed files
with
90 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tsconfig.json | ||
*.ts |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import defaultGenerator from "@webpack-cli/generators/add-generator"; | ||
import modifyConfigHelper from "@webpack-cli/utils/modify-config-helper"; | ||
|
||
/** | ||
* Is called and returns a scaffolding instance, adding properties | ||
* | ||
* @param {String[]} args - array of arguments such as | ||
* @returns {Function} modifyConfigHelper - A helper function that uses the action | ||
* we're given on a generator | ||
* | ||
*/ | ||
|
||
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]; | ||
} | ||
|
||
return modifyConfigHelper("add", defaultGenerator, configFile); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../../tsconfig.json" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.