Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fc09d8c
webpack.config.js: Update paths
adriendupuis Sep 9, 2025
ccbeb83
Update webpack.config.js for 5.0
adriendupuis Sep 9, 2025
cfe8ef5
Update webpack.config.js for 5.0
adriendupuis Sep 9, 2025
16f9f67
Update webpack.config.js for 5.0
adriendupuis Sep 9, 2025
db84621
Update append_to_webpack.config.js for 5.0
adriendupuis Sep 9, 2025
eeb8a16
Merge branch '5.0' into update-5.0-webpack.config.js
adriendupuis Aug 13, 2026
1aa1070
add_browser_tab.md: Update Webpack Ibexa config usage
adriendupuis Aug 13, 2026
3f6b255
Apply suggestion from @adriendupuis
adriendupuis Aug 13, 2026
5d32bf2
extend_image_editor.md: module.exports
adriendupuis Aug 13, 2026
9fefad8
`webpack.config.js` usage update
adriendupuis Aug 13, 2026
46de051
`webpack.config.js` usage update (js instead of diff)
adriendupuis Aug 13, 2026
0541629
customize_search_suggestion.md: module.exports
adriendupuis Aug 13, 2026
67853e5
image_editor/…/webpack.config.js format
adriendupuis Aug 13, 2026
b6e31a3
custom_form_attribute/…/webpack.config.js update
adriendupuis Aug 13, 2026
9be4915
ai_actions/webpack.config.js update
adriendupuis Aug 13, 2026
0bfabd0
Update importing_assets_from_bundle.md
adriendupuis Aug 13, 2026
b723589
importing_assets_from_bundle.md: convert tabs into 4 spaces
adriendupuis Aug 13, 2026
dc72a37
update_to_5.0.md: month_change: true
adriendupuis Aug 13, 2026
87038e3
add_browser_tab.md: include_file -> include_code
adriendupuis Aug 13, 2026
b35a58d
update_to_5.0.md: Fix Multiple consecutive blank lines
adriendupuis Aug 13, 2026
85646dc
Remove ./ibexa.webpack.config.manager.js
adriendupuis Aug 13, 2026
e6c5aa0
subitems_list.md: Update ibexaConfigManager & ibexaConfig
adriendupuis Aug 13, 2026
66a1262
update_to_5.0.md: Format
adriendupuis Aug 13, 2026
d22d370
update_to_5.0.md: Format
adriendupuis Aug 13, 2026
7e71dda
update_to_5.0.md: Fix typo
adriendupuis Aug 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion code_samples/ai_actions/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const ibexaConfigManager = require('./ibexa.webpack.config.manager.js');
const ibexaConfigManager = require('@ibexa/frontend-config/webpack-config/manager');
const getIbexaConfig = require('@ibexa/frontend-config/webpack-config/ibexa');
const ibexaConfig = getIbexaConfig();

ibexaConfigManager.add({
ibexaConfig,
Expand All @@ -7,3 +9,5 @@ ibexaConfigManager.add({
path.resolve(__dirname, './assets/js/addAudioModule.js')
],
});

module.exports = [ibexaConfig, ...customConfigs, projectConfig];
49 changes: 25 additions & 24 deletions code_samples/back_office/image_editor/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
const Encore = require('@symfony/webpack-encore');
const fs = require('fs');
const path = require('path');
const getIbexaConfig = require('./ibexa.webpack.config.js');
const ibexaConfig = getIbexaConfig(Encore);
const customConfigs = require('./ibexa.webpack.custom.configs.js');
const { isReactBlockPathCreated } = require('./ibexa.webpack.config.react.blocks.js');
const ibexaConfigManager = require('./ibexa.webpack.config.manager.js');
const Encore = require('@symfony/webpack-encore');
const getWebpackConfigs = require('@ibexa/frontend-config/webpack-config/get-configs');
const customConfigsPaths = require('./var/encore/ibexa.webpack.custom.config.js');

const customConfigs = getWebpackConfigs(Encore, customConfigsPaths);
const isReactBlockPathCreated = fs.existsSync('./assets/page-builder/react/blocks');

Encore.reset();
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.enableStimulusBridge('./assets/controllers.json')
.enableSassLoader()
.enableReactPreset()
.enableReactPreset((options) => {
options.runtime = 'classic';
})
.enableSingleRuntimeChunk()
.copyFiles({
from: './assets/images',
to: 'images/[path][name].[ext]',
pattern: /\.(png|svg)$/
})
.configureBabel((config) => {
config.plugins.push('@babel/plugin-proposal-class-properties');
pattern: /\.(png|svg)$/,
})

// enables @babel/preset-env polyfills
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
})
;
});

