I try to implement ActionTest with old way asset pipeline (without Webpack) on rails 6
Almost all is good, except loading of @rails/actiontext
in my application.js I've
//= require trix
//= require @rails/actiontext
The riche editor appear, I can change bold/italic text, but can't add image (not uploaded)
I've an JS error : Uncaught SyntaxError: Cannot use import statement outside a module
on line : import { AttachmentUpload } from "./attachment_upload" from attachment_uplaod.js in actiontext.
Any way to achieve this without webpack?
thanks
I don't know what will be the official way, but I did it this way as I'm waiting for an updated install generator:
Prerequisites
CSS
JS Libraries
app/assets/javascripts/librariescreate these two filesImport through Stimulus
app/assets/javascripts/controllerscreate this filedata-controller="trix"to the relevant divhttps://github.com/rails/rails/issues/41221#issuecomment-871853505