@shopify/loom-plugin-typescript
v1.1.1
Published
loom technology plugin for typescript
Downloads
2,377
Keywords
Readme
@shopify/loom-plugin-typescript
This package provides a loom
plugin that runs TypeScript type-checking as part of the loom type-check
command.
This package does not make any assumptions about what TypeScript config you should used. You will need to configure TypeScript yourself. We recommend extending from the configs provided by @shopify/typescript-configs
.
Installation
yarn add @shopify/loom-plugin-typescript --dev
Usage
Add typescript
to your loom workspace plugins.
import {createWorkspace} from '@shopify/loom';
import {typescript} from '@shopify/loom-plugin-typescript';
// `createWorkspace` may be `createPackage`, or `createWebApp` if your workspace
// consists of a single project
export default createWorkspace((workspace) => {
workspace.use(typescript());
});
Hooks
This plugin adds the following hooks to BuildWorkspaceConfigurationCustomHooks
and TypeCheckWorkspaceConfigurationCustomHooks
:
typescriptHeap
: a number correponding to the max size in megabytes to use for node's old memory section.import {createWorkspacePlugin} from '@shopify/loom'; function demoPlugin() { return createWorkspacePlugin('Demo', ({tasks: {build, typeCheck}}) => { build.hook(({hooks}) => { hooks.configure.hook((configure) => { // Set the heap size to 2 gigabytes configure.typescriptHeap?.hook(() => 2048); }); }); typeCheck.hook(({hooks}) => { hooks.configure.hook((configure) => { // Set the heap size to 2 gigabytes configure.typescriptHeap?.hook(() => 2048); }); }); }); }