stencil-custom-typescript-output-target
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

stencil-custom-typescript-output-target

version license build

StencilJS output target for compiling custom TypeScript in addition to your components.

I had a situation where I wanted to compile some TypeScript, outside of the main Stencil component compile (some custom code I wanted incluided in my package).

This custom output target will make Stencil compile this code when it builds:

// stencil.config.ts
import { Config } from '@stencil/core';
import { compileCustomTypescriptOutputTarget } from 'stencil-custom-typescript-output-target';

export const config: Config = {
    // ... rest of your config
    outputTargets: [
        // ... your other output targets
        compileCustomTypescriptOutputTarget({
            tsconfigPath: 'custom.tsconfig.json',
        }),
    ],
};

Config

CompileCustomTsOptions: config object:

tsconfigPath: path to the tsconfig.json file to use. This should include or specify files. It should probably exclude your other Stencil code, so you're not building things twice / pulling in things you didn't mean to.

skipValidate: optional bool to skip the validate stage of the output target. This will mean any TS compiler errors will be allowed through without any issue.

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i stencil-custom-typescript-output-target

    Weekly Downloads

    0

    Version

    1.1.0

    License

    GPL-3.0

    Unpacked Size

    47.8 kB

    Total Files

    13

    Last publish

    Collaborators

    • elwynelwyn