How to use Action Text without webpack?

Is it possible to use Action Text without Webpack (e.g. with Sprockets) and if so, how?

I am trying to figure out if I can get rid of Webpack to avoid its build complexity and dependencies.

It seems that trix.js and trix.css can simply be downloaded to the vendor folder and included from Sprockets’ manifest.js using //= require trix. However I don’t find equivalent distributed files for Action Text.

Edit: It seems Action Text’s Javascript can be directly referenced from Skypack:

1 Like

In case anyone is interested, here’s how I added trix / actiontext without webpacker. I couldn’t get it to work with Sprockets so I had to find another way. Directly referencing it from Skypack.dev seems to work quite well for now.

I’ve added the following in my application.html.erb:

<link rel="stylesheet" href="https://cdn.skypack.dev/trix/dist/trix.css">
<script type="module">
        import railsActiontext from 'https://cdn.skypack.dev/@rails/actiontext';
        import trix from 'https://cdn.skypack.dev/trix';
</script>

@miczed since I wrote the OP a year ago, I’ve switched to jsbundling-rails, which i’m happy with. Before that I did manage to use ActionText directly with importmaps as well. As for the CSS, I reference it from the head as you do.