File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 105105 " dist"
106106 ],
107107 "scripts" : {
108- "setup" : " ts-gql build && tsx scripts/l10n.cts && tsx scripts/build-prism.cts " ,
108+ "setup" : " ts-gql build && tsx scripts/l10n.ts && tsx scripts/build-prism.ts " ,
109109 "build" : " pnpm run setup && next build" ,
110110 "dev" : " next dev" ,
111111 "start" : " next start"
Original file line number Diff line number Diff line change 11import fs from 'fs/promises' ;
2+ import { fileURLToPath } from 'url' ;
23
34const languages = [
45 'clike' ,
@@ -45,11 +46,18 @@ const languages = [
4546 const otherLanguages = (
4647 await Promise . all (
4748 languages . map ( lang =>
48- fs . readFile ( require . resolve ( `prismjs/components/prism-${ lang } ` ) , 'utf8' )
49+ fs . readFile (
50+ fileURLToPath (
51+ import . meta. resolve ( `prismjs/components/prism-${ lang } ` )
52+ ) ,
53+ 'utf8'
54+ )
4955 )
5056 )
5157 ) . join ( '\n\n' ) ;
52- const prism = ( await fs . readFile ( require . resolve ( 'prismjs' ) , 'utf8' ) )
58+ const prism = (
59+ await fs . readFile ( fileURLToPath ( import . meta. resolve ( 'prismjs' ) ) , 'utf8' )
60+ )
5361 . replace (
5462 `if (typeof module !== 'undefined' && module.exports) {
5563\tmodule.exports = Prism;
@@ -72,7 +80,7 @@ if (typeof global !== 'undefined') {
7280 `var _self = globalThis;`
7381 ) ;
7482 await fs . writeFile (
75- `${ __dirname } /../ src/form/fields/document/DocumentEditor/prism.js` ,
83+ `src/form/fields/document/DocumentEditor/prism.js` ,
7684 '/* eslint-disable */\nglobalThis.Prism = { manual: true };\n' +
7785 prism +
7886 '\n' +
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import fs from 'fs/promises';
22import path from 'path' ;
33import { compileString } from '@internationalized/string-compiler' ;
44
5- const localesDir = path . join ( __dirname , '../ src/app/l10n') ;
5+ const localesDir = ' src/app/l10n';
66( async ( ) => {
77 const locales : Record < string , Record < string , string > > = { } ;
88 await Promise . all (
You can’t perform that action at this time.
0 commit comments