UNPKG

@atlassian/wrm-troubleshooting

Version:

A tool that can help you with troubleshooting the configuration of webpack and Atlassian P2 project.

35 lines 1.72 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getEffectiveWebpackConfig = void 0; const chalk_1 = __importDefault(require("chalk")); const inquirer_1 = __importDefault(require("inquirer")); const webpack_1 = require("../webpack/webpack"); const types_1 = require("./types"); const getEffectiveWebpackConfig = async (options, payload) => { const { webpackConfigFile } = payload; if (!options.yes) { const answer = await inquirer_1.default.prompt({ type: 'confirm', name: 'confirmRunningWebpack', message: `We need to run ${chalk_1.default.bold('webpack CLI')} to retrieve the configuration file. Is that fine?`, }); // Silly boy! if (!answer.confirmRunningWebpack) { const error = new Error(`We can't proceed without running the ${chalk_1.default.bold('webpack')}. Please run the troubleshooting command again when you are ready to run webpack.`); return (0, types_1.getFailedResult)(error); } } const webpackConfigResult = await (0, webpack_1.retrieveEffectiveWebpackConfig)(webpackConfigFile, options.timeout); if (webpackConfigResult instanceof Error) { return (0, types_1.getFailedResult)(webpackConfigResult); } return (0, types_1.getPassedResult)({ webpackCliInfo: webpackConfigResult.cliInfo, webpackEffectiveConfig: webpackConfigResult.effectiveConfig, }); }; exports.getEffectiveWebpackConfig = getEffectiveWebpackConfig; //# sourceMappingURL=getEffectiveWebpackConfig.js.map