cevek / ttypescript

Over TypeScript tool to use custom transformers in the tsconfig.json
1.53k stars 56 forks source link

docs: add @magic-works/ttypescript-browser-like-import-transformer #81

Closed Jack-Works closed 4 years ago

Jack-Works commented 4 years ago

Hi! I have written an awesome transformer! With this transformer, people can write any node imports and use them directly in the browser (load as UMD)

Before

import React from 'react'
import * as AsyncCall from 'async-call-rpc'
import isarray from 'isarray'

After

const React = __bindCheck(__esModuleCheck(globalThis.React), ['default'], 'react', 'globalThis.React').default
import * as AsyncCall from 'https://unpkg.com/async-call-rpc@latest/?module'
import isarray from '/web_modules/isarray.js'
cevek commented 4 years ago

thank you!