ttypescript-browser-like-import-transformer

A custom transformer that can be used with ttypescript to transform ts imports to browser style imports


Project maintained by Jack-Works Hosted on GitHub Pages — Theme by mattgraham

Home > config > PluginConfigs > bareModuleRewrite

PluginConfigs.bareModuleRewrite property

Warning: This API is now obsolete.

Renamed to “rules”, will be removed in 3.0

The transformation rule. Specify how this transformer will handle your imports.

Signature:

bareModuleRewrite?: PluginConfigs['rules']

Remarks

This is the most powerful part of this transformer. You can specify the transform rule of bare imports (like import 'React') to the form that browser can recognize. See RewriteRulesObject

When it is a Record<string, RewriteRulesObject>, you can use two kinds of matching rule to matching your import paths.