Skip to content

Commit 4a864aa

Browse files
authored
Define jQuery object in separate file to support esbuild (#3571)
* Import jQuery in separate file to avoid hoisted variables * Add blank line for consistency * Split lines for assignment * Make option_name mutable to overcome frozen_string_literal * Return to one-liner init * Remove unary operator
1 parent 6d2eece commit 4a864aa

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/rails_admin/base.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Rails from "@rails/ujs";
22
import "@hotwired/turbo-rails";
3-
import jQuery from "jquery";
3+
import "./jquery";
44
import "./vendor/jquery_nested_form";
55
import "bootstrap";
66

@@ -27,4 +27,3 @@ import "./ui";
2727
import "./widgets";
2828

2929
Rails.start();
30-
window.$ = window.jQuery = jQuery;

src/rails_admin/jquery.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import jQuery from "jquery";
2+
3+
window.$ = window.jQuery = jQuery;

0 commit comments

Comments
 (0)