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
Got Action Text working by copying the actiontext scripts into a custom file, and removing the imports and exports.
And second, you will need to
require activestorage
in your application.js to make use ofDirectUpload
.application.js
actiontext.js
This still uses ES6 syntax, so if you want to support older browsers and aren't using Babel, you might want to rewrite or transpile this to ES5.