@after-work.js/transform
Advanced tools
Comparing version 5.0.0-beta.1 to 5.0.0-beta.2
{ | ||
"name": "@after-work.js/transform", | ||
"version": "5.0.0-beta.1", | ||
"version": "5.0.0-beta.2", | ||
"publishConfig": { | ||
@@ -23,3 +23,3 @@ "access": "public" | ||
"dependencies": { | ||
"@after-work.js/utils": "^5.0.0-beta.1", | ||
"@after-work.js/utils": "^5.0.0-beta.2", | ||
"find-cache-dir": "1.0.0", | ||
@@ -26,0 +26,0 @@ "import-cwd": "2.1.0" |
@@ -47,2 +47,3 @@ /* eslint class-methods-use-this: 0, no-restricted-syntax: 0, guard-for-in: 0, no-await-in-loop: 0, max-len: 0 */ | ||
ignoreCacheInvalidation = false, | ||
fileCache = true, | ||
virtualMock = false, | ||
@@ -55,2 +56,5 @@ babelOptions, | ||
this.transform.set(filename, value); | ||
if (!fileCache) { | ||
return null; | ||
} | ||
if (ignoreCacheInvalidation) { | ||
@@ -57,0 +61,0 @@ return value; |
/* eslint global-require: 0, import/no-dynamic-require: 0, object-curly-newline: 0, class-methods-use-this: 0, max-len: 0 */ | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
@@ -10,4 +9,3 @@ const { isSourceMap, isTypescript, ensureFilePath } = require('@after-work.js/utils'); | ||
function getBabelOpts(filename, argv) { | ||
const { options, babelPluginIstanbul } = argv.babel; | ||
const sourceRoot = (options && options.sourceRoot) || argv.coverage ? path.dirname(filename) : undefined;// eslint-disable-line | ||
const { options: { sourceRoot, only, ignore }, babelPluginIstanbul } = argv.babel; | ||
const addCoverage = argv.instrument.testExclude.shouldInstrument(filename); | ||
@@ -19,3 +17,2 @@ const plugins = addCoverage ? | ||
const retainLines = true; | ||
const { only, ignore } = argv.babelOptions || {}; | ||
return { filename, sourceRoot, plugins, only, ignore, sourceMaps, retainLines }; | ||
@@ -27,4 +24,4 @@ } | ||
const { transform: { typescript: { compilerOptions, babelOptions } } } = argv; | ||
const fileName = argv.coverage ? path.basename(filePath) : filePath; | ||
compilerOptions.sourceRoot = argv.coverage ? path.resolve(path.dirname(filePath)) : sourceRoot; | ||
const fileName = filePath; | ||
compilerOptions.sourceRoot = sourceRoot; | ||
compilerOptions.inlineSources = true; | ||
@@ -31,0 +28,0 @@ if (!compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
168
6709