Skip to content

Commit 02541a8

Browse files
authored
Merge pull request #9293 from kbrock/paths_json
Fix bin/webpack when ui-classic not bundled
2 parents d12d720 + 13b2d67 commit 02541a8

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

bin/webpack

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ end
2525
# If nodejs is compiled with openssl 1.1, then this flag is not available
2626
# and will fail if we hardcode it into NODE_OPTIONS
2727
#
28-
# This can be removed once we upgrade webpack as then we don't need the
29-
# flag anymore.
30-
has_legacy_openssl = system('node --help | grep -qs "\\--openssl-legacy-provider"')
28+
# This can be removed once we upgrade from webpack 4.0 to 5.0
29+
`node --openssl-legacy-provider -v`
30+
# if node supported this flag, then the command return status (i.e.: $? ) will be successful
31+
has_legacy_openssl = $?.success?
3132
node_options = "--max_old_space_size=4096"
3233
node_options << " --openssl-legacy-provider" if has_legacy_openssl
3334

config/webpack/configuration.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { readFileSync } = require('fs');
88
const configPath = resolve('config', 'webpacker.yml');
99
const settings = safeLoad(readFileSync(configPath), 'utf8')[env.NODE_ENV];
1010

11-
const { output: outputRoot, engines } = require('./paths.json');
11+
const { output: outputRoot, i18n, engines } = require('./paths.json');
1212

1313
function removeOuterSlashes(string) {
1414
return string.replace(/^\/*/, '').replace(/\/*$/, '');
@@ -32,5 +32,6 @@ module.exports = {
3232
settings,
3333
env,
3434
output,
35+
i18n,
3536
engines,
3637
};

config/webpack/shared.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack
1212
const { SplitChunksPlugin } = require('webpack').optimize;
1313
const { execSync } = require('child_process');
1414

15-
const { env, settings, output, engines } = require('./configuration.js');
15+
const { env, settings, i18n, output, engines } = require('./configuration.js');
1616
const loaders = require('./loaders.js');
1717
const RailsEnginesPlugin = require('./RailsEnginesPlugin');
1818

1919
const extensionGlob = `**/*{${settings.extensions.join(',')}}*`; // */
2020
const entryPath = join(settings.source_path, settings.source_entry_path);
2121
const moduleDir = engines['manageiq-ui-classic'].node_modules;
2222

23-
const gettextDir = execSync('bundle info --path gettext_i18n_rails_js', { encoding: 'utf-8' }).trim();
23+
const gettextDir = i18n;
2424

2525
const sharedPackages = [
2626
'@carbon/icons-react',

lib/tasks/manageiq/ui_tasks.rake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,12 @@ namespace :webpack do
6666
end
6767

6868
task :paths do
69+
i18n_path = Bundler::CLI::Common.select_spec("gettext_i18n_rails_js").full_gem_path
70+
6971
json = JSON.pretty_generate(
7072
:info => "This file is autogenerated by rake webpack:paths, do not edit",
7173
:output => Rails.root.to_s,
74+
:i18n => i18n_path,
7275
:engines => asset_engines.map { |p|
7376
key = p.namespace
7477
value = {:root => p.path,

0 commit comments

Comments
 (0)