@@ -21,18 +21,18 @@ function formatPublicPath(settings) {
21
21
const host = settings . dev_server . host ;
22
22
const port = settings . dev_server . port ;
23
23
const path = settings . public_output_path ;
24
- const hostWithHttp = `http://${ host } :${ port } `
24
+ const hostWithHttp = `http://${ host } :${ port } ` ;
25
25
26
26
let formattedHost = removeOuterSlashes ( hostWithHttp ) ;
27
27
if ( formattedHost && ! / ^ h t t p / i. test ( formattedHost ) ) {
28
28
formattedHost = `//${ formattedHost } ` ;
29
29
}
30
30
const formattedPath = removeOuterSlashes ( path ) ;
31
31
return `${ formattedHost } /${ formattedPath } /` ;
32
- } else {
33
- const formattedPath = removeOuterSlashes ( settings . public_output_path ) ;
34
- return `//${ formattedPath } /` ;
35
32
}
33
+
34
+ const publicOuterPathWithoutOutsideSlashes = removeOuterSlashes ( settings . public_output_path ) ;
35
+ return `//${ publicOuterPathWithoutOutsideSlashes } /` ;
36
36
}
37
37
38
38
/**
@@ -48,7 +48,7 @@ function formatPublicPath(settings) {
48
48
*/
49
49
const configLoader = ( configPath ) => {
50
50
// Some test environments might not have the NODE_ENV set, so we'll have fallbacks.
51
- const configEnv = ( process . env . NODE_ENV || process . env . RAILS_ENV || 'development' ) ;
51
+ const configEnv = ( env . NODE_ENV || env . RAILS_ENV || 'development' ) ;
52
52
const ymlConfigPath = join ( configPath , 'webpacker.yml' ) ;
53
53
const settings = safeLoad ( readFileSync ( ymlConfigPath , 'utf8' ) ) [ configEnv ] ;
54
54
0 commit comments