diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2021-12-27 17:20:42 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-12-28 20:02:47 +0000 |
commit | 0bffaef9955651d160502c5df77c8f4a859778b9 (patch) | |
tree | 311a9b669f86806d0b01e61b4ae59f7699d3a1b4 /server/sonar-docs/src/pages | |
parent | a9ebb3dd0e2a3188e675757005372ae823f3d23c (diff) | |
download | sonarqube-0bffaef9955651d160502c5df77c8f4a859778b9.tar.gz sonarqube-0bffaef9955651d160502c5df77c8f4a859778b9.zip |
SONAR-15861 Allow extensions to ship with a CSS file
Diffstat (limited to 'server/sonar-docs/src/pages')
-rw-r--r-- | server/sonar-docs/src/pages/extend/extend-web-app.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/sonar-docs/src/pages/extend/extend-web-app.md b/server/sonar-docs/src/pages/extend/extend-web-app.md index aa090059f3f..28a301ca54d 100644 --- a/server/sonar-docs/src/pages/extend/extend-web-app.md +++ b/server/sonar-docs/src/pages/extend/extend-web-app.md @@ -103,6 +103,10 @@ The `options` object will contain the following: [[info]] | SonarQube doesn't guarantee any JavaScript library availability at runtime (except React). If you need a library, include it in the final file. +### CSS files + +If you want a static CSS file to be loaded when your extension is bootstrapped, rather than using run-time inclusion of styles, you can pass `true` as a third parameter to the `window.registerExtension()` function. This will trigger the loading of a CSS file that *must* have the same basename as the registering JS file. I.e., if your extension JS file is `/static/global_page.js`, the CSS file must be called `/static/global_page.css`. The bootstrap will wait for the CSS file to be fully loaded before calling the *start* callback. + ## Examples It is highly recommended you check out [sonar-custom-plugin-example](https://github.com/SonarSource/sonar-custom-plugin-example/tree/7.x/). It contains detailed examples using several front-end frameworks, and its code is thoroughly documented. It also describes how to run a local development server to speed up the front-end development, without requiring a full rebuild and re-deploy to test your changes. |