Eric Amodio vor 3 Jahren
Ursprung
Commit
cf77136830
1 geänderte Dateien mit 10 neuen und 4 gelöschten Zeilen
  1. +10
    -4
      webpack.config.js

+ 10
- 4
webpack.config.js Datei anzeigen

@ -6,7 +6,7 @@
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
/* eslint-disable @typescript-eslint/prefer-optional-chain */
'use strict';
const { execFileSync } = require('child_process');
const { spawnSync } = require('child_process');
const path = require('path');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const { CleanWebpackPlugin: CleanPlugin } = require('clean-webpack-plugin');
@ -529,14 +529,20 @@ class InlineChunkHtmlPlugin {
}
}
/**
* @param { string } configFile
* @returns { string }
*/
function resolveTSConfig(configFile) {
const data = execFileSync('yarn', ['tsc', `-p ${configFile}`, '--showConfig'], {
const result = spawnSync('yarn', ['tsc', `-p ${configFile}`, '--showConfig'], {
cwd: __dirname,
encoding: 'utf8',
shell: true,
});
const index = data.indexOf('\n');
const json = JSON5.parse(data.substr(index + 1));
const data = result.stdout;
const start = data.indexOf('{');
const end = data.lastIndexOf('}') + 1;
const json = JSON5.parse(data.substring(start, end));
return json;
}

Laden…
Abbrechen
Speichern