Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
const tsLoaderConfigModule = require('ts-loader/dist/config.js');
const tsLoaderUtilsModule = require('ts-loader/dist/utils.js');
tsLoaderConfigModule.getConfigFile = function getConfigFile(
compiler, loader, loaderOptions, compilerCompatible, log, compilerDetailsLogMessage) {
let configFilePath = loaderOptions.configFileName;
var configFileError;
log.logInfo(('ts-loader: Using config file at ' + configFilePath).green);
let configFile = compiler.readConfigFile(configFilePath, compiler.sys.readFile);
if (configFile.error) {
configFileError = tsLoaderUtilsModule.formatErrors(
[configFile.error], loaderOptions, compiler, {file: configFilePath})[0];
}
if (!configFileError) {
configFile.config.compilerOptions =
Object.assign({}, configFile.config.compilerOptions, loaderOptions.compilerOptions);
// do any necessary config massaging
if (loaderOptions.transpileOnly) {
configFile.config.compilerOptions.isolatedModules = true;
}