File tree 5 files changed +39
-8
lines changed
5 files changed +39
-8
lines changed Original file line number Diff line number Diff line change 1
- ASSET_HOST = localhost:3000
1
+ ASSET_HOST = localhost:8080
2
2
APPLICATION_HOST = localhost:3000
3
3
PORT = 3000
4
4
SECRET_KEY_BASE = development_secret
5
5
SMTP_ADDRESS = smtp.example.com
6
6
SMTP_DOMAIN = example.com
7
7
SMTP_PASSWORD = password
8
8
SMTP_USERNAME = username
9
+ DEV_SERVER_URL = http://locahost:8080
10
+ NODE_ENV = development
9
11
Original file line number Diff line number Diff line change 1
1
<!DOCTYPE html>
2
2
< html >
3
3
< head >
4
- < title > App </ title >
4
+ < title > <%= yield :title %> </ title >
5
5
<%= csrf_meta_tags %>
6
6
7
- <%= stylesheet_link_tag 'application' , media : 'all' , 'data-turbolinks-track' : 'reload' %>
8
- <%= javascript_include_tag 'application' , 'data-turbolinks-track' : 'reload' %>
7
+ <%= stylesheet_link_tag 'application' , media : 'all' %>
9
8
</ head >
10
9
11
10
< body >
12
11
<%= yield %>
12
+ <%= javascript_include_tag 'application' %>
13
+ <%= javascript_pack_tag 'application' %>
13
14
</ body >
14
15
</ html >
Original file line number Diff line number Diff line change @@ -5,14 +5,18 @@ const { env } = require('process')
5
5
const { safeLoad } = require ( 'js-yaml' )
6
6
const { readFileSync } = require ( 'fs' )
7
7
8
+ const defaultPaths = require ( './paths' ) ;
9
+
8
10
const configPath = resolve ( 'config' , 'webpack' )
9
11
const loadersDir = join ( __dirname , 'loaders' )
10
- const paths = safeLoad ( readFileSync ( join ( configPath , 'paths.yml' ) , 'utf8' ) ) [ env . NODE_ENV ]
12
+ const customPaths = safeLoad ( readFileSync ( join ( configPath , 'paths.yml' ) , 'utf8' ) ) [ env . NODE_ENV ]
13
+ const paths = customPaths ? customPaths : defaultPaths
11
14
const devServer = safeLoad ( readFileSync ( join ( configPath , 'development.server.yml' ) , 'utf8' ) ) [ env . NODE_ENV ]
12
15
13
16
// Compute public path based on environment and ASSET_HOST in production
14
17
const ifHasCDN = env . ASSET_HOST !== undefined && env . NODE_ENV === 'production'
15
- const devServerUrl = `http://${ devServer . host } :${ devServer . port } /${ paths . entry } /`
18
+ const defaultServerUrl = devServer ? `http://${ devServer . host } :${ devServer . port } ` : env . DEV_SERVER_URL
19
+ const devServerUrl = `${ defaultServerUrl } /${ paths . entry } /`
16
20
const publicUrl = ifHasCDN ? `${ env . ASSET_HOST } /${ paths . entry } /` : `/${ paths . entry } /`
17
21
const publicPath = env . NODE_ENV !== 'production' ? devServerUrl : publicUrl
18
22
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ config : 'config/webpack' ,
3
+ entry : 'packs' ,
4
+ output : 'public' ,
5
+ manifest : 'manifest.json' ,
6
+ node_modules : 'node_modules' ,
7
+ source : 'app/javascript' ,
8
+ extensions :
9
+ [
10
+ '.coffee' ,
11
+ '.js' ,
12
+ '.jsx' ,
13
+ '.sass' ,
14
+ '.scss' ,
15
+ '.css' ,
16
+ '.png' ,
17
+ '.svg' ,
18
+ '.gif' ,
19
+ '.jpeg' ,
20
+ '.jpg'
21
+ ]
22
+ }
Original file line number Diff line number Diff line change @@ -26,11 +26,13 @@ services:
26
26
27
27
webpack :
28
28
image : jmfirth/webpack
29
- command : webpack-dev-server --hot --inline --progress --host 0.0.0.0 --config config/webpack.config .js
29
+ command : webpack-dev-server --hot --inline --progress --color -- host 0.0.0.0 --config config/webpack/development .js
30
30
ports :
31
- - ' 3808:3808 '
31
+ - ' 8080:8080 '
32
32
volumes :
33
33
- .:/app
34
+ env_file :
35
+ - .env
34
36
35
37
volumes :
36
38
bundle_path :
You can’t perform that action at this time.
0 commit comments