| 1 | // This file is automatically compiled by Webpack, along with any other files | = | 1 | // This file is automatically compiled by Webpack, along with any other files |
| 2 | // present in this directory. You're encouraged to place your actual application logic in | 2 | // present in this directory. You're encouraged to place your actual application logic in | |
| 3 | // a relevant structure within app/javascript and only use these pack files to reference | 3 | // a relevant structure within app/javascript and only use these pack files to reference | |
| 4 | // that code so it'll be compiled. | 4 | // that code so it'll be compiled. | |
| 5 | 5 | |||
| 6 | require("@rails/ujs").start() | <> | 6 | import Rails from '@rails/ujs' |
| 7 | require("@rails/activestorage").start() | 7 | import * as ActiveStorage from '@rails/activestorage' | |
| 8 | require("channels") | 8 | import 'channels' | |
| 9 | = | 9 | ||
| 10 | // Include main stylesheet | 10 | // Include main stylesheet | |
| 11 | require("../source/main.scss") | <> | 11 | import '../source/main.scss' |
| 12 | = | 12 | ||
| 13 | // Include main file | 13 | // Include main file | |
| 14 | require("../source/main") | <> | 14 | import '../source/main' |
| 15 | = | 15 | ||
| -+ | 16 | // Initialize ActiveStorage | ||
| 17 | ActiveStorage.start() | |||
| 18 | ||||
| 16 | // Uncomment to copy all static images under ../images to the output folder and reference | = | 19 | // Uncomment to copy all static images under ../images to the output folder and reference |
| 17 | // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) | 20 | // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) | |
| 18 | // or the `imagePath` JavaScript helper below. | 21 | // or the `imagePath` JavaScript helper below. | |
| 19 | // | 22 | // | |
| 20 | // const images = require.context('../images', true) | 23 | // const images = require.context('../images', true) | |
| 21 | // const imagePath = (name) => images(name, true) | 24 | // const imagePath = (name) => images(name, true) |