Helps Parcel load compiled versions of resx files.
It expects the files to be named after the resx-file, but with .ts
appended. So /foo/bar/baz.resx
should have a /foo/bar/baz.resx.ts
compiled file. The https://bitbucket.org/hejdoktor/resx-compiler/ project can help make these compiled files.
A minimal .parcelrc
file enabling only this resolver should look like the following:
{
"extends": ["@parcel/config-default"],
"resolvers": [
"@hejdoktor/parcel-resolver-resx", "..."
]
}
The point of this resolver is to enable the following code:
import { R } from "./some-translations.resx"
console.log(R.someTranslatedFile)
Without this resolver, parcel will see that some-translations.resx
exists and return the xml file. With this, it will instead return some-translations.resx.ts
, which should be a compiled version of the translation file.