Skip to content

Commit 132b17c

Browse files
committed
Webpack memmory performance
1 parent 172c254 commit 132b17c

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

src/bundle/Command/CompileAssetsCommand.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ protected function configure(): void
5151
'Config name passed to webpack encore',
5252
null
5353
)
54+
->addOption(
55+
'config',
56+
'cf',
57+
InputOption::VALUE_REQUIRED,
58+
'Config file passed to webpack encore',
59+
null
60+
)
5461
;
5562
}
5663

@@ -68,6 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6875
$timeout = (float)$input->getOption('timeout');
6976
$env = $input->getOption('env');
7077
$configName = $input->getOption('config-name');
78+
$config = $input->getOption('config');
7179

7280
$output->writeln(sprintf('Compiling all <comment>%s</comment> assets.', $env));
7381
$output->writeln('');
@@ -79,6 +87,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7987
$yarnEncoreCommand .= " --config-name {$configName}";
8088
}
8189

90+
if (!empty($config)) {
91+
$yarnEncoreCommand .= " --config {$config}";
92+
}
93+
8294
$debugFormatter = $this->getHelper('debug_formatter');
8395

8496
$process = Process::fromShellCommandline(

src/bundle/DependencyInjection/IbexaAdminUiExtension.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ class IbexaAdminUiExtension extends Extension implements PrependExtensionInterfa
2828
'ibexa.webpack.custom.config.js' => [
2929
'ibexa.webpack.custom.config.js' => [],
3030
],
31+
'ibexa.webpack.internal.config.js' => [
32+
'ibexa.webpack.internal.config.js' => [],
33+
],
34+
'ibexa.webpack.richtext.config.js' => [
35+
'ibexa.webpack.richtext.config.js' => [],
36+
],
37+
'ibexa.webpack.libs.config.js' => [
38+
'ibexa.webpack.libs.config.js' => [],
39+
],
3140
'ibexa.config.setup.js' => [
3241
'ibexa.config.setup.js' => [],
3342
],

src/bundle/Resources/encore/ibexa.webpack.custom.config.js renamed to src/bundle/Resources/encore/ibexa.webpack.libs.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const Encore = require('@symfony/webpack-encore');
22
const path = require('path');
33

4-
Encore.reset();
54
Encore.setOutputPath('public/assets/react/build')
65
.setPublicPath('/assets/react/build')
76
.addAliases({
@@ -15,7 +14,7 @@ Encore.addEntry('ibexa-admin-ui-react-load-js', [path.resolve(__dirname, '../pub
1514
const customConfigReact = Encore.getWebpackConfig();
1615

1716
customConfigReact.name = 'react';
18-
17+
1918
Encore.reset();
2019
Encore.setOutputPath('public/assets/react-dom/build')
2120
.setPublicPath('/assets/react-dom/build')
@@ -34,4 +33,4 @@ const customConfigReactDOM = Encore.getWebpackConfig();
3433

3534
customConfigReactDOM.name = 'reactDOM';
3635

37-
module.exports = [customConfigReact, customConfigReactDOM];
36+
module.exports = [customConfigReact, customConfigReactDOM];

0 commit comments

Comments
 (0)