Installing Summernote in Rails 7 with NPM and Esbuild

63 Views Asked by At

In my new Rails 7 project I want to install the summernote editor: https://summernote.org/getting-started/#without-bootstrap-lite

So I did:

yarn add summernote

In my application.js:

import 'summernote/dist/summernote-lite.min';

An in my application.scss:

@import 'summernote/dist/summernote-lite';

This works, but the editor is loaded without the icons:

enter image description here

In the summernote-lite.css file I have:

src: url("./font/summernote.eot?#iefix") format("embedded-opentype"), url("./font/summernote.woff2") format("woff2"), url("./font/summernote.woff") format("woff"), url("./font/summernote.ttf") format("truetype");

Relative to the summernote-lite.css file these files exists but relative to the application.scss file they do not exists.

How can I make sure the icons are shown correctly? Of course, I could put them in the public folder but that does not seem to be the correct way.

0

There are 0 best solutions below