You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+25-4Lines changed: 25 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,9 +69,9 @@ Examples are written in Markdown where any code blocks will be rendered as a rea
69
69
70
70
## How it works
71
71
72
-
SourceJS plugins are loaded together with main applications, adding additional initialization steps or changing rendering flow using middleware integration. With this plugin, in development mode, SourceJS in enhanced with webpack middleware, that builds all the React examples on demand and listens to file changes for hot-reloading.
72
+
SourceJS plugins are loaded together with main application, adding additional initialization steps or changing rendering flow using middleware integration. With this plugin, in development mode, SourceJS in enhanced with webpack middleware, that builds all the React examples on demand and listens to file changes for hot-reloading.
73
73
74
-
Running app with `NODE_ENV=production`, webpack will be triggered only once to build a static, minified version, which is done also on app start.
74
+
In production mode webpack is not triggered, expecting that bundle is already built (read configuration section for more).
75
75
76
76
Rendering flow with this plugins looks like this:
77
77
@@ -86,6 +86,14 @@ Rendering flow with this plugins looks like this:
86
86
87
87
Use SourceJS `options.js` for deep plugin configuration.
88
88
89
+
***`enabled`**
90
+
Type: `Boolean`
91
+
Set to `false`, if wan't to disable plugin load with SourceJS app.
92
+
93
+
***`preBuild`**
94
+
Type: `Boolean`
95
+
Set to `true`, if you wan't to automatically build webpack bundle in production mode right after app starts.
96
+
89
97
***`rootDir`**
90
98
Type: `String`, required
91
99
Your components sources root folder (eg. `./lib`). Should not point to a folder with the `node_modules` folder.
@@ -140,12 +148,25 @@ Use SourceJS `options.js` for deep plugin configuration.
140
148
}
141
149
```
142
150
151
+
### Environment settings
152
+
153
+
Running app with `NODE_ENV=production`, initial webpack build won't be triggered. To properly prepare production environment, first run react-styleguidist build command, and only after that run application:
Note: this command should be ran from SourceJS root folder, where `node_modules` is placed.
161
+
162
+
Alternatively, you can set `preBuild` to true in plugin configuration, to build webpack bundle once app is ran in production mode. This will require less build steps, but may cause higher load in production environment container.
163
+
143
164
## Contributing
144
165
145
-
Everyone is welcome to contribute. Please take a moment to review the [contributing guidelines](Contributing.md).
166
+
Everyone is welcome to contribute. Please take a moment to review the [contributing guidelines](contributing.md).
146
167
147
168
---
148
169
149
170
## License
150
171
151
-
The MIT License, see the included [License.md](License.md) file.
172
+
The MIT License, see the included [license.md](license.md) file.
0 commit comments