diff --git a/app/javascript/blacklight/bookmark_toggle.js b/app/javascript/blacklight/bookmark_toggle.js index 7303d730f5..52302712f1 100644 --- a/app/javascript/blacklight/bookmark_toggle.js +++ b/app/javascript/blacklight/bookmark_toggle.js @@ -1,4 +1,4 @@ -import CheckboxSubmit from 'blacklight/checkbox_submit' +import CheckboxSubmit from './checkbox_submit.js' const BookmarkToggle = (e) => { if (e.target.matches('[data-checkboxsubmit-target="checkbox"]')) { diff --git a/app/javascript/blacklight/index.js b/app/javascript/blacklight/index.js index 0fe8e22724..9d30f8f914 100644 --- a/app/javascript/blacklight/index.js +++ b/app/javascript/blacklight/index.js @@ -1,8 +1,13 @@ -import BookmarkToggle from 'blacklight/bookmark_toggle' -import ButtonFocus from 'blacklight/button_focus' -import Modal from 'blacklight/modal' -import SearchContext from 'blacklight/search_context' -import Core from 'blacklight/core' +// ALL imports in this dir, including in files imported, should be RELATIVE +// paths to keep things working in the various ways these files get used, at +// both compile time and npm package run time. + +import BookmarkToggle from './bookmark_toggle.js' +import ButtonFocus from './button_focus.js' +import Modal from './modal.js' +import SearchContext from './search_context.js' +import Core from './core.js' + export default { BookmarkToggle, diff --git a/app/javascript/blacklight/modal.js b/app/javascript/blacklight/modal.js index f1b74c4575..2ad7445397 100644 --- a/app/javascript/blacklight/modal.js +++ b/app/javascript/blacklight/modal.js @@ -52,7 +52,7 @@ can be a turbo-stream that defines some HTML fragementsand where on the page to put them: https://turbo.hotwired.dev/handbook/streams */ -import ModalForm from 'blacklight/modalForm' +import ModalForm from './modalForm.js' const Modal = (() => { const modal = {}