From 6d0773a468a1f45e7f35ddfe44af48adeaf0ca76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Wn=C4=99trzak?= Date: Sat, 20 Feb 2021 16:54:20 +0100 Subject: [PATCH] Adjust application pack in webpacker guide This is how it looks like when generated in the new app (via Rails 6.1.3) [ci skip] --- guides/source/webpacker.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/guides/source/webpacker.md b/guides/source/webpacker.md index 63b8ca3ae7..6afeaf631c 100644 --- a/guides/source/webpacker.md +++ b/guides/source/webpacker.md @@ -98,10 +98,14 @@ So if you have a file called `app/javascript/packs/application.js`, Webpacker wi The default pack created for you by Webpacker will link to Rails default JavaScript packages if they have been included in the project: ``` -require("@rails/ujs").start() -require("turbolinks").start() -require("@rails/activestorage").start() -require("channels") +import Rails from "@rails/ujs" +import Turbolinks from "turbolinks" +import * as ActiveStorage from "@rails/activestorage" +import "channels" + +Rails.start() +Turbolinks.start() +ActiveStorage.start() ``` You'll need to include a pack that requires these packages to use them in your Rails application.