This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const visitor: ts.Visitor = (node: ts.Node): ts.Node => { | |
| if (ts.isImportDeclaration(node) && node.moduleSpecifier) { | |
| // This is the node we're looking for | |
| } | |
| return ts.visitEachChild(node, visitor) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function transform(opts: YourTransformerOpts): ts.TransformerFactory<ts.SourceFile> { | |
| return ctx => sf => transformNode(sf, opts) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const emitResult = program.emit( | |
| undefined, | |
| (fileName, content) => { | |
| ts.sys.writeFile(fileName, `/* @generated */${ts.sys.newLine}${content}`); | |
| }, | |
| undefined, | |
| undefined, | |
| { | |
| before: [ | |
| inlineImg({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const CJS_CONFIG: ts.CompilerOptions = { | |
| experimentalDecorators: true, | |
| jsx: ts.JsxEmit.React, | |
| module: ts.ModuleKind.ESNext, | |
| moduleResolution: ts.ModuleResolutionKind.NodeJs, | |
| noEmitOnError: false, | |
| noUnusedLocals: true, | |
| noUnusedParameters: true, | |
| stripInternal: true, | |
| declaration: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function compiler (configFilePath: string) { | |
| // tslint:disable-next-line no-any | |
| const host: ts.ParseConfigFileHost = ts.sys as any; | |
| // Fix after https://github.com/Microsoft/TypeScript/issues/18217 | |
| host.onUnRecoverableConfigFileDiagnostic = printDiagnostic; | |
| const parsedCmd = ts.getParsedCommandLineOfConfigFile(configFilePath, undefined, host); | |
| host.onUnRecoverableConfigFileDiagnostic = undefined; | |
| const {options, fileNames} = parsedCmd; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as styles from 'foo.css' | |
| type CssMap = typeof styles | |
| export const legacyCss: CssMap = { | |
| container: 'mc-foo', | |
| content: 'mc-content' | |
| } | |
| export interface Props { | |
| css: CssMap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as postcss from 'postcss' | |
| import { basename, resolve, join } from 'path' | |
| import { outputFileSync } from 'fs-extra' | |
| import { sync as globSync } from 'glob' | |
| import { readFileSync } from 'fs' | |
| import { watch as chokidarWatch } from 'chokidar' | |
| const { NODE_ENV } = process.env | |
| // Change CSS glob pattern |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // lib.js | |
| import formatRelative from 'intl-relativeformat' | |
| export function foo () { | |
| formatRelative() | |
| } | |
| export function bar () {} | |
| // main.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mr | Marathi | |
|---|---|---|
| bs | Bosnian | |
| ee_TG | Ewe (Togo) | |
| ms | Malay | |
| kam_KE | Kamba (Kenya) | |
| mt | Maltese | |
| ha | Hausa | |
| es_HN | Spanish (Honduras) | |
| ml_IN | Malayalam (India) | |
| ro_MD | Romanian (Moldova) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| var res = window.gamePage.resPool.resources; | |
| function findRes (type) { | |
| return res.filter(function (r) { | |
| return r.name === type; | |
| })[0]; | |
| } | |
| function setRes (type, amt) { |