Introduce common JavaScript file (#2981)
* Create common chunk rather than vendor chunk vendor chunk is a set of modules provided by external vendors, but now we can have a chunk as a set of modules shared by multiple entry points, which could be more efficent than having vendor chunk. * Start rails-ujs in common.js This is used by /settings/two_factor_authentication.
This commit is contained in:
parent
6ee3a10f17
commit
85c9496340
5 changed files with 5 additions and 10 deletions
2
app/javascript/packs/common.js
Normal file
2
app/javascript/packs/common.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
import { start } from 'rails-ujs';
|
||||
start();
|
|
@ -3,12 +3,9 @@ import { length } from 'stringz';
|
|||
import { default as dateFormat } from 'date-fns/format';
|
||||
import distanceInWordsStrict from 'date-fns/distance_in_words_strict';
|
||||
import { delegate } from 'rails-ujs';
|
||||
import Rails from 'rails-ujs';
|
||||
|
||||
require.context('../images/', true);
|
||||
|
||||
Rails.start();
|
||||
|
||||
const parseFormat = (format) => format.replace(/%(\w)/g, (_, modifier) => {
|
||||
switch (modifier) {
|
||||
case '%':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue