mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-30 02:32:29 +00:00
chore: Improve widget loading performance (#1191)
* Frontend assets url * Remove font files from widget * Rename variable to ASSET_CDN_HOST
This commit is contained in:
@@ -4,6 +4,9 @@ SECRET_KEY_BASE=replace_with_lengthy_secure_hex
|
||||
# Replace with the URL you are planning to use for your app
|
||||
FRONTEND_URL=http://0.0.0.0:3000
|
||||
|
||||
# If you plan to use CDN for your assets, set Asset CDN Host
|
||||
ASSET_CDN_HOST=
|
||||
|
||||
# Force all access to the app over SSL, default is set to false
|
||||
FORCE_SSL=false
|
||||
|
||||
@@ -103,7 +106,7 @@ IOS_APP_ID=6C953F3RX2.com.chatwoot.app
|
||||
# VAPID_PUBLIC_KEY=
|
||||
# VAPID_PRIVATE_KEY=
|
||||
#
|
||||
# for mobile apps
|
||||
# for mobile apps
|
||||
# FCM_SERVER_KEY=
|
||||
|
||||
## Bot Customizations
|
||||
|
||||
8
app/javascript/shared/assets/fonts/widget_fonts.scss
Normal file
8
app/javascript/shared/assets/fonts/widget_fonts.scss
Normal file
@@ -0,0 +1,8 @@
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('~shared/assets/fonts/Inter-Regular.woff2?v=3.11') format('woff2'),
|
||||
url('~shared/assets/fonts/Inter-Regular.woff?v=3.11') format('woff');
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
@import 'buttons';
|
||||
@import 'mixins';
|
||||
@import 'forms';
|
||||
@import 'shared/assets/fonts/inter';
|
||||
@import 'shared/assets/fonts/widget_fonts';
|
||||
@import '~ionicons/scss/ionicons';
|
||||
@import '~spinkit/scss/spinners/7-three-bounce';
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ Rails.application.configure do
|
||||
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
||||
|
||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||
# config.action_controller.asset_host = 'http://assets.example.com'
|
||||
|
||||
config.action_controller.asset_host = ENV.fetch('ASSET_CDN_HOST') if ENV['ASSET_CDN_HOST'].present?
|
||||
# Specifies the header that your server uses for sending files.
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
||||
|
||||
Reference in New Issue
Block a user