Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@hejdoktor/parcel-resolver-resx

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hejdoktor/parcel-resolver-resx

Helps Parcel load compiled versions of resx files

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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.

Keywords

resx

FAQs

Package last updated on 08 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts