38
loading...
This website collects cookies to deliver better user experience
config/webpacker/
— the directory where the JavaScript configuration files for particular environments are created.config/webpacker.yml
— the main configuration file that contains the default configuration and configs for specific environments.bin/webpack
— executable file that invokes webpack to create bundles.bin/webpack-dev-server
— executable file that starts the development server, which reloads webpack every time you make a change inside the JavaScript files included in the bundleIf you would like to have good understanding of rails 6 application structure check out this article.
// app/javascript/packs/application.js
import Rails from "@rails/ujs"
import Turbolinks from "turbolinks"
import * as ActiveStorage from "@rails/activestorage"
import "channels"
Rails.start()
Turbolinks.start()
ActiveStorage.start()
# config/webpacker.yml
source_entry_path: packs
rails server
command,bin/webpack-dev-server
so we just run the webpack-dev-server
separately for this purpose and then we can see live reloading and hot module replacement in action.javascript_pack_tag