@@ -60,6 +60,15 @@ module.exports = function(config, options) {
60
60
// wait for app to mount in order to get mountpath
61
61
app . on ( 'mount' , function ( ) {
62
62
const mountPath = getMount ( app . mountpath ) ;
63
+ let dashboardUrl = '' ;
64
+ let loginUrl = '' ;
65
+
66
+ // Reads files from public/bundles folder, looking for dashboard.<hash>.js and login.<hash>.js
67
+ fs . readdir ( path . join ( __dirname , 'public' , 'bundles' ) , function ( err , items ) {
68
+ dashboardUrl = items . filter ( file => file . indexOf ( 'dashboard.' ) === 0 ) [ 0 ] || 'dashboard.bundle.js' ;
69
+ loginUrl = items . filter ( file => file . indexOf ( 'login.' ) === 0 ) [ 0 ] || 'login.bundle.js' ;
70
+ } ) ;
71
+
63
72
const users = config . users ;
64
73
const useEncryptedPasswords = config . useEncryptedPasswords ? true : false ;
65
74
const authInstance = new Authentication ( users , useEncryptedPasswords , mountPath ) ;
@@ -180,7 +189,6 @@ module.exports = function(config, options) {
180
189
res . send ( `<!DOCTYPE html>
181
190
<head>
182
191
<link rel="shortcut icon" type="image/x-icon" href="${ mountPath } favicon.ico" />
183
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
184
192
<base href="${ mountPath } "/>
185
193
<script>
186
194
PARSE_DASHBOARD_PATH = "${ mountPath } ";
@@ -192,7 +200,7 @@ module.exports = function(config, options) {
192
200
<div id="login_mount"></div>
193
201
${ errors }
194
202
<script id="csrf" type="application/json">"${ req . csrfToken ( ) } "</script>
195
- <script src="${ mountPath } bundles/login.bundle.js "></script>
203
+ <script src="${ mountPath } bundles/${ loginUrl } "></script>
196
204
</body>
197
205
</html>
198
206
` ) ;
@@ -206,7 +214,6 @@ module.exports = function(config, options) {
206
214
res . send ( `<!DOCTYPE html>
207
215
<head>
208
216
<link rel="shortcut icon" type="image/x-icon" href="${ mountPath } favicon.ico" />
209
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
210
217
<base href="${ mountPath } "/>
211
218
<script>
212
219
PARSE_DASHBOARD_PATH = "${ mountPath } ";
@@ -216,7 +223,7 @@ module.exports = function(config, options) {
216
223
<title>Parse Dashboard</title>
217
224
<body>
218
225
<div id="browser_mount"></div>
219
- <script src="${ mountPath } bundles/dashboard.bundle.js "></script>
226
+ <script src="${ mountPath } bundles/${ dashboardUrl } "></script>
220
227
<script src="https://static.back4app.com/back4app-navigation.bundle.js"></script>
221
228
</body>
222
229
</html>
0 commit comments