trix icon indicating copy to clipboard operation
trix copied to clipboard

Webpacker support

Open kylefox opened this issue 7 years ago • 8 comments
trafficstars

It'd be nice to use this library with Webpacker in addition to the asset pipeline.

kylefox avatar Jul 24 '18 14:07 kylefox

how could i use it together with webpacker? I'm looking the way to implement it.

trnthanhtu avatar Aug 22 '18 08:08 trnthanhtu

@trnthanhtu Unfortunately it's currently not supported by this gem. You'll need to do it manually if you require webpacker support — or better yet, submit a pull request 😉

kylefox avatar Aug 22 '18 16:08 kylefox

by manually you mean park the assets in vendor and not use the gem?

acprsadmin avatar Jan 24 '19 13:01 acprsadmin

@acprsadmin You could manually install Trix with yarn and then include it in your app/javascript/packs/application.js or whatever. This gem mainly provides form helpers, which will work regardless of how you install Trix's JS/CSS.

kylefox avatar Jan 25 '19 04:01 kylefox

Ok i parked trix.css in app/assets/stylesheets and trix.js in app/assets/javascripts

//= require trix in application.js @import "trix"; application.scss

I disabled the gem.

i get this error... couldn't find file 'trix/banner' with type 'application/javascript'

same thing if i use straight css links in header and script link in bottom of page

any ideas. is webpacker even worth the hassle in Rails 5.2.2?

acprsadmin avatar Jan 31 '19 00:01 acprsadmin

or should it use the trix.scss and trix coffee file under basecamp/trix/assets directly rather than the /dist directory.
what is diff between trix.js and trix-core.js???

acprsadmin avatar Jan 31 '19 00:01 acprsadmin

also what is the command to install trix with yarn?

thanks

acprsadmin avatar Jan 31 '19 01:01 acprsadmin

@acprsadmin I'm not sure why you're encountering those errors. Just to clarify, if you manually added the files to app/assets/stylesheets and app/assets/javascripts as you mentioned here, then you're using the asset pipeline — not webpacker.

This issue tracker is for bugs and feature requests relating to this gem specifically. If you're running into an issue installing the gem as described in the README, please open a new issue and describe the problem in as much detail as possible.

For other issues relating to Trix (including installation), please refer to the official Trix repo or post questions to Stack Overflow.

kylefox avatar Jan 31 '19 04:01 kylefox