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

State of managing assets in new Rails world

State of managing assets in new Rails world

Prathamesh Sonpatki

September 29, 2019
Tweet

More Decks by Prathamesh Sonpatki

Other Decks in Programming

Transcript

  1. !

  2. // version.js module.exports = { version: ‘1.0’ } // application.js

    var config = require(‘./version.js’) console.log(config.version) @_cha1tanya prathamesh.tech
  3. rails webpacker:install create config/webpacker.yml Copying webpack core config create config/webpack

    create config/webpack/development.js create config/webpack/environment.js create config/webpack/production.js create config/webpack/test.js @_cha1tanya prathamesh.tech
  4. yarn add v1.17.3 info No lockfile found. [1/4] Resolving packages...

    ⠁ @rails/actioncable@^6.0.0-alpha warning @rails/webpacker > postcss-preset-env > postcs color-functional-notation > postcss-values-parser > [email protected]: I wrote this module a very long time ag you should use something else. [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. success Saved 602 new dependencies. info Direct dependencies ├─ @rails/[email protected] ├─ @rails/[email protected] ├─ @rails/[email protected] ├─ @rails/[email protected] └─ [email protected] @_cha1tanya prathamesh.tech
  5. ▶ ./bin/webpack-dev-server ℹ 「wds」: Project is running at http://localhost:3035/ ℹ

    「wds」: webpack output is served from /packs/ ℹ 「wds」: Content not from webpack is served from /Users/prathamesh/ Projects/scratch/blog/public/packs ℹ 「wds」: 404s will fallback to /index.html ℹ 「wdm」: Hash: f8c6a1b1755dc32681d6 Version: webpack 4.36.1 Time: 3240ms Built at: 07/23/2019 3:13:42 PM Asset Size Chunks Chunk Names js/application-2d8c7ac24fdd30370b2e.js 504 KiB application [emitted] application js/application-2d8c7ac24fdd30370b2e.js.map 568 KiB application [emitted] application manifest.json 364 bytes [emitted] ℹ 「wdm」: Compiled successfully. @_cha1tanya prathamesh.tech