Lazily load trix
This commit is contained in:
parent
95eb907090
commit
d8852c7dc5
4 changed files with 12 additions and 2 deletions
6
app/javascript/components/Trix.js
Normal file
6
app/javascript/components/Trix.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
import 'trix';
|
||||
import '@rails/actiontext';
|
||||
|
||||
export default function () {
|
||||
return null;
|
||||
}
|
3
app/javascript/loaders/Trix.js
Normal file
3
app/javascript/loaders/Trix.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
import Loadable from '../components/Loadable';
|
||||
|
||||
export default Loadable(() => import('../components/Trix'));
|
|
@ -1,8 +1,6 @@
|
|||
import '../shared/polyfills';
|
||||
import Rails from '@rails/ujs';
|
||||
import * as ActiveStorage from '@rails/activestorage';
|
||||
import 'trix';
|
||||
import '@rails/actiontext';
|
||||
import 'whatwg-fetch'; // window.fetch polyfill
|
||||
import ReactRailsUJS from 'react_ujs';
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
-# Load Trix lazily, by using our React lazy-loader.
|
||||
-# (Trix itself doesn't use React though)
|
||||
= react_component('Trix')
|
||||
|
||||
= f.label :subject do
|
||||
Objet de l'email
|
||||
|
|
Loading…
Reference in a new issue