Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Railsとフロントエンドリソースの健全な共存のために / A robust architec...

Sansan
December 08, 2018

Railsとフロントエンドリソースの健全な共存のために / A robust architecture of building front end resources in rails application

■イベント
Rails Developers Meetup 2018 Day 4 Nouvelle Vague
https://techplay.jp/event/702297

■登壇概要
タイトル:Railsとフロントエンドリソースの健全な共存のために
登壇者:Eight事業部 Androidエンジニア 西村 奈令大

▼Sansan Builders Box
https://buildersbox.corp-sansan.com/

Sansan

December 08, 2018
Tweet

More Decks by Sansan

Other Decks in Technology

Transcript

  1. Who am I ???  (Narihiro Nishimura) @engine_NN @nishimuraNN Sansan

     (2017.9 ~) Eight  web Android
  2. 

  3.  - Web=Eight1BSPA5: (,-1B#!'1B )-"-(9) - &,-#* <?@sprockets.;  -

      A4assets:precompile86 %+$2 >C  - Backbone → React/603SPA1B7jswebpack %+$6
  4.  " front app/assets hoge.js hoge.js fuga.css Amazon S3 index.html

    yarn run build assets precompile ! ) ! js #% ! js css  ! Rails  ' ! $((20&) !
  5. # front app/assets hoge.js hoge.js fuga.css Amazon S3 index.html yarn

    run build assets precompile " - ! js $) ! js css  ! Rails !+ ! '(,20*) ! %&!! %(&!!
  6.     3 - 3 - 3 13

    - ! 20+    20+ 10+view
  7. 

  8.  - 1 8 → bundle webpack digest 8 sprockets

    - digest 8 8 8 sprockets 8 → webpack-dev-server
  9.  (production) front app/assets hoge.js bundle.js fuga.css Amazon S3 index.html

    yarn run build assets precompile (digest) bundle.css
  10.    - digest webpack → webpack-manifest-plugin - 5

    S3 5 webpack → 5 2 5 manifest.json S3
  11. webpack-s3-plugin  yarn install yarn run build --env.release #{frontend_env} rm

    #{node_modules_dir} aws s3 cp ./front/.build s3://#{bucket_name}/assets/webpack --recursive     
  12.  front app/assets hoge.js static.js fuga.css Amazon S3 index.html yarn

    run build assets precompile static.css manifest1.json manifest2.json