Merge pull request #16652 from vector-im/travis/customisations-docs

Improve docs for customisations
pull/16655/head
Travis Ralston 2021-03-10 07:24:13 -07:00 committed by GitHub
commit 52e54b408f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -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 2. Edit customisations points and make sure export the ones you actually want to
activate activate
3. Tweak the Element build process to use the customised module instead of the 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 ```js
new webpack.NormalModuleReplacementPlugin( new webpack.NormalModuleReplacementPlugin(
/src\/customisations\/Security.ts/, /src[\/\\]customisations[\/\\]Security\.ts/,
path.resolve(__dirname, 'src/customisations/YourNameSecurity.ts'), path.resolve(__dirname, 'src/customisations/YourNameSecurity.ts'),
), ),
``` ```

View File

@ -8,6 +8,10 @@ const webpack = require("webpack");
let og_image_url = process.env.RIOT_OG_IMAGE_URL; 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'; 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) => { module.exports = (env, argv) => {
if (process.env.CI_PACKAGE) { if (process.env.CI_PACKAGE) {
// Don't run minification for CI builds (this is only set for runs on develop) // Don't run minification for CI builds (this is only set for runs on develop)
@ -357,6 +361,8 @@ module.exports = (env, argv) => {
minify: argv.mode === 'production', minify: argv.mode === 'production',
chunks: ['usercontent'], chunks: ['usercontent'],
}), }),
...additionalPlugins,
], ],
output: { output: {