State of managing the assets in new Rails world

1b0973b64704738dbc8ce24d8382bb1f?s=47 Prathamesh
February 07, 2020

State of managing the assets in new Rails world

Presentation given at RubyFuza 2020

You can find more resources about the talk here - https://prathamesh.tech/webpacker-on-rails/

1b0973b64704738dbc8ce24d8382bb1f?s=128

Prathamesh

February 07, 2020
Tweet

Transcript

  1. 3.
  2. 11.

    A Ruby conference without JavaScript is not a Ruby Conference

    Prathamesh Sonpatki 07/02/2020 @_cha1tanya prathamesh.tech
  3. 43.

    modules: [ "node_modules", path.resolve(__dirname, "app") ], // directories where to

    look for modules extensions: [".js", ".json", ".jsx", ".css"], // extensions that are used alias: { // a list of module name aliases "module": "new-module", // alias "module" -> "new-module" and "module/path/file" -> "new-module/ file" "only-module$": "new-module", // alias "only-module" -> "new-module", but not "only-module/path/file" "new-module/path/file" "module": path.resolve(__dirname, "app/third/module.js"), // alias "module" -> "./app/third/module.js" and "module/file" results i // modules aliases are imported relative to the current context }, /* Alternative alias syntax (click to show) */ /* Advanced resolve configuration (click to show) */ }, @_cha1tanya prathamesh.tech
  4. 50.

    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
  5. 51.

    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 > postcss-color-functional-notat postcss-values-parser > flatten@1.0.2: I wrote this module a very long time ag 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/actioncable@6.0.0-alpha ├─ @rails/activestorage@6.0.0-alpha ├─ @rails/ujs@6.0.0-alpha ├─ @rails/webpacker@4.0.7 └─ turbolinks@5.2.0 @_cha1tanya prathamesh.tech