// Welcome page stylesheets
Encore.addEntry('welcome-page-css', [
Expand All @@ -47,18 +43,23 @@ if (isReactBlockPathCreated) {

Encore.addEntry('app', './assets/app.js');

// Image Editor Dot Action
const projectConfig = Encore.getWebpackConfig();

projectConfig.name = 'app';

module.exports = [...customConfigs, projectConfig];

/* Get ibexaConfig and ibexaConfigManager */
const ibexaConfigManager = require('@ibexa/frontend-config/webpack-config/manager');
const getIbexaConfig = require('@ibexa/frontend-config/webpack-config/ibexa');
const ibexaConfig = getIbexaConfig();

/* Add dot action to Admin UI layout JS */
ibexaConfigManager.add({
ibexaConfig,
entryName: 'ibexa-admin-ui-layout-js',
newItems: [ path.resolve(__dirname, './assets/random_dot/random-dot.js'), ],
});
Comment thread
adriendupuis marked this conversation as resolved.

const projectConfig = Encore.getWebpackConfig();

projectConfig.name = 'app';

/* Export updated ibexaConfig and previous modules */
module.exports = [ibexaConfig, ...customConfigs, projectConfig];

// uncomment this line if you've commented-out the above lines
// module.exports = [ eZConfig, ibexaConfig, ...customConfigs ];
6 changes: 5 additions & 1 deletion code_samples/back_office/search/append_to_webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
const ibexaConfigManager = require('./ibexa.webpack.config.manager.js');
const ibexaConfigManager = require('@ibexa/frontend-config/webpack-config/manager');
const getIbexaConfig = require('@ibexa/frontend-config/webpack-config/ibexa');
const ibexaConfig = getIbexaConfig();

ibexaConfigManager.add({
ibexaConfig,
entryName: 'ibexa-admin-ui-layout-js',
newItems: [path.resolve(__dirname, './assets/js/admin.search.autocomplete.product.js')],
});

module.exports = [ibexaConfig, ...customConfigs, projectConfig];
32 changes: 13 additions & 19 deletions code_samples/forms/custom_form_attribute/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
const Encore = require('@symfony/webpack-encore');
const fs = require('fs');
const path = require('path');
const getIbexaConfig = require('./ibexa.webpack.config.js');
const ibexaConfig = getIbexaConfig(Encore);
const customConfigs = require('./ibexa.webpack.custom.configs.js');
const { isReactBlockPathCreated } = require('./ibexa.webpack.config.react.blocks.js');
const Encore = require('@symfony/webpack-encore');
const getWebpackConfigs = require('@ibexa/frontend-config/webpack-config/get-configs');
const customConfigsPaths = require('./var/encore/ibexa.webpack.custom.config.js');

const customConfigs = getWebpackConfigs(Encore, customConfigsPaths);
const isReactBlockPathCreated = fs.existsSync('./assets/page-builder/react/blocks');

Encore.reset();
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.enableStimulusBridge('./assets/controllers.json')
.enableSassLoader()
.enableReactPreset()
.enableReactPreset((options) => {
options.runtime = 'classic';
})
.enableSingleRuntimeChunk()
.copyFiles({
from: './assets/images',
to: 'images/[path][name].[ext]',
pattern: /\.(png|svg)$/
pattern: /\.(png|svg)$/,
})
.configureBabel((config) => {
config.plugins.push('@babel/plugin-proposal-class-properties');
})

// enables @babel/preset-env polyfills
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
})
;
});

// Welcome page stylesheets
Encore.addEntry('welcome-page-css', [
Expand All @@ -52,7 +49,4 @@ const projectConfig = Encore.getWebpackConfig();

projectConfig.name = 'app';

module.exports = [ibexaConfig, ...customConfigs, projectConfig];

// uncomment this line if you've commented-out the above lines
// module.exports = [ eZConfig, ibexaConfig, ...customConfigs ];
module.exports = [...customConfigs, projectConfig];
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ To import assets from a bundle, configure them in an `ibexa.config.js` file that
const path = require('path');

module.exports = (Encore) => {
Encore.addEntry('<entry-name>', [
path.resolve(__dirname, '<path_to_file>'),
Encore.addEntry('<entry-name>', [
path.resolve(__dirname, '<path_to_file>'),
]);
};
```
Expand All @@ -40,35 +40,35 @@ To edit existing configuration entries, either in the bundle's `Resources/encore
const path = require('path');

module.exports = (ibexaConfig, ibexaConfigManager) => {
ibexaConfigManager.replace({
ibexaConfig,
entryName: '<entry-name>',
itemToReplace: path.resolve(__dirname, '<path_to_old_file>'),
newItem: path.resolve(__dirname, '<path_to_new_file>'),
});
ibexaConfigManager.remove({
ibexaConfig,
entryName: '<entry-name>',
itemsToRemove: [
path.resolve(__dirname, '<path_to_old_file>'),
path.resolve(__dirname, '<path_to_old_file>'),
],
});
ibexaConfigManager.add({
ibexaConfig,
entryName: '<entry-name>',
newItems: [
path.resolve(__dirname, '<path_to_new_file>'),
path.resolve(__dirname, '<path_to_new_file>'),
],
});
ibexaConfigManager.replace({
ibexaConfig,
entryName: '<entry-name>',
itemToReplace: path.resolve(__dirname, '<path_to_old_file>'),
newItem: path.resolve(__dirname, '<path_to_new_file>'),
});
ibexaConfigManager.remove({
ibexaConfig,
entryName: '<entry-name>',
itemsToRemove: [
path.resolve(__dirname, '<path_to_old_file>'),
path.resolve(__dirname, '<path_to_old_file>'),
],
});
ibexaConfigManager.add({
ibexaConfig,
entryName: '<entry-name>',
newItems: [
path.resolve(__dirname, '<path_to_new_file>'),
path.resolve(__dirname, '<path_to_new_file>'),
],
});
};
```

!!! tip

If you don't know what `entryName` to use, you can use the browser's developer tools to check what files are loaded on the given page.
Then, use the file name as `entryName`.
If you don't know what `entryName` to use, you can use the browser's developer tools to check what files are loaded on the given page.
Then, use the file name as `entryName`.

!!! tip

Expand All @@ -79,20 +79,20 @@ module.exports = (ibexaConfig, ibexaConfigManager) => {
To add a new configuration under your own namespace and with its own dependencies, create an `ibexa.webpack.custom.config.js` file that you create either in the bundle's `Resources/encore/` folder, or in the `encore` folder in the root directory of your project, for example:

``` js
const Encore = require('@symfony/webpack-encore');
const Encore = require('@symfony/webpack-encore');

Encore.setOutputPath('<custom-path>')
.setPublicPath('<custom-path>')
.addExternals('<custom-externals>')
// ...
.addEntry('<entry-name>', ['<JS-path>']);
Encore.setOutputPath('<custom-path>')
.setPublicPath('<custom-path>')
.addExternals('<custom-externals>')
// ...
.addEntry('<entry-name>', ['<JS-path>']);

const customConfig = Encore.getWebpackConfig();
const customConfig = Encore.getWebpackConfig();

customConfig.name = 'customConfigName';
customConfig.name = 'customConfigName';

// Config or array of configs: [customConfig1, customConfig2];
module.exports = customConfig;
// Config or array of configs: [customConfig1, customConfig2];
module.exports = customConfig;
```

!!! tip
Expand All @@ -103,14 +103,16 @@ To add a new configuration under your own namespace and with its own dependencie

## Configuration from main project files

If you prefer to include the asset configuration in the main project files, add it in [`webpack.config.js`](https://github.com/ibexa/recipes/blob/master/ibexa/oss/4.6/encore/webpack.config.js#L26).
If you prefer to include the asset configuration in the main project files, add it in [`webpack.config.js`](https://github.com/ibexa/recipes/blob/master/ibexa/oss/5.0/encore/webpack.config.js#L26).

To overwrite the built-in assets, use the following configuration to replace, remove, or add asset files in `webpack.config.js`:

``` js
const ibexaConfigManager = require('./ibexa.webpack.config.manager.js');
const ibexaConfigManager = require('@ibexa/frontend-config/webpack-config/manager');
const getIbexaConfig = require('@ibexa/frontend-config/webpack-config/ibexa');
const ibexaConfig = getIbexaConfig();

//...
//

ibexaConfigManager.replace({
ibexaConfig,
Expand All @@ -136,4 +138,9 @@ ibexaConfigManager.add({
path.resolve(__dirname, '<path_to_new_file>'),
],
});

//…

module.exports = [ibexaConfig, ...customConfigs, projectConfig];

```
42 changes: 25 additions & 17 deletions docs/administration/back_office/browser/add_browser_tab.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Follow the instructions below to create and add a new tab called **Images** whic
First, in `assets/js/image-tab/`, add an `image.tab.module.js` file.

``` js
[[= include_file('code_samples/back_office/udw/assets/js/image-tab/image.tab.module.js', 0, 14) =]]
[[= include_code('code_samples/back_office/udw/assets/js/image-tab/image.tab.module.js', 1, 14) =]]
```

Next, add the tab to the configuration in the same file.
Expand All @@ -29,25 +29,27 @@ Each tab definition is an object containing the following properties:
|label|string|Label text, for example, `Images`.|
|icon|string|Path to the icon, for example, `/bundles/ibexaadminuiassets/vendors/ids-assets/dist/img/all-icons.svg#info-square`.|

```js
[[= include_file('code_samples/back_office/udw/assets/js/image-tab/image.tab.module.js', 14, 29) =]]
``` js
[[= include_code('code_samples/back_office/udw/assets/js/image-tab/image.tab.module.js', 15, 28) =]]
```

The module governs the creation of the new tab.

<details class="tip">
<summary>Complete image.tab.module.js code</summary>
```js
[[= include_file('code_samples/back_office/udw/assets/js/image-tab/image.tab.module.js') =]]
``` js
[[= include_code('code_samples/back_office/udw/assets/js/image-tab/image.tab.module.js') =]]
```
</details>

## Add tab to webpack config

In `webpack.config.js`, add the following declaration:
In `webpack.config.js`, add the following declarations:

```js
const ibexaConfigManager = require('./ibexa.webpack.config.manager.js');
const ibexaConfigManager = require('@ibexa/frontend-config/webpack-config/manager');
const getIbexaConfig = require('@ibexa/frontend-config/webpack-config/ibexa');
const ibexaConfig = getIbexaConfig();
```

Next, provide configuration for the new module:
Expand All @@ -60,6 +62,12 @@ ibexaConfigManager.add({
});
```

Finally, export the module back:

```js
module.exports = [ibexaConfig, ...customConfigs, projectConfig];
```

## Provide ReactJS files

Next, you need to provide a set of files used to render the module:
Expand All @@ -72,24 +80,24 @@ Next, you need to provide a set of files used to render the module:

Create a service for fetching the images by adding `images.service.js` to `assets/js/image-tab/services/`:

```js
[[= include_file('code_samples/back_office/udw/assets/js/image-tab/services/images.service.js') =]]
``` js
[[= include_code('code_samples/back_office/udw/assets/js/image-tab/services/images.service.js') =]]
```

### `images.list.js`

Next, create an image list by adding an `images.list.js` to `assets/js/image-tab/components/`:

```js
[[= include_file('code_samples/back_office/udw/assets/js/image-tab/components/images.list.js') =]]
``` js
[[= include_code('code_samples/back_office/udw/assets/js/image-tab/components/images.list.js') =]]
```

### `image.js`

Finally, create an image view by adding an `image.js` to `assets/js/image-tab/components/`:

```js
[[= include_file('code_samples/back_office/udw/assets/js/image-tab/components/image.js') =]]
``` js
[[= include_code('code_samples/back_office/udw/assets/js/image-tab/components/image.js') =]]
```

## Add styles
Expand All @@ -98,14 +106,14 @@ Ensure that the new tab is styled by adding the following files to `assets/css/`

### `images.list.css`

```css
[[= include_file('code_samples/back_office/udw/assets/css/image.list.css') =]]
``` css
[[= include_code('code_samples/back_office/udw/assets/css/image.list.css') =]]
```

### `image.css`

```css
[[= include_file('code_samples/back_office/udw/assets/css/image.css') =]]
``` css
[[= include_code('code_samples/back_office/udw/assets/css/image.css') =]]
```

### Add CSS to webpack
Expand Down
Loading
Loading