4.0.0 • Published 2 years ago

@u27n/typescript v4.0.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

U27N Typescript Plugin

This is a U27N plugin for translating typescript or plain javascript sources.

When writing text fragments, this plugin will automatically add and update fragment ids:

t("Hello World!");
// will be changed to:
t("Hello World!", "<some id>");

Setup

npm install --save-dev @u27n/typescript

Add the following to your u27n.json file:

{
    "include": [
        // Include typescript and javascript sources:
        "./src/*.{ts,tsx,js,jsx}"
    ],

    "plugins": [
        // Use all defaults:
        "@u27n/typescript",

        // Or customize the following default config:
        {
            "entry": "@u27n/typescript",
            "config": {
                // Path of the tsconfig file that is used
                // for mapping output filenames:
                "tsconfig": "./tsconfig.json",

                // If true, the parser tries to parse comment content as typescript
                // and marks fragments found in comments as disabled.
                "parseComments": false,

                // An array of function names to use.
                "functionNames": ["t"]
            }
        }
    ]
}

Compatibility

The table below shows what core and typescript versions are supported by this package.

@u27n/typescript@u27n/coretypescript
4.x3.x5.x
3.x2.x5.x
4.0.0

2 years ago

3.0.0

2 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago