UNPKG

@atlassian/wrm-troubleshooting

Version:

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

32 lines 1.56 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.runWebpackBundleWithInjectedPluginCliV4 = runWebpackBundleWithInjectedPluginCliV4; exports.runWebpackBundleCliV4 = runWebpackBundleCliV4; const execa_1 = __importDefault(require("execa")); const fs_1 = require("fs"); const path_1 = __importDefault(require("path")); async function runWebpackBundleWithInjectedPluginCliV4(webpackCliInfo, webpackConfigFile, commandTimeout) { const configPath = path_1.default.resolve(__dirname, '../webpackPlugin/webpack.config.js'); try { await fs_1.promises.access(configPath); } 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', 'build', '--config', webpackConfigFile, configPath, '--merge'], { cwd: webpackCliInfo.workingDirectory, timeout: commandTimeout, }); } function runWebpackBundleCliV4(webpackCliInfo, webpackConfigFile, commandTimeout) { // TODO: Should we pass webpack bundling modes here? return (0, execa_1.default)('npx', ['webpack-cli', 'bundle', '--config', webpackConfigFile], { cwd: webpackCliInfo.workingDirectory, timeout: commandTimeout, }); } //# sourceMappingURL=webpackCliV4.js.map