@@ -35,7 +35,13 @@ function ckeditorTranslations() {
3535
3636 // Determine available languages from the first directory.
3737 const languages = ( await readdir ( translationDirs [ 0 ] ) )
38- . filter ( ( f ) => f . endsWith ( ".js" ) && ! f . endsWith ( ".umd.js" ) && ! f . endsWith ( ".d.ts" ) && f !== "en.js" )
38+ . filter (
39+ ( f ) =>
40+ f . endsWith ( ".js" ) &&
41+ ! f . endsWith ( ".umd.js" ) &&
42+ ! f . endsWith ( ".d.ts" ) &&
43+ f !== "en.js" ,
44+ )
3945 . map ( ( f ) => f . replace ( ".js" , "" ) ) ;
4046
4147 await mkdir ( targetDir , { recursive : true } ) ;
@@ -57,13 +63,17 @@ function ckeditorTranslations() {
5763
5864 // Extract the dictionary entries from:
5965 // export default {"lang":{"dictionary":{...},getPluralForm(n){...} }}
60- const dictMatch = source . match ( / " d i c t i o n a r y " : \{ ( .+ ?) \} , g e t P l u r a l F o r m / ) ;
66+ const dictMatch = source . match (
67+ / " d i c t i o n a r y " : \{ ( .+ ?) \} , g e t P l u r a l F o r m / ,
68+ ) ;
6169 if ( dictMatch ) {
6270 dictionaries . push ( dictMatch [ 1 ] ) ;
6371 }
6472
6573 if ( getPluralForm === null ) {
66- const pluralMatch = source . match ( / g e t P l u r a l F o r m ( \( [ ^ ) ] * \) \{ .+ ?\} ) / ) ;
74+ const pluralMatch = source . match (
75+ / g e t P l u r a l F o r m ( \( [ ^ ) ] * \) \{ .+ ?\} ) / ,
76+ ) ;
6777 if ( pluralMatch ) {
6878 getPluralForm = pluralMatch [ 1 ] ;
6979 }
@@ -93,5 +103,8 @@ export default defineConfig({
93103 name : "ckeditor5" ,
94104 } ,
95105 } ,
106+ define : {
107+ define : "undefined" ,
108+ } ,
96109 plugins : [ ckeditorTranslations ( ) ] ,
97110} ) ;
0 commit comments