UNPKG

@atlassian/wrm-troubleshooting

Version:

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

26 lines 1.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.verifyWebpackBundle = void 0; const atlassianPluginXml_1 = require("../atlassianPluginXml"); const webpack_1 = require("../webpack/webpack"); const webpackWrmPlugin_1 = require("../webpackWrmPlugin"); const types_1 = require("./types"); const verifyWebpackBundle = async (options, payload) => { const { webpackConfigFile, webpackCliInfo, pomXml, pomFile } = payload; // Ensure we don't have any old generated module descriptors await (0, atlassianPluginXml_1.removeOldModuleDescriptors)(pomFile, pomXml); const preBundleTimestamp = Date.now(); console.log('👀 We will run webpack bundle now. This might take some time...'); const bundleResult = await (0, webpack_1.bundleWebpack)(webpackCliInfo, webpackConfigFile, options.timeout); if (bundleResult instanceof Error) { return (0, types_1.getFailedResult)(bundleResult); } // Verify if the XML files were created in the scanFolders dir const xmlResult = await (0, webpackWrmPlugin_1.verifyGeneratedWebResources)(pomFile, pomXml, preBundleTimestamp); if (xmlResult instanceof Error) { return (0, types_1.getFailedResult)(xmlResult); } return (0, types_1.getPassedResult)(); }; exports.verifyWebpackBundle = verifyWebpackBundle; //# sourceMappingURL=verifyWebpackBundle.js.map