1.0.0 • Published 1 year ago

@hejdoktor/parcel-resolver-resx v1.0.0

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
1 year ago

parcel-resolver-resx

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.

Setting up Parcel

A minimal .parcelrc file enabling only this resolver should look like the following:

{
    "extends": ["@parcel/config-default"],
    "resolvers": [
        "@hejdoktor/parcel-resolver-resx", "..."
    ]
}

Usage in code

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.

1.0.0

1 year ago