diff --git a/app/views/spree/admin/shared/_head.html.haml b/app/views/spree/admin/shared/_head.html.haml index e783e2f07e..becc6d0309 100644 --- a/app/views/spree/admin/shared/_head.html.haml +++ b/app/views/spree/admin/shared/_head.html.haml @@ -18,6 +18,8 @@ = render "spree/admin/shared/translations" = render "spree/admin/shared/routes" += javascript_pack_tag "admin", "data-turbo-track": "reload" + %script = raw "var AUTH_TOKEN = \"#{form_authenticity_token}\";" diff --git a/app/webpacker/packs/admin.js b/app/webpacker/packs/admin.js new file mode 100644 index 0000000000..38fb32259e --- /dev/null +++ b/app/webpacker/packs/admin.js @@ -0,0 +1,6 @@ +import { Application } from "stimulus" +import { definitionsFromContext } from "stimulus/webpack-helpers" + +const application = Application.start() +const context = require.context("controllers", true, /.js$/) +application.load(definitionsFromContext(context))