@atlassian/wrm-troubleshooting
Version:
A tool that can help you with troubleshooting the configuration of webpack and Atlassian P2 project.
32 lines • 1.55 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.runWebpackBundleWithInjectedPluginCliV3 = runWebpackBundleWithInjectedPluginCliV3;
exports.runWebpackBundleCliV3 = runWebpackBundleCliV3;
const execa_1 = __importDefault(require("execa"));
const fs_1 = require("fs");
const path_1 = __importDefault(require("path"));
async function runWebpackBundleWithInjectedPluginCliV3(webpackCliInfo, webpackConfigFile, commandTimeout) {
const pluginPath = path_1.default.resolve(__dirname, '../webpackPlugin/WebpackRetrieveConfigPlugin.js');
try {
await fs_1.promises.access(pluginPath);
}
catch (e) {
return new Error('We couldn\'t locate the "WebpackRetrieveConfigPlugin" plugin. Please try reinstalling the troubleshooting tool.');
}
// TODO: Should we pass webpack bundling modes here?
return (0, execa_1.default)('npx', ['webpack-cli', '--config', webpackConfigFile, '--plugin', pluginPath], {
cwd: webpackCliInfo.workingDirectory,
timeout: commandTimeout,
});
}
function runWebpackBundleCliV3(webpackCliInfo, webpackConfigFile, commandTimeout) {
// TODO: Should we pass webpack bundling modes here?
return (0, execa_1.default)('npx', ['webpack-cli', '--config', webpackConfigFile], {
cwd: webpackCliInfo.workingDirectory,
timeout: commandTimeout,
});
}
//# sourceMappingURL=webpackCliV3.js.map