chore: reduce package size

This commit is contained in:
josc146
2023-03-29 14:26:22 +08:00
parent 25ed2cc7c7
commit 566f9e9838
5 changed files with 15 additions and 5 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ async function runWebpack(isWithoutKatex, isWithoutTiktoken, callback) {
'i18next',
'react-i18next',
'./src/utils',
'./src/_locales/i18n',
'./src/_locales/i18n-react',
],
},
output: {
+11
View File
@@ -0,0 +1,11 @@
import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'
import { resources } from './resources'
i18n.use(initReactI18next).init({
resources,
fallbackLng: 'en',
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},
})
+1 -2
View File
@@ -1,8 +1,7 @@
import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'
import { resources } from './resources'
i18n.use(initReactI18next).init({
i18n.init({
resources,
fallbackLng: 'en',
interpolation: {
+1 -1
View File
@@ -22,7 +22,7 @@ import {
import FloatingToolbar from '../components/FloatingToolbar'
import Browser from 'webextension-polyfill'
import { getPreferredLanguage } from '../config/language.mjs'
import '../_locales/i18n'
import '../_locales/i18n-react'
import { changeLanguage } from 'i18next'
/**
+1 -1
View File
@@ -1,5 +1,5 @@
import { render } from 'preact'
import Popup from './Popup'
import '../_locales/i18n'
import '../_locales/i18n-react'
render(<Popup />, document.getElementById('app'))