@hejdoktor/parcel-resolver-resx

1.0.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i @hejdoktor/parcel-resolver-resx

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

1.85 kB

Total Files

3

Last publish

Collaborators

  • fizker