Skip to content

Commit f269407

Browse files
annschmfranzke
andauthored
docs: update docs for create-react-app (#111)
* Update getStarted.adoc * Update migrationGuide.adoc * chore: added create react app example section * Update getStarted.adoc * Update getStarted.adoc * Update getStarted.adoc Co-authored-by: Maximilian Franzke <[email protected]>
1 parent 1a9d890 commit f269407

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

docs/getStarted.adoc

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ This should add a new entry to your `package.json` file:
5858
@import "@db-ui/core/sources/css/enterprise/db-ui-core";
5959
----
6060

61-
### SCSS: `node_modules include path / load path
61+
### SCSS: node_modules include path / load path
6262

6363
Please keep in mind, that you would need to set your `include path` also known as `load path` depending on your setup for the sass compiler to find the correct `node_modules` folder, e.g. like the following (this is similar to how other frameworks and libraries like link:https://github.com/twbs/bootstrap-npm-starter/blob/main/package.json#L18[Bootstrap] are handling this):
6464

@@ -172,6 +172,24 @@ If you want to use the compiled CSS directly, you can refence the css files in y
172172
<link rel="stylesheet" href="css/enterprise/db-ui-core.css" type="text/css">
173173
----
174174

175+
## Example 2: how to use DB UI Core in Create React app
176+
177+
Create React App offers only limited access to the configuration of the production build. While it uses webpack under the hood, the webpack configuration is not exposed to the user.
178+
To manage your CRA to work with SASS include Path you have to update or create your _.env_ file:
179+
180+
----
181+
SASS_PATH=node_modules
182+
----
183+
184+
In addition to get the asset paths working you have to load them separately. Further description is written above within the section _webpack based bundlers_.
185+
186+
[source,scss]
187+
----
188+
@import "@db-ui/core/sources/css/webpack.assets-paths";
189+
@import "@db-ui/core/sources/css/enterprise/db-ui-core";
190+
----
191+
192+
175193
## Documentation
176194

177195
Please find our Architectural Decision Records within the link:adr/[adr subfolder].

0 commit comments

Comments
 (0)