Use Hunspell for client-side spellchecking (#20286)

GitOrigin-RevId: c4d0d9e06fe0cc9d7cb7a058fd0768eb024e44f5
This commit is contained in:
Alf Eaton
2024-10-14 10:58:36 +00:00
committed by Copybot
parent 2d737810d4
commit 24c8629cd4
40 changed files with 5391 additions and 514 deletions
+26
View File
@@ -66,6 +66,7 @@ function getModuleDirectory(moduleName) {
}
const mathjaxDir = getModuleDirectory('mathjax')
const dictionariesDir = getModuleDirectory('@overleaf/dictionaries')
const pdfjsVersions = ['pdfjs-dist213', 'pdfjs-dist401']
@@ -78,6 +79,14 @@ if (MATHJAX_VERSION !== PackageVersions.version.mathjax) {
)
}
const DICTIONARIES_VERSION =
require('@overleaf/dictionaries/package.json').version
if (DICTIONARIES_VERSION !== PackageVersions.version.dictionaries) {
throw new Error(
'"@overleaf/dictionaries" version de-synced, update services/web/app/src/infrastructure/PackageVersions.js'
)
}
module.exports = {
// Defines the "entry point(s)" for the application - i.e. the file which
// bootstraps the application
@@ -141,6 +150,13 @@ module.exports = {
],
type: 'javascript/auto',
},
{
test: /\.wasm$/,
type: 'asset/resource',
generator: {
filename: 'js/[name]-[contenthash][ext]',
},
},
{
// Pass Less files through less-loader/css-loader/mini-css-extract-
// plugin (note: run in reverse order)
@@ -275,6 +291,10 @@ module.exports = {
},
},
experiments: {
asyncWebAssembly: true,
},
plugins: [
new LezerGrammarCompilerPlugin(),
@@ -346,6 +366,12 @@ module.exports = {
toType: 'dir',
context: mathjaxDir,
},
{
from: '*',
to: `js/dictionaries/${PackageVersions.version.dictionaries}`,
toType: 'dir',
context: `${dictionariesDir}/dictionaries`,
},
...pdfjsVersions.flatMap(version => {
const dir = getModuleDirectory(version)