Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs for customisations #16652

Merged
merged 1 commit into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/customisations.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ the React SDK, you can still override it from the Element Web layer:
2. Edit customisations points and make sure export the ones you actually want to
activate
3. Tweak the Element build process to use the customised module instead of the
default by adding this to end of the `plugins` array in `webpack.config.js`:
default by adding this to the `additionalPlugins` array in `webpack.config.js`:

```js
new webpack.NormalModuleReplacementPlugin(
/src\/customisations\/Security.ts/,
/src[\/\\]customisations[\/\\]Security\.ts/,
path.resolve(__dirname, 'src/customisations/YourNameSecurity.ts'),
),
```
Expand Down
6 changes: 6 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ const webpack = require("webpack");
let og_image_url = process.env.RIOT_OG_IMAGE_URL;
if (!og_image_url) og_image_url = 'https://app.element.io/themes/element/img/logos/opengraph.png';

const additionalPlugins = [
// This is where you can put your customisation replacements.
];

module.exports = (env, argv) => {
if (process.env.CI_PACKAGE) {
// Don't run minification for CI builds (this is only set for runs on develop)
Expand Down Expand Up @@ -357,6 +361,8 @@ module.exports = (env, argv) => {
minify: argv.mode === 'production',
chunks: ['usercontent'],
}),

...additionalPlugins,
],

output: {
Expand Down