You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Hyphenopoly requires an explicit loader / loaderSync function in Node and other non-browser JS runtimes, it would be great if these functions received Hyphenopoly’s module URL as a second argument, to make it easier to locate the patterns folder.
For example, percollate, which uses Hyphenopoly for hyphenation, can be run either as a standalone CLI or a Node.js dependency. As I’ve just been reminded, only the former has node_modules/hyphenopoly/patterns.
Getting import.meta.url as the second argument to the loader() / loaderSync() functions — or, even better, maybe something like new URL('./patterns', import.meta.url) — would help us prevent things like createRequire() to locate the patterns folder:
// before
loaderSync: file=>{returnreadFileSync(createRequire(import.meta.url).resolve(`hyphenopoly/patterns/${file}`));}// after
loaderSync: (file,patternsFolder)=>{returnreadFileSync(newURL(`./${file}`,patternsFolder));}
* Fixed the loading of the hyphenopoly language patterns, which did not work when using percollate programmatically. (#163)
* Update hyphenopoly after it updated the language loadaing behavior. #163mnater/Hyphenopoly#207
Since Hyphenopoly requires an explicit
loader
/loaderSync
function in Node and other non-browser JS runtimes, it would be great if these functions received Hyphenopoly’s module URL as a second argument, to make it easier to locate thepatterns
folder.For example, percollate, which uses Hyphenopoly for hyphenation, can be run either as a standalone CLI or a Node.js dependency. As I’ve just been reminded, only the former has
node_modules/hyphenopoly/patterns
.Getting
import.meta.url
as the second argument to theloader()
/loaderSync()
functions — or, even better, maybe something likenew URL('./patterns', import.meta.url)
— would help us prevent things likecreateRequire()
to locate the patterns folder:cc @yashha
The text was updated successfully, but these errors were encountered: