Skip to content

Commit

Permalink
chore(ci): reduce the scanned extensions in dc's ow config to the one…
Browse files Browse the repository at this point in the history
…s actually used

as having the unused ones in makes resolution a lot slower (from 11s with all possible extensions on to 3s with only .js and .d.ts enabled)
  • Loading branch information
sverweij committed Dec 25, 2020
1 parent 4328967 commit fd11673
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
19 changes: 17 additions & 2 deletions .dependency-cruiser.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
],

/* list of module systems to cruise */
// "moduleSystems": ["amd", "cjs", "es6", "tsd"],
"moduleSystems": ["cjs", "es6"],

/* prefix for links in html and svg output (e.g. https://github.com/you/yourrepo/blob/develop/) */
"prefix": "https://github.com/sverweij/dependency-cruiser/blob/develop/",
Expand Down Expand Up @@ -227,7 +227,22 @@
"enhancedResolveOptions": {
"exportsFields": ["exports"],
"conditionNames": ["require"],
"extensions": [".js", ".ts", ".d.ts"]
"extensions": [
".js",
// ".cjs",
// ".mjs",
// ".jsx",
// ".ts",
// ".tsx",
".d.ts"
// ".coffee",
// ".litcoffee",
// "cofee.md",
// ".csx",
// ".cjsx",
// ".vue",
// ".svelte"
]
},
"exoticRequireStrings": ["tryRequire"],
"reporterOptions": {
Expand Down
9 changes: 4 additions & 5 deletions src/extract/transpile/meta.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const _get = require("lodash/get");
const supportedTranspilers = require("../../../package.json")
.supportedTranspilers;
const { supportedTranspilers } = require("../../../package.json");
const javaScriptWrap = require("./javascript-wrap");
const typeScriptWrap = require("./typescript-wrap")();
const tsxWrap = require("./typescript-wrap")(true);
Expand Down Expand Up @@ -78,7 +77,7 @@ module.exports.getWrapper = (pExtension, pTranspilerOptions) => {
* all supported extensions and whether or not it is supported
* in the current environment
*
* @type {array}
* @type {string[]}
*/
module.exports.allExtensions = Object.keys(EXTENSION2WRAPPER).map((pKey) => ({
extension: pKey,
Expand All @@ -89,7 +88,7 @@ module.exports.allExtensions = Object.keys(EXTENSION2WRAPPER).map((pKey) => ({
* an array of extensions that are 'scannable' (have a valid transpiler
* available for) in the current environemnt.
*
* @type {array}
* @type {string[]}
*/
module.exports.scannableExtensions = Object.keys(
EXTENSION2WRAPPER
Expand All @@ -100,7 +99,7 @@ module.exports.scannableExtensions = Object.keys(
* - the version (range) supported
* - whether or not it is available in the current environment
*
* @returns {array} an array of supported transpilers
* @return {any[]} an array of supported transpilers
*/
module.exports.getAvailableTranspilers = () =>
Object.keys(supportedTranspilers).map((pTranspiler) => ({
Expand Down

0 comments on commit fd11673

Please sign in to comment